From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/SelectNumFrameDlg.cs | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/SelectNumFrameDlg.cs (limited to 'Client/Assets/Scripts/XMainClient/SelectNumFrameDlg.cs') diff --git a/Client/Assets/Scripts/XMainClient/SelectNumFrameDlg.cs b/Client/Assets/Scripts/XMainClient/SelectNumFrameDlg.cs new file mode 100644 index 00000000..ede2bf6a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/SelectNumFrameDlg.cs @@ -0,0 +1,109 @@ +using System; +using UILib; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class SelectNumFrameDlg : DlgBase + { + public override string fileName + { + get + { + return "GameSystem/Auction/AuctionBillFrame2"; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + private XRecycleItemDocument m_doc; + + private ulong m_uid; + + protected override void Init() + { + base.Init(); + this.m_doc = XDocuments.GetSpecificDocument(XRecycleItemDocument.uuID); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + base.uiBehaviour.m_closespr.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickClosed)); + base.uiBehaviour.m_sureBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickSureBtn)); + base.uiBehaviour.m_SinglePriceOperate.RegisterOperateChange(new AuctionNumberOperate.NumberOperateCallBack(this.OnNumOperateChange)); + } + + protected override void OnHide() + { + base.OnHide(); + } + + protected override void OnShow() + { + base.OnShow(); + this.FillContent(); + } + + public void Show(ulong uid) + { + this.m_uid = uid; + this.SetVisible(true, true); + } + + private void FillContent() + { + int num = 0; + XItem itemByUID = XBagDocument.BagDoc.GetItemByUID(this.m_uid); + bool flag = itemByUID != null; + if (flag) + { + num = itemByUID.itemCount - this.m_doc.GetSelectUidCount(this.m_uid); + } + XSingleton.singleton.DrawItem(base.uiBehaviour.m_itemGo, itemByUID); + IXUISprite ixuisprite = base.uiBehaviour.m_itemGo.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; + ixuisprite.ID = this.m_uid; + ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickTips)); + base.uiBehaviour.m_SinglePriceOperate.Set(num, 1, num, 1, true, true); + } + + private void OnNumOperateChange() + { + } + + private void OnClickClosed(IXUISprite spr) + { + this.SetVisible(false, true); + } + + private bool OnClickSureBtn(IXUIButton btn) + { + this.SetVisible(false, true); + this.m_doc._ToggleItemSelect(true, this.m_uid, (ulong)((long)base.uiBehaviour.m_SinglePriceOperate.Cur), true); + return true; + } + + private void OnClickTips(IXUISprite spr) + { + bool flag = spr.ID == 0UL; + if (!flag) + { + XItem xitem = XBagDocument.BagDoc.GetBagItemByUID(spr.ID); + bool flag2 = xitem == null; + if (flag2) + { + xitem = XBagDocument.MakeXItem((int)spr.ID, false); + } + XSingleton.singleton.ShowTooltipDialogWithSearchingCompare(xitem, spr, false, 0u); + } + } + } +} -- cgit v1.1-26-g67d0