using ET; using FairyGUI; using Hutool; using System.Collections.Generic; using UI.League; using UnityEngine; namespace GFGGame { public class LeagueTeaPartyView : BaseWindow { private UI_LeagueTeaPartyUI _ui; private List teaPartyItemList = new List(); public override void Dispose() { if (_ui != null) { _ui.Dispose(); _ui = null; } base.Dispose(); } protected override void OnInit() { base.OnInit(); packageName = UI_LeagueTeaPartyUI.PACKAGE_NAME; _ui = UI_LeagueTeaPartyUI.Create(); this.viewCom = _ui.target; isfullScreen = true; _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zjm_2_2"); _ui.m_btnBack.onClick.Add(OnBtnBackClick); _ui.m_btnChat.onClick.Add(OnBtnChatClick); _ui.m_btnChallenge.onClick.Add(OnBtnChallengeClick); _ui.m_btnReward.onClick.Add(OnBtnRewardClick); teaPartyItemList.Add(_ui.m_teaPartyItem1); teaPartyItemList.Add(_ui.m_teaPartyItem2); teaPartyItemList.Add(_ui.m_teaPartyItem3); teaPartyItemList.Add(_ui.m_teaPartyItem4); teaPartyItemList.Add(_ui.m_teaPartyItem5); teaPartyItemList.Add(_ui.m_teaPartyItem6); _ui.m_teaPartyItemTips.target.onClick.Add(OnTeaPartyItemTipsClick); int index = 0; int teaPartyType = 1; List teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(teaPartyType); foreach (var itemObj in teaPartyItemList) { itemObj.m_btnDetail.onClick.Add(OnBtnDetailClick); itemObj.m_iconRole.onClick.Add(OnBtnIconRoleClick); itemObj.m_txtRoleName.text = teapartyRoleCfg[index].name; index += 1; } } protected override void AddEventListener() { base.AddEventListener(); } protected override void OnShown() { base.OnShown(); } protected override void OnHide() { base.OnHide(); } protected override void RemoveEventListener() { base.RemoveEventListener(); } private void OnBtnChatClick() { ViewManager.Show(); } private void OnBtnChallengeClick() { PromptController.Instance.ShowFloatTextPrompt("开始挑战"); ViewManager.Show(); } private void OnBtnRewardClick() { ViewManager.Show(); } private void OnBtnBackClick() { ViewManager.GoBackFrom(typeof(LeagueView).FullName); } private void OnBtnDetailClick() { _ui.m_teaPartyItemTips.target.visible = true; } private void OnTeaPartyItemTipsClick() { _ui.m_teaPartyItemTips.target.visible = false; } private void OnBtnIconRoleClick() { FieldCfg _curCfg; _curCfg = FieldCfgArray.Instance.dataArray[FieldDataManager.Instance.difficulty]; int curLevelId = StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(_curCfg.type, 0, _curCfg.id)[0].id; ViewManager.Show(curLevelId, new object[] { typeof(LeagueTeaPartyView).FullName, null }, true); } } }