You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

51 lines
1.3 KiB

  1. using System;
  2. using CIG.Translation;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class BuildingSpeedupPopupView : PopupBaseView
  6. {
  7. public void UpdateInfo(double timeleft, decimal cashCost, bool canSpeedupWithCash, decimal goldCost, bool videoOnly)
  8. {
  9. this._timeleftLabel.LocalizedString = Localization.TimeSpan(TimeSpan.FromSeconds(timeleft), false);
  10. this._goldCostLabel.LocalizedString = Localization.Integer(goldCost);
  11. this._cashCostLabel.LocalizedString = Localization.Integer(cashCost);
  12. this._cashButton.gameObject.SetActive(!videoOnly && canSpeedupWithCash);
  13. this._goldButton.gameObject.SetActive(!videoOnly);
  14. this._videoButton.gameObject.SetActive(videoOnly);
  15. }
  16. public void OnSpeedupCashClicked()
  17. {
  18. ((BuildingSpeedupPopupState)this.State).SpeedupCash();
  19. }
  20. public void OnSpeedupGoldClicked()
  21. {
  22. ((BuildingSpeedupPopupState)this.State).SpeedupGold();
  23. }
  24. public void OnSpeedupVideoClicked()
  25. {
  26. ((BuildingSpeedupPopupState)this.State).SpeedupVideo();
  27. }
  28. [SerializeField]
  29. private LocalizedText _timeleftLabel;
  30. [SerializeField]
  31. private LocalizedText _goldCostLabel;
  32. [SerializeField]
  33. private LocalizedText _cashCostLabel;
  34. [SerializeField]
  35. private Button _goldButton;
  36. [SerializeField]
  37. private Button _cashButton;
  38. [SerializeField]
  39. private Button _videoButton;
  40. }