ClothingFosterFinishView.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. using System;
  2. using System.Collections;
  3. using FairyGUI;
  4. using UI.ClothingFoster;
  5. using UI.CommonGame;
  6. namespace GFGGame
  7. {
  8. public class ClothingFosterFinishView : BaseWindow
  9. {
  10. private UI_ClothingFosterFinishUI _ui;
  11. private int _suitId;
  12. private int _index;
  13. private SortedList _lastPropertyList;
  14. private SortedList _curPropertyList;
  15. public override void Dispose()
  16. {
  17. base.Dispose();
  18. }
  19. protected override void OnInit()
  20. {
  21. base.OnInit();
  22. packageName = UI_ClothingFosterFinishUI.PACKAGE_NAME;
  23. _ui = UI_ClothingFosterFinishUI.Create();
  24. this.viewCom = _ui.target;
  25. this.viewCom.Center();
  26. this.modal = true;
  27. // viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
  28. _ui.m_loaBg.onClick.Add(this.Hide);
  29. }
  30. protected override void OnShown()
  31. {
  32. base.OnShown();
  33. _suitId = (int)(this.viewData as object[])[0];
  34. _index = (int)(this.viewData as object[])[1];
  35. _ui.m_grpRenew.visible = false;
  36. _ui.m_loaBg.touchable = false;
  37. _ui.m_img.fillAmount = 0;
  38. _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("gxhd_bjbj");
  39. _lastPropertyList = (this.viewData as object[])[2] as SortedList;
  40. SuitFosterDataManager.Instance.GetPropertyData(_suitId, _index, out _curPropertyList, out SortedList _addPropertyList);
  41. SuitFosterData data = SuitFosterDataManager.Instance.GetSuitFosterData(_suitId);
  42. SuitFosterListCfg cfg = SuitFosterListCfgArray.Instance.GetCfg(_suitId);
  43. int count = ConstDressUpScoreType.scoreTypeList().Count;
  44. for (int i = 0; i < count; i++)
  45. {
  46. int score = i + 1;
  47. UI_ListPropertyItem comPrpperty = UI_ListPropertyItem.Proxy(_ui.target.GetChild("comProperty" + i));
  48. int property = (int)_lastPropertyList[score];
  49. comPrpperty.m_txtProperty.text = StringUtil.GetColorText(property.ToString(), "#5B4A3B");
  50. comPrpperty.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (score));
  51. UI_ListPropertyItem.ProxyEnd();
  52. UI_ListPropertyItem comAddPrpperty = UI_ListPropertyItem.Proxy(_ui.target.GetChild("comAddProperty" + i));
  53. int addProperty = (int)_curPropertyList[score];
  54. comAddPrpperty.m_txtProperty.text = StringUtil.GetColorText(addProperty.ToString(), addProperty == property ? "#5B4A3B" : "#FFDE9E");
  55. comAddPrpperty.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (score));
  56. UI_ListPropertyItem.ProxyEnd();
  57. }
  58. _ui.m_grpProperty.visible = true;
  59. _ui.m_t0.Play(() =>
  60. {
  61. int num = 0;
  62. Timers.inst.Add(0.01f, 100, (param) =>
  63. {
  64. num++;
  65. _ui.m_img.fillAmount += 0.1f;
  66. if (num == 10)
  67. {
  68. _ui.m_grpAddProperty.visible = true;
  69. _ui.m_t1.Play(() =>
  70. {
  71. _ui.m_grpRenew.visible = data.maintainStep >= cfg.renewOpenLv;
  72. _ui.m_loaBg.touchable = true;
  73. });
  74. }
  75. });
  76. });
  77. }
  78. protected override void OnHide()
  79. {
  80. base.OnHide();
  81. _ui.m_img.fillAmount = 0;
  82. _ui.m_grpRenew.visible = false;
  83. _ui.m_grpProperty.visible = false;
  84. _ui.m_grpAddProperty.visible = false;
  85. }
  86. }
  87. }