using System; using CIG.Translation; using UnityEngine; using UnityEngine.UI; public class HUDConfirmView : GUIView { public void OnOKButtonClicked() { ((HUDConfirmState)this.State).OKClicked(); } public void OnCancelButtonClicked() { ((HUDConfirmState)this.State).CancelClicked(); } public void OnFlipButtonClicked() { ((HUDConfirmState)this.State).FlipClicked(); } public void OnInstantButtonClicked() { ((HUDConfirmState)this.State).InstantClicked(); } public void HideHint() { this._hintLabel.gameObject.SetActive(false); } public void SetHintText(ILocalizedString text) { this._hintLabel.gameObject.SetActive(true); this._hintLabel.LocalizedString = text; } public void SetFlipButtonVisible(bool visible) { this._flipButton.gameObject.SetActive(visible); } public void UpdateImmediateCost(decimal? cost) { GameObject gameObject = this._instantButton.gameObject; if (cost != null) { if (!gameObject.activeSelf) { gameObject.SetActive(true); } this._instantCostLabel.LocalizedString = Localization.Integer(cost.Value); } else if (gameObject.activeSelf) { gameObject.SetActive(false); } } [SerializeField] private LocalizedText _hintLabel; [SerializeField] private Button _flipButton; [SerializeField] private Button _instantButton; [SerializeField] private LocalizedText _instantCostLabel; }