From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/UI/FashionStorageTooltipBase.cs | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/FashionStorageTooltipBase.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/FashionStorageTooltipBase.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/FashionStorageTooltipBase.cs b/Client/Assets/Scripts/XMainClient/UI/FashionStorageTooltipBase.cs new file mode 100644 index 00000000..ec07084d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/FashionStorageTooltipBase.cs @@ -0,0 +1,103 @@ +using System; +using UILib; +using UnityEngine; + +namespace XMainClient.UI +{ + internal class FashionStorageTooltipBase : TooltipDlg, ITooltipDlg where TDlgClass : IXUIDlg, new() where TUIBehaviour : TooltipDlgBehaviour + { + public override string fileName + { + get + { + return "GameSystem/FashionStorageToolTip"; + } + } + + protected XFashionStorageDocument m_doc; + + protected XFashionDocument m_fashionDoc; + + protected int itemID; + + public override bool HideToolTip(bool forceHide = false) + { + return base.HideToolTip(forceHide); + } + + protected override void Init() + { + base.Init(); + this.m_OperateList[0, 0] = new FashionStorageFashionPutOn(); + this.m_OperateList[0, 1] = new FashionStorageFashionPutOnSuit(); + this.m_OperateList[1, 0] = new FashionStorageFashionTakeOff(); + this.m_OperateList[1, 1] = new FashionStorageFashtionTakeOffSuit(); + this.m_OperateList[1, 2] = new FashionStorageColouring(); + this.m_OperateList[2, 0] = new FashionStorageButtonGoFashion(); + this.m_fashionDoc = XDocuments.GetSpecificDocument(XFashionDocument.uuID); + this.m_doc = XDocuments.GetSpecificDocument(XFashionStorageDocument.uuID); + } + + protected override void SetupToolTipButtons(GameObject goToolTip, XItem item, bool bMain) + { + base.SetupToolTipButtons(goToolTip, item, bMain); + this.itemID = item.itemID; + if (bMain) + { + bool flag = this.m_doc.fashionStorageType == FashionStorageType.OutLook; + if (flag) + { + bool flag2 = this.m_doc.FashionInBody(item.itemID); + if (flag2) + { + base._SetupButtonVisiability(goToolTip, 1, item); + } + else + { + base._SetupButtonVisiability(goToolTip, 0, item); + } + } + else + { + base._SetupButtonVisiability(goToolTip, 2, item); + } + } + } + + protected override bool OnButton1Clicked(IXUIButton button) + { + this._bButtonClickedThisFrame = true; + bool flag = this.m_OperateList[(int)button.ID, 0] != null; + if (flag) + { + this.m_OperateList[(int)button.ID, 0].OnButtonClick((ulong)((long)this.itemID), 0UL); + } + this.HideToolTip(true); + return true; + } + + protected override bool OnButton2Clicked(IXUIButton button) + { + this._bButtonClickedThisFrame = true; + bool flag = this.m_OperateList[(int)button.ID, 1] != null; + if (flag) + { + this.m_OperateList[(int)button.ID, 1].OnButtonClick((ulong)((long)this.itemID), 0UL); + } + this.HideToolTip(true); + return true; + } + + protected override bool OnButton3Clicked(IXUIButton button) + { + this._bButtonClickedThisFrame = true; + bool flag = this.m_OperateList[(int)button.ID, 2] != null; + if (flag) + { + this.m_OperateList[(int)button.ID, 2].OnButtonClick((ulong)((long)this.itemID), 0UL); + } + this.HideToolTip(true); + return true; + } + } +} -- cgit v1.1-26-g67d0