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); 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); GetLeagueRatingAward(); } private async void GetLeagueRatingAward() { bool result = await LeagueSproxy.ReportTeapartyComplete(RoleDataManager.roleId); if (result) { } } protected override void OnHide() { base.OnHide(); Timers.inst.Remove(UpdateTime); ViewManager.Show(); } protected override void RemoveEventListener() { base.RemoveEventListener(); } private async void GetRoleContainerInfos() { bool result = await LeagueSproxy.GetRoleContainerInfos(RoleDataManager.roleId); if (result) { var roleContainerList = LeagueDataManager.Instance.RoleContainerList; for (int index = 0; index < teaPartyOverItemList.Count; index++) { teaPartyOverItemList[index].m_txtRoleName.text = teapartyRoleCfg[index].name; teaPartyOverItemList[index].m_txtGuildName.text = roleContainerList[index].MaxScoreRoleName; } } } private void OnBtnBackClick() { ViewManager.GoBackFrom(typeof(LeagueView).FullName); } private void OnBtnRewardClick() { ViewManager.Show(); } private void UpdateTime(object param) { OnBtnRewardClick(); Timers.inst.Remove(UpdateTime); } } }