public void InitializePopUp(TicketPrinter printer) { pawnStatus = PawnManager.ReadPawnStatus(); this.printer = printer; popUp.SetActive(true); InitializeUpgradeBars(); printerImage.sprite = printer.GetPrinterSprite(); popUpProgressBar.maxValue = printer.BatchTime; // set up upgrade buttons UpdateUpgradeButtons(); InitializeTicketDropDown(); }
public void Populate() { image.sprite = activePrinter.GetPrinterSprite(); trayText.text = GameOperations.BigIntToString(activePrinter.TicketsPrinted) + "/" + GameOperations.BigIntToString(activePrinter.Capacity); if (!activePrinter.IsActive) { image.color = tintColor; trayText.gameObject.SetActive(false); slider.gameObject.SetActive(false); } else { image.color = Color.white; trayText.gameObject.SetActive(true); slider.gameObject.SetActive(true); } slider.maxValue = activePrinter.BatchTime; }
private void UpdateUpgradeButtons() { upgradeBatchSizeText.text = "N/A"; upgradeLuckText.text = GameOperations.BigIntToString(printer.LuckUpgradeCost); upgradeCapacityText.text = GameOperations.BigIntToString(printer.CapacityUpgradeCost); // batch size upgradeBatchSizeButton.gameObject.SetActive(false); // luck if (printer.LuckCurrentLevel == printer.LuckMaxLevel || pawnStatus.Money < printer.LuckUpgradeCost) { upgradeLuckButton.interactable = false; if (printer.LuckCurrentLevel == printer.LuckMaxLevel) { upgradeLuckText.text = "Max Level"; } } else { upgradeLuckButton.interactable = true; } // capacity if (printer.CapacityCurrentLevel == printer.CapacityMaxLevel || pawnStatus.Money < printer.CapacityUpgradeCost) { upgradeCapacityButton.interactable = false; if (printer.CapacityCurrentLevel == printer.CapacityMaxLevel) { upgradeCapacityText.text = "Max Level"; } } else { upgradeCapacityButton.interactable = true; } // Trade In Updates currentPrinterImage.sprite = printer.GetPrinterSprite(); nextPrinterImage.sprite = printer.GetNextPrinter().GetPrinterSprite(); }
public void InitializePopUp(TicketPrinter printer) { pawnStatus = PawnManager.ReadPawnStatus(); this.printer = printer; nextPrinter = printer.GetNextPrinter(); nextPrinter.PrinterIndex = this.printer.PrinterIndex; popUp.SetActive(true); printerImage.sprite = nextPrinter.GetPrinterSprite(); priceText.text = "This Will Cost:\n$" + GameOperations.BigIntToString(nextPrinter.PurchasePrice); if (pawnStatus.Money < nextPrinter.PurchasePrice) { yesButton.interactable = false; } else { yesButton.interactable = true; } InitializeUpgradeBars(); }