using System.Collections; public class XUiC_PermadeathRebirth : XUiController { public string TipText { get { return this.tipText; } set { this.tipText = value; this.IsDirty = true; } } public string TipTitle { get { return this.tipTitle; } set { this.tipTitle = value; this.IsDirty = true; } } public ToolTipEvent CloseEvent { get; set; } public override bool GetBindingValue(ref string value, string bindingName) { if (bindingName != null) { if (bindingName == "tiptext") { value = this.TipText; return true; } if (bindingName == "tiptitle") { value = this.TipTitle; return true; } } return false; } public XUiV_Rect Panel; public XUiV_Label Description; public override void Init() { base.Init(); ((XUiV_Button)base.GetChildById("clickable").ViewComponent).Controller.OnPress += this.closeButton_OnPress; Panel = (XUiV_Rect)GetChildById("content").ViewComponent; Description = (XUiV_Label)Panel.Controller.GetChildById("descriptionText").ViewComponent; } private void closeButton_OnPress(XUiController _sender, int _mouseButton) { base.xui.playerUI.windowManager.Close(base.WindowGroup.ID); } public override void OnOpen() { int num = UnityEngine.Random.Range(1, 3); Description.Text = Localization.Get("infoFuriousRamsayPermadeath" + num); base.OnOpen(); } public override void Update(float _dt) { base.Update(_dt); if (this.IsDirty) { base.RefreshBindings(true); this.IsDirty = false; } } public override void OnClose() { base.OnClose(); if (this.CloseEvent != null) { this.CloseEvent.HandleEvent(); this.CloseEvent = null; } if (this.nextTip != "") { GameManager.Instance.StartCoroutine(this.openTipLater(this.nextTip, base.xui.playerUI.entityPlayer)); this.nextTip = ""; } } protected IEnumerator openTipLater(string tip, EntityPlayerLocal player) { yield return new WaitForSeconds(0.5f); //XUiC_PermadeathRebirth.ShowTip(tip, player, null); yield break; } private string tipText = ""; private string tipTitle = ""; private string nextTip = ""; }