LeagueMemberAppointView.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using ET;
  2. using FairyGUI;
  3. using UI.League;
  4. using UnityEngine;
  5. namespace GFGGame
  6. {
  7. //联盟成员管理
  8. public class LeagueMemberAppointView : BaseWindow
  9. {
  10. private UI_LeagueMemberAppointUI _ui;
  11. private LeagueMemberData _memberData;
  12. public override void Dispose()
  13. {
  14. if (_ui != null)
  15. {
  16. _ui.Dispose();
  17. _ui = null;
  18. }
  19. base.Dispose();
  20. }
  21. protected override void OnInit()
  22. {
  23. base.OnInit();
  24. packageName = UI_LeagueMemberAppointUI.PACKAGE_NAME;
  25. _ui = UI_LeagueMemberAppointUI.Create();
  26. this.viewCom = _ui.target;
  27. this.viewCom.Center();
  28. this.modal = true;
  29. viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
  30. _ui.m_btnRule.onClick.Add(OnBtnRuleClick);
  31. _ui.m_btnKick.onClick.Add(OnBtnKickClick);
  32. _ui.m_btnAppoint0.onClick.Add(OnBtnAppointClick);
  33. _ui.m_btnAppoint0.data = LeaguePos.Owner;
  34. _ui.m_btnAppoint1.onClick.Add(OnBtnAppointClick);
  35. _ui.m_btnAppoint1.data = LeaguePos.SubOwner;
  36. _ui.m_btnAppoint2.onClick.Add(OnBtnAppointClick);
  37. _ui.m_btnAppoint2.data = LeaguePos.Flower;
  38. }
  39. protected override void AddEventListener()
  40. {
  41. base.AddEventListener();
  42. }
  43. protected override void OnShown()
  44. {
  45. base.OnShown();
  46. _memberData = this.viewData as LeagueMemberData;
  47. }
  48. protected override void OnHide()
  49. {
  50. base.OnHide();
  51. }
  52. protected override void RemoveEventListener()
  53. {
  54. base.RemoveEventListener();
  55. }
  56. private void OnBtnRuleClick()
  57. {
  58. ViewManager.Show<RuleView>();
  59. }
  60. private void OnBtnKickClick()
  61. {
  62. AlertUI.Show("是否确认请离这个小伙伴")
  63. .SetLeftButton(true, "取消")
  64. .SetRightButton(true, "确认", async (object param) =>
  65. {
  66. bool result = await LeagueSproxy.ReqKickLeague(_memberData.RoleInfo.roleId);
  67. if (result)
  68. {
  69. Hide();
  70. }
  71. });
  72. }
  73. private void OnBtnAppointClick()
  74. {
  75. }
  76. private void UpdateView()
  77. {
  78. _ui.m_c1.selectedIndex = LeagueDataManager.Instance.LeagueData.LeagueMemberDatas[RoleDataManager.roleId].Pos == LeaguePos.Owner ? 1 : 0;
  79. _ui.m_btnAppoint0.title = "1/1";
  80. _ui.m_btnAppoint1.touchable = LeagueDataManager.Instance.LeagueData.SubOwnerId == 0 ? true : false;
  81. _ui.m_btnAppoint1.title = LeagueDataManager.Instance.LeagueData.SubOwnerId == 0 ? "0/1" : "1/1";
  82. _ui.m_btnAppoint2.touchable = LeagueDataManager.Instance.LeagueData.SubOwnerId == 0 ? true : false;
  83. }
  84. }
  85. }