|
- using System;
- using CIG.Translation;
- using UnityEngine;
- using UnityEngine.UI;
-
- public class BuildingSpeedupPopupView : PopupBaseView
- {
- public void UpdateInfo(double timeleft, decimal cashCost, bool canSpeedupWithCash, decimal goldCost, bool videoOnly)
- {
- this._timeleftLabel.LocalizedString = Localization.TimeSpan(TimeSpan.FromSeconds(timeleft), false);
- this._goldCostLabel.LocalizedString = Localization.Integer(goldCost);
- this._cashCostLabel.LocalizedString = Localization.Integer(cashCost);
- this._cashButton.gameObject.SetActive(!videoOnly && canSpeedupWithCash);
- this._goldButton.gameObject.SetActive(!videoOnly);
- this._videoButton.gameObject.SetActive(videoOnly);
- }
-
- public void OnSpeedupCashClicked()
- {
- ((BuildingSpeedupPopupState)this.State).SpeedupCash();
- }
-
- public void OnSpeedupGoldClicked()
- {
- ((BuildingSpeedupPopupState)this.State).SpeedupGold();
- }
-
- public void OnSpeedupVideoClicked()
- {
- ((BuildingSpeedupPopupState)this.State).SpeedupVideo();
- }
-
- [SerializeField]
- private LocalizedText _timeleftLabel;
-
- [SerializeField]
- private LocalizedText _goldCostLabel;
-
- [SerializeField]
- private LocalizedText _cashCostLabel;
-
- [SerializeField]
- private Button _goldButton;
-
- [SerializeField]
- private Button _cashButton;
-
- [SerializeField]
- private Button _videoButton;
- }
|