XiuFangView.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. using System.Collections;
  2. using UnityEngine;
  3. using UI.XiuFang;
  4. using FairyGUI;
  5. using ET;
  6. namespace GFGGame
  7. {
  8. public class XiuFangView : BaseWindow
  9. {
  10. private UI_XiuFangUI _ui;
  11. public override void Dispose()
  12. {
  13. if (_ui != null)
  14. {
  15. _ui.Dispose();
  16. _ui = null;
  17. }
  18. base.Dispose();
  19. }
  20. protected override void OnInit()
  21. {
  22. base.OnInit();
  23. packageName = UI_XiuFangUI.PACKAGE_NAME;
  24. _ui = UI_XiuFangUI.Create();
  25. this.viewCom = _ui.target;
  26. isfullScreen = true;
  27. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  28. _ui.m_component.m_btnClothingShop.onClick.Add(OnClickBtnClothingShop);
  29. _ui.m_component.m_btnSuitSynthetic.onClick.Add(OnClickBtnSuitSynthetic);
  30. _ui.m_component.m_btnClothingUpgrade.onClick.Add(OnClickBtnClothingUpgrade);
  31. _ui.m_component.m_btnDecompose.onClick.Add(OnClickBtnDecompose);
  32. }
  33. protected override void OnShown()
  34. {
  35. base.OnShown();
  36. _ui.m_component.target.scrollPane.SetPosX(0, false);
  37. _ui.m_component.m_grpLockClothingShop.visible = !FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(ClothingShopView).Name, false);
  38. if (_ui.m_component.m_grpLockClothingShop.visible)
  39. {
  40. _ui.m_component.m_txtLock0.text = FunctionOpenDataManager.Instance.GetOpenTips(typeof(ClothingShopView).Name);
  41. }
  42. _ui.m_component.m_btnClothingUpgrade.visible = !FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(SuitSyntheticView).Name, false);
  43. if (_ui.m_component.m_btnClothingUpgrade.visible)
  44. {
  45. _ui.m_component.m_txtLock1.text = FunctionOpenDataManager.Instance.GetOpenTips(typeof(SuitSyntheticView).Name);
  46. }
  47. _ui.m_component.m_grpLockClothingUpgrade.visible = !FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(ClothingListView).Name, false);
  48. if (_ui.m_component.m_grpLockClothingUpgrade.visible)
  49. {
  50. _ui.m_component.m_txtLock2.text = FunctionOpenDataManager.Instance.GetOpenTips(typeof(ClothingListView).Name);
  51. }
  52. _ui.m_component.m_grpLockDecompose.visible = !FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(ClothingDecomposeView).Name, false);
  53. if (_ui.m_component.m_grpLockDecompose.visible)
  54. {
  55. _ui.m_component.m_txtLock3.text = FunctionOpenDataManager.Instance.GetOpenTips(typeof(ClothingDecomposeView).Name);
  56. }
  57. GuideCfg cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.CLOTHING_DECOMPOSE);
  58. if (GuideDataManager.currentGuideId == cfg.id)
  59. {
  60. // _ui.m_component.target.scrollPane.ScrollLeft();// SetPosX(0, false);
  61. _ui.m_component.target.scrollPane.SetPosX(400, false);
  62. }
  63. Timers.inst.AddUpdate(CheckGuide);
  64. }
  65. protected override void OnHide()
  66. {
  67. base.OnHide();
  68. Timers.inst.Remove(CheckGuide);
  69. }
  70. private void OnClickBtnBack()
  71. {
  72. this.Hide();
  73. ViewManager.GoBackFrom(ViewName.XIU_FANG_VIEW);
  74. }
  75. private void OnClickBtnClothingShop()
  76. {
  77. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.FU_ZHUANG_DIAN, 1);
  78. ViewManager.Show(ViewName.CLOTHING_SHOP_VIEW, null, new object[] { ViewName.XIU_FANG_VIEW, this.viewData }, false, true);
  79. // this.Hide();
  80. }
  81. private void OnClickBtnSuitSynthetic()
  82. {
  83. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.FU_ZHUANG_HE_CHENG, 1);
  84. ViewManager.Show(ViewName.SUIT_SYNTHETIC_LIST_VIEW, null, new object[] { ViewName.XIU_FANG_VIEW, this.viewData });
  85. }
  86. private void OnClickBtnClothingUpgrade()
  87. {
  88. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.FU_ZHUANG_YANG_CHENG, 1);
  89. ViewManager.Show<ClothingListView>(null, new object[] { ViewName.XIU_FANG_VIEW, this.viewData }, false, true);
  90. // PromptController.Instance.ShowFloatTextPrompt("暂未开放", MessageType.WARNING);
  91. }
  92. private void OnClickBtnDecompose()
  93. {
  94. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.FU_ZHUANG_FEN_JIE, 1);
  95. ViewManager.Show<ClothingDecomposeView>(null, new object[] { ViewName.XIU_FANG_VIEW, this.viewData });
  96. }
  97. private void CheckGuide(object param)
  98. {
  99. if (GuideDataManager.IsGuideFinish(ConstGuideId.CLOTHING_SYNTHETIC) <= 0
  100. || GuideDataManager.IsGuideFinish(ConstGuideId.CLOTHING_DECOMPOSE) <= 0
  101. || GuideDataManager.IsGuideFinish(ConstGuideId.SUIT_LIST_VIEW) <= 0)
  102. {
  103. UpdateToCheckGuide(null);
  104. }
  105. else
  106. {
  107. Timers.inst.Remove(CheckGuide);
  108. }
  109. }
  110. protected override void UpdateToCheckGuide(object param)
  111. {
  112. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  113. GuideController.TryGuide(_ui.m_component.m_btnSuitSynthetic, ConstGuideId.CLOTHING_SYNTHETIC, 2, "这里可以查看已获得的服饰图谱。");
  114. GuideController.TryGuide(_ui.m_component.m_btnDecompose, ConstGuideId.CLOTHING_DECOMPOSE, 3, "这里可以消耗重复获得的服饰。");
  115. GuideController.TryGuide(_ui.m_component.m_btnClothingUpgrade, ConstGuideId.SUIT_LIST_VIEW, 2, "点击服装升级。");
  116. }
  117. }
  118. }