123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- 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<UI_comTeaPartyOverItem> teaPartyOverItemList = new List<UI_comTeaPartyOverItem>();
- private List<TeapartyRoleCfg> 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<LeagueTeaPartyView>();
- }
- 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<LeagueTeaPartyRewardView>();
- }
- private void UpdateTime(object param)
- {
- OnBtnRewardClick();
- Timers.inst.Remove(UpdateTime);
- }
- }
- }
|