diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/UI/XBriefStrengthenView.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/UI/XBriefStrengthenView.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/UI/XBriefStrengthenView.cs | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/UI/XBriefStrengthenView.cs b/Client/Assets/Scripts/XMainClient/UI/XBriefStrengthenView.cs new file mode 100644 index 00000000..8f0c7995 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/XBriefStrengthenView.cs @@ -0,0 +1,124 @@ +using System;
+using System.Collections.Generic;
+using UILib;
+using UnityEngine;
+using XMainClient.UI.UICommon;
+using XUtliPoolLib;
+
+namespace XMainClient.UI
+{
+ internal class XBriefStrengthenView : DlgBase<XBriefStrengthenView, XBriefStrengthenBehaviour>
+ {
+ public override string fileName
+ {
+ get
+ {
+ return "GameSystem/BriefStrengthenDlg";
+ }
+ }
+
+ public override int group
+ {
+ get
+ {
+ return 1;
+ }
+ }
+
+ public override bool autoload
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public override bool pushstack
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public static readonly int FUNCTION_NUM = 3;
+
+ private XFPStrengthenDocument _doc = null;
+
+ public XUIPool m_FpStrengthenPool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
+
+ public XUIPool m_FpButtonPool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
+
+ private List<FpStrengthenTable.RowData> m_BQList = null;
+
+ protected override void Init()
+ {
+ this._doc = XDocuments.GetSpecificDocument<XFPStrengthenDocument>(XFPStrengthenDocument.uuID);
+ }
+
+ public override void RegisterEvent()
+ {
+ base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClicked));
+ base.uiBehaviour.m_Close2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnCloseClicked));
+ base.uiBehaviour.m_More.RegisterLabelClickEventHandler(new LabelClickEventHandler(this._OnMoreClicked));
+ }
+
+ protected override void OnShow()
+ {
+ base.OnShow();
+ base.uiBehaviour.m_FuncPool.FakeReturnAll();
+ Vector3 tplPos = base.uiBehaviour.m_FuncPool.TplPos;
+ int num = 0;
+ this.m_BQList = this._doc.GetBQByType(200);
+ int num2 = 0;
+ while (num < XBriefStrengthenView.FUNCTION_NUM && num2 < this.m_BQList.Count)
+ {
+ FpStrengthenTable.RowData rowData = this.m_BQList[num2];
+ bool flag = rowData == null;
+ if (!flag)
+ {
+ GameObject gameObject = base.uiBehaviour.m_FuncPool.FetchGameObject(false);
+ gameObject.transform.localPosition = new Vector3(tplPos.x + (float)(num * base.uiBehaviour.m_FuncPool.TplWidth), tplPos.y);
+ IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite;
+ IXUILabel ixuilabel = gameObject.transform.Find("Name").GetComponent("XUILabel") as IXUILabel;
+ IXUISprite ixuisprite2 = gameObject.GetComponent("XUISprite") as IXUISprite;
+ ixuisprite.SetSprite(rowData.BQImageID);
+ ixuilabel.SetText(rowData.BQName);
+ ixuisprite2.ID = (ulong)((long)num2);
+ ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.GoToStrengthSys));
+ num++;
+ }
+ num2++;
+ }
+ base.uiBehaviour.m_FuncPool.ActualReturnAll(false);
+ }
+
+ public bool OnCloseClicked(IXUIButton sp)
+ {
+ this.SetVisible(false, true);
+ return true;
+ }
+
+ public void OnCloseClicked(IXUISprite sp)
+ {
+ this.SetVisible(false, true);
+ }
+
+ private void _OnMoreClicked(IXUILabel iLabel)
+ {
+ this.SetVisible(false, true);
+ DlgBase<XFpStrengthenView, XFPStrengthenBehaviour>.singleton.SetVisibleWithAnimation(true, null);
+ }
+
+ public void GoToStrengthSys(IXUISprite sp)
+ {
+ int num = (int)sp.ID;
+ this.SetVisible(false, true);
+ bool flag = num >= this.m_BQList.Count;
+ if (!flag)
+ {
+ XSingleton<XGameSysMgr>.singleton.OpenSystem((XSysDefine)this.m_BQList[num].BQSystem, 0UL);
+ }
+ }
+ }
+}
|