using ET; using FairyGUI; using Hutool; using System.Collections.Generic; using UI.League; using UnityEngine; namespace GFGGame { public class LeagueTeaPartyOverView : BaseWindow { private UI_LeagueTeaPartyOverUI _ui; private List teaPartyOverItemList = new List(); private List teapartyRoleCfg; public override void Dispose() { if (_ui != null) { _ui.Dispose(); _ui = null; } base.Dispose(); } protected override void OnInit() { base.OnInit(); packageName = UI_LeagueTeaPartyOverUI.PACKAGE_NAME; _ui = UI_LeagueTeaPartyOverUI.Create(); this.viewCom = _ui.target; isfullScreen = true; _ui.m_loaBg.url = ResPathUtil.GetDressUpPath("chahuibg"); _ui.m_btnBack.onClick.Add(OnBtnBackClick); _ui.m_btnReward.onClick.Add(OnBtnRewardClick); _ui.m_btnRule.onClick.Add(RuleController.ShowRuleView); _ui.m_btnRule.data = 300022; teaPartyOverItemList.Add(_ui.m_TeaPartyOverItem1); teaPartyOverItemList.Add(_ui.m_TeaPartyOverItem2); teaPartyOverItemList.Add(_ui.m_TeaPartyOverItem3); teaPartyOverItemList.Add(_ui.m_TeaPartyOverItem4); teaPartyOverItemList.Add(_ui.m_TeaPartyOverItem5); teaPartyOverItemList.Add(_ui.m_TeaPartyOverItem6); teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(1); //LeagueDataManager.Instance.TeaPartyId } protected override void AddEventListener() { base.AddEventListener(); } protected override void OnShown() { base.OnShown(); GetRoleContainerInfos(); Timers.inst.Add(2, 1, UpdateTime); } protected override void OnHide() { base.OnHide(); Timers.inst.Remove(UpdateTime); } protected override void RemoveEventListener() { base.RemoveEventListener(); } private async void GetRoleContainerInfos() { bool result = await LeagueSproxy.GetRoleContainerInfos(); if (result) { for (int index = 0; index < teaPartyOverItemList.Count; index++) { teaPartyOverItemList[index].m_txtRoleName.text = teapartyRoleCfg[index].name; teaPartyOverItemList[index].m_txtGuildName.text = teapartyRoleCfg[index].name; } } } private void OnBtnBackClick() { ViewManager.GoBackFrom(typeof(LeagueView).FullName); } private void OnBtnRewardClick() { ViewManager.Show(); } private void UpdateTime(object param) { OnBtnRewardClick(); Timers.inst.Remove(UpdateTime); } } }