From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/UI/XBossRewardDlg.cs | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/XBossRewardDlg.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/XBossRewardDlg.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/XBossRewardDlg.cs b/Client/Assets/Scripts/XMainClient/UI/XBossRewardDlg.cs new file mode 100644 index 00000000..bef8cf76 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/XBossRewardDlg.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using UILib; +using UnityEngine; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + public class XBossRewardDlg : XSingleton + { + private XGuildDragonDocument _Doc = null; + + private GameObject PanelObject; + + private IXUIButton m_lblClose; + + public IXUIScrollView m_ScrollView; + + private IXUIWrapContent m_WrapContent; + + public void Init(GameObject _go) + { + bool flag = this.PanelObject == null || this.PanelObject != _go; + if (flag) + { + this.PanelObject = _go; + this._Doc = XDocuments.GetSpecificDocument(XGuildDragonDocument.uuID); + this.m_lblClose = (_go.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.m_lblClose.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClick)); + this.m_ScrollView = (_go.transform.Find("Bg/ScrollView").GetComponent("XUIScrollView") as IXUIScrollView); + this.m_WrapContent = (_go.transform.Find("Bg/ScrollView/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent); + this.m_WrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.GuildRankWrapContentItemUpdated)); + } + this.RefreshGuildRoleRank(); + } + + private void GuildRankWrapContentItemUpdated(Transform t, int index) + { + List> currentRewardList = this._Doc.currentRewardList; + bool flag = index < 0 || index >= currentRewardList.Count; + if (!flag) + { + Seq2 seq = currentRewardList[index]; + XSingleton.singleton.normalItemDrawer.DrawItem(t.Find("ItemTpl").gameObject, (int)seq.value0, (int)seq.value1, false); + IXUISprite ixuisprite = t.Find("ItemTpl/Icon").GetComponent("XUISprite") as IXUISprite; + ixuisprite.ID = (ulong)seq.value0; + ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(XSingleton.singleton.OnItemClick)); + IXUILabel ixuilabel = t.Find("Name").GetComponent("XUILabel") as IXUILabel; + ixuilabel.SetText(this.GetName(index)); + IXUILabel ixuilabel2 = t.Find("Des").GetComponent("XUILabel") as IXUILabel; + ixuilabel2.SetText(this.GetDes(index)); + IXUILabel ixuilabel3 = t.Find("ItemTpl/ssssss").GetComponent("XUILabel") as IXUILabel; + ixuilabel3.SetText(this.GetLabel(index)); + } + } + + private string GetName(int index) + { + string str = this._Doc.dicRewardName[index]; + return XStringDefineProxy.GetString(str + "_TITLE"); + } + + private string GetLabel(int index) + { + string key = this._Doc.dicRewardName[index]; + return XStringDefineProxy.GetString(key); + } + + private string GetDes(int index) + { + string key = this._Doc.dicRewardDes[index]; + return XStringDefineProxy.GetString(key); + } + + public void RefreshGuildRoleRank() + { + this.m_WrapContent.SetContentCount(this._Doc.currentRewardList.Count, false); + this.m_ScrollView.ResetPosition(); + } + + private bool OnCloseClick(IXUIButton button) + { + this.PanelObject.SetActive(false); + return true; + } + } +} -- cgit v1.1-26-g67d0