LeagueTeaPartyView.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. using ET;
  2. using FairyGUI;
  3. using Hutool;
  4. using System.Collections.Generic;
  5. using UI.League;
  6. using UnityEngine;
  7. namespace GFGGame
  8. {
  9. //联盟
  10. public class LeagueTeaPartyView : BaseWindow
  11. {
  12. private UI_LeagueTeaPartyUI _ui;
  13. private List<UI_comTeaPartyItem> teaPartyItemList = new List<UI_comTeaPartyItem>();
  14. public override void Dispose()
  15. {
  16. if (_ui != null)
  17. {
  18. _ui.Dispose();
  19. _ui = null;
  20. }
  21. base.Dispose();
  22. }
  23. protected override void OnInit()
  24. {
  25. base.OnInit();
  26. packageName = UI_LeagueTeaPartyUI.PACKAGE_NAME;
  27. _ui = UI_LeagueTeaPartyUI.Create();
  28. this.viewCom = _ui.target;
  29. isfullScreen = true;
  30. _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zjm_2_2");
  31. _ui.m_btnBack.onClick.Add(OnBtnBackClick);
  32. _ui.m_btnChat.onClick.Add(OnBtnChatClick);
  33. _ui.m_btnChallenge.onClick.Add(OnBtnChallengeClick);
  34. teaPartyItemList.Add(_ui.m_teaPartyItem1);
  35. teaPartyItemList.Add(_ui.m_teaPartyItem2);
  36. teaPartyItemList.Add(_ui.m_teaPartyItem3);
  37. teaPartyItemList.Add(_ui.m_teaPartyItem4);
  38. teaPartyItemList.Add(_ui.m_teaPartyItem5);
  39. teaPartyItemList.Add(_ui.m_teaPartyItem6);
  40. _ui.m_teaPartyItemTips.target.onClick.Add(OnTeaPartyItemTipsClick);
  41. foreach (var itemObj in teaPartyItemList) {
  42. itemObj.m_btnDetail.onClick.Add(OnBtnDetailClick);
  43. itemObj.m_iconRole.onClick.Add(OnBtnIconRoleClick);
  44. }
  45. }
  46. protected override void AddEventListener()
  47. {
  48. base.AddEventListener();
  49. }
  50. protected override void OnShown()
  51. {
  52. base.OnShown();
  53. }
  54. protected override void OnHide()
  55. {
  56. base.OnHide();
  57. }
  58. protected override void RemoveEventListener()
  59. {
  60. base.RemoveEventListener();
  61. }
  62. private void OnBtnChatClick()
  63. {
  64. ViewManager.Show<LeagueChatView>();
  65. }
  66. private void OnBtnChallengeClick()
  67. {
  68. PromptController.Instance.ShowFloatTextPrompt("开始挑战");
  69. }
  70. private void OnBtnBackClick()
  71. {
  72. ViewManager.GoBackFrom(typeof(LeagueView).FullName);
  73. }
  74. private void OnBtnDetailClick()
  75. {
  76. _ui.m_teaPartyItemTips.target.visible = true;
  77. }
  78. private void OnTeaPartyItemTipsClick()
  79. {
  80. _ui.m_teaPartyItemTips.target.visible = false;
  81. }
  82. private void OnBtnIconRoleClick()
  83. {
  84. FieldCfg _curCfg;
  85. _curCfg = FieldCfgArray.Instance.dataArray[FieldDataManager.Instance.difficulty];
  86. int curLevelId = StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(_curCfg.type, 0, _curCfg.id)[0].id;
  87. ViewManager.Show<DressUpFightView>(curLevelId, new object[] { typeof(LeagueTeaPartyView).FullName, null }, true);
  88. }
  89. }
  90. }