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/GuildArenaHallHandle.cs | 222 +++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/GuildArenaHallHandle.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/GuildArenaHallHandle.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/GuildArenaHallHandle.cs b/Client/Assets/Scripts/XMainClient/UI/GuildArenaHallHandle.cs new file mode 100644 index 00000000..4b9f4d50 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/GuildArenaHallHandle.cs @@ -0,0 +1,222 @@ +using System; +using KKSG; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class GuildArenaHallHandle : GVGHallBase + { + protected override string FileName + { + get + { + return "Guild/GuildArena/HallFrame"; + } + } + + private XGuildArenaDocument _Doc; + + private IXUILabel m_Status; + + private IXUIButton m_SignUp; + + private IXUILabel m_SignUpLabel; + + private bool m_responseNow = false; + + public override void OnUpdate() + { + base.OnUpdate(); + bool responseNow = this.m_responseNow; + if (responseNow) + { + this.UpdateSignUpTime(); + } + } + + protected override void Init() + { + base.Init(); + this._Doc = XDocuments.GetSpecificDocument(XGuildArenaDocument.uuID); + this.m_Status = (base.PanelObject.transform.Find("Go/Status").GetComponent("XUILabel") as IXUILabel); + this.m_SignUp = (base.PanelObject.transform.Find("Go/Btn_Go").GetComponent("XUIButton") as IXUIButton); + this.m_SignUpLabel = (base.PanelObject.transform.Find("Go/Btn_Go/Go").GetComponent("XUILabel") as IXUILabel); + this.SetupRewardList(XSingleton.singleton.GetAndSeparateValue("Guild_Arena_Award", XGlobalConfig.ListSeparator)); + } + + protected override void OnShow() + { + base.OnShow(); + this.StackRefresh(); + } + + protected override int GetContentSize() + { + return this._Doc.IntegralUnits.Count; + } + + public override void StackRefresh() + { + this._Doc.SendGetApplyGuildList(); + this.UpdateSignStatu(); + } + + public override void RefreshData() + { + base.RefreshData(); + this.UpdateSignStatu(); + } + + protected override void OnItemWrapUpdate(Transform t, int index) + { + IXUILabel ixuilabel = t.Find("Rank").GetComponent("XUILabel") as IXUILabel; + IXUILabelSymbol ixuilabelSymbol = t.Find("GuildName").GetComponent("XUILabelSymbol") as IXUILabelSymbol; + IXUILabel ixuilabel2 = t.Find("Score").GetComponent("XUILabel") as IXUILabel; + bool flag = index == -1; + if (flag) + { + ixuilabel.SetText(string.Empty); + ixuilabelSymbol.InputText = XStringDefineProxy.GetString("GUILD_ARENA_UNLAYOUT"); + ixuilabel2.SetText(string.Empty); + } + else + { + Integralunit integralunit = this._Doc.IntegralUnits[index]; + ixuilabel.SetText((index + 1).ToString()); + ixuilabelSymbol.InputText = integralunit.name; + ixuilabel2.SetText(integralunit.guildscore.ToString()); + bool flag2 = integralunit.guildid == this.selfGuildID; + if (flag2) + { + this.selfIndex = index; + } + } + } + + private void UpdateSignUpTime() + { + bool flag = this._Doc.RegistrationTime > 0.0; + if (flag) + { + this.m_Status.SetText(XStringDefineProxy.GetString("GUILD_ARENA_SIGN_TIME", new object[] + { + XSingleton.singleton.TimeDuarationFormatString((int)this._Doc.RegistrationTime, 5) + })); + } + else + { + this.m_Status.SetText(XStringDefineProxy.GetString("GUILD_ARENA_OVER")); + this.UpdateSignStatu(); + } + } + + private void UpdateSignStatu() + { + this.m_responseNow = false; + bool flag = this._Doc.BattleStep == GuildArenaType.notopen; + if (flag) + { + this.m_Status.SetText(XStringDefineProxy.GetString("GUILD_ARENA_UNOPEN")); + } + else + { + bool flag2 = this._Doc.BattleStep == GuildArenaType.resttime; + if (flag2) + { + this.m_Status.SetText(XStringDefineProxy.GetString("GUILD_ARENA_OVER")); + } + else + { + bool flag3 = this._Doc.RegistrationTime > 0.0; + if (flag3) + { + this.m_responseNow = true; + } + else + { + this.m_Status.SetText(XStringDefineProxy.GetString("GUILD_ARENA_OVER")); + } + } + } + bool flag4 = this._Doc.BattleStep == GuildArenaType.notopen || !this._Doc.RegistrationStatu; + if (flag4) + { + this.m_SignUpLabel.SetText(XStringDefineProxy.GetString("GUILD_ARENA_SIGN_HAVE")); + } + else + { + this.m_SignUpLabel.SetText(XStringDefineProxy.GetString("GUILD_ARENA_SIGN_SHOW")); + } + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + bool flag5 = specificDocument.Position == GuildPosition.GPOS_VICELEADER || specificDocument.Position == GuildPosition.GPOS_LEADER; + this.m_SignUp.SetGrey(this._Doc.RegistrationStatu || (this._Doc.BattleStep == GuildArenaType.apply && flag5)); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + this.m_SignUp.RegisterClickEventHandler(new ButtonClickEventHandler(this.RegistractionClick)); + } + + private bool RegistractionClick(IXUIButton btn) + { + bool flag = this._Doc.BattleStep == GuildArenaType.notopen; + bool result; + if (flag) + { + result = false; + } + else + { + bool registrationStatu = this._Doc.RegistrationStatu; + if (registrationStatu) + { + bool flag2 = this._Doc.BattleStep == GuildArenaType.battlefinal; + if (flag2) + { + DlgBase.singleton.SelectTabIndex(GuildArenaTab.Combat); + } + else + { + DlgBase.singleton.SelectTabIndex(GuildArenaTab.Duel); + } + } + else + { + bool flag3 = this._Doc.BattleStep != GuildArenaType.apply; + if (flag3) + { + return false; + } + bool flag4 = this._Doc.RegistrationTime > 0.0; + if (flag4) + { + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + bool flag5 = specificDocument.CheckUnlockLevel(XSysDefine.XSys_GuildPvp); + if (flag5) + { + bool flag6 = specificDocument.Position == GuildPosition.GPOS_VICELEADER || specificDocument.Position == GuildPosition.GPOS_LEADER; + if (flag6) + { + this._Doc.SendApplyGuildArena(); + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_ARENA_SIGN_PROFESSION"), "fece00"); + } + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_ARENA_SIGN_LOW_LEVEL"), "fece00"); + } + } + } + result = true; + } + return result; + } + } +} -- cgit v1.1-26-g67d0