BagEquipmentView.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. // using System.Collections.Generic;
  2. // using System.Linq;
  3. // using ET;
  4. // using FairyGUI;
  5. // using UI.BagEquipment;
  6. // using UI.Poem;
  7. // using UnityEngine;
  8. // using UI_Button6 = UI.BagEquipment.UI_Button6;
  9. // using UI_ComPhotoPostcard = UI.BagEquipment.UI_ComPhotoPostcard;
  10. // using UI_ListPhotoItem = UI.BagEquipment.UI_ListPhotoItem;
  11. //
  12. // namespace GFGGame
  13. // {
  14. //
  15. // public class BagEquipmentView : BaseWindow
  16. // {
  17. // private UI_BagEquipmentUI _ui;
  18. // private List<long> _listChoose = new List<long>();
  19. // private List<BagEquipmentData> _bagagEquipmentInfos;
  20. // private long equipmentDicKey;
  21. // public override void Dispose()
  22. // {
  23. // if (_ui != null)
  24. // {
  25. // _ui.Dispose();
  26. // _ui = null;
  27. // }
  28. // base.Dispose();
  29. // }
  30. //
  31. // protected override void OnInit()
  32. // {
  33. // base.OnInit();
  34. // packageName = UI_BagEquipmentUI.PACKAGE_NAME;
  35. // _ui = UI_BagEquipmentUI.Create();
  36. // this.viewCom = _ui.target;
  37. // isfullScreen = true;
  38. // isReturnView = true;
  39. //
  40. // _ui.m_list.SetVirtual();
  41. // _ui.m_list.itemRenderer = RenderListItem;
  42. // _ui.m_listTravel.SetVirtual();
  43. // _ui.m_listTravel.itemRenderer = RenderListTravelItem;
  44. // _ui.m_list.onClickItem.Add(OnListItemClick);
  45. //
  46. // _ui.m_btnback.onClick.Add(OnBtnBackClick);
  47. // _ui.m_c1.onChanged.Add(OnBtnTabChange);
  48. //
  49. // InitTypeList();
  50. // }
  51. //
  52. // private void OnBtnBackClick()
  53. // {
  54. // if (_ui.m_c2.selectedIndex == 1)
  55. // {
  56. // _ui.m_c2.selectedIndex = 0;
  57. // }
  58. // else
  59. // {
  60. // ViewManager.GoBackFrom(typeof(BagEquipmentView).FullName);
  61. // if (_ui.m_list.numItems > 0) _ui.m_list.ScrollToView(0);
  62. // _ui.m_c1.selectedIndex = 0;
  63. // }
  64. // _ui.m_c2.selectedIndex = 0;
  65. //
  66. // }
  67. //
  68. //
  69. // private void RenderListItem(int index, GObject obj)
  70. // {
  71. // UI_ListPhotoItem item = UI_ListPhotoItem.Proxy(obj);
  72. // if (_ui.m_c2.selectedIndex != 0 && _listChoose.IndexOf(_bagagEquipmentInfos[index].PictureId) >= 0)
  73. // {
  74. // item.m_c1.SetSelectedIndex(1);
  75. // }
  76. // else
  77. // {
  78. // item.m_c1.SetSelectedIndex(0);
  79. // }
  80. //
  81. // //将数据绑定到list列表里
  82. // BagEquipmentComponent equipmentComponent = GameGlobal.zoneScene.GetComponent<BagEquipmentComponent>();
  83. // if (equipmentComponent!=null)
  84. // {
  85. // if (equipmentComponent.EquipmentDic.Count>=index)
  86. // {
  87. // var equipmentlementAt = equipmentComponent.EquipmentDic.ElementAt(index).Value;
  88. // equipmentDicKey = equipmentComponent.EquipmentDic.ElementAt(index).Key;
  89. // item.m_txtTime.text = EquipmentCfgArray.Instance.GetCfg(equipmentlementAt.ConfigId).Name;
  90. // CommonDataManager.Tables.tbleq
  91. // }
  92. // }
  93. //
  94. // UI_ListPhotoItem.ProxyEnd();
  95. // }
  96. //
  97. // private void RenderListTravelItem(int index, GObject obj)
  98. // {
  99. // UI_ComPhotoPostcard item = UI_ComPhotoPostcard.Proxy(obj);
  100. // item.m_c1.selectedIndex = _ui.m_c2.selectedIndex != 0 && _listChoose.IndexOf(_bagagEquipmentInfos[index].PictureId) >= 0 ? 1 : 0;
  101. // UI_ComPhotoPostcard.ProxyEnd();
  102. // }
  103. //
  104. // private void OnBtnTabChange()
  105. // {
  106. // _ui.m_c2.selectedIndex = 0;
  107. // _listChoose.Clear();
  108. // UpdateView();
  109. //
  110. // }
  111. // private void UpdateView()
  112. // {
  113. // if (_ui.m_c1.selectedIndex == 0)
  114. // {
  115. // BagEquipmentComponent equipmentComponent = GameGlobal.zoneScene.GetComponent<BagEquipmentComponent>();
  116. // _ui.m_listTravel.numItems = 0;
  117. // _ui.m_list.numItems = equipmentComponent.EquipmentDic.Count;
  118. // }
  119. // else if(_ui.m_c1.selectedIndex == 1)
  120. // {
  121. // //_bagagEquipmentInfos = BagEquipmentDataManager.Instance.BagMaterialDatas;
  122. // _ui.m_list.numItems = 0;
  123. // _ui.m_listTravel.numItems = 10;
  124. // }
  125. // else if(_ui.m_c1.selectedIndex == 2)
  126. // {
  127. // _ui.m_list.numItems = 0;
  128. // _ui.m_listTravel.numItems = 0;
  129. // }
  130. // }
  131. //
  132. // protected override void AddEventListener()
  133. // {
  134. // base.AddEventListener();
  135. // EventAgent.AddEventListener(ConstMessage.UpBagEquipment, OnBtnTabChange);
  136. //
  137. // }
  138. // protected override void RemoveEventListener()
  139. // {
  140. // base.RemoveEventListener();
  141. // EventAgent.RemoveEventListener(ConstMessage.UpBagEquipment, OnBtnTabChange);
  142. //
  143. // }
  144. //
  145. // protected override void OnShown()
  146. // {
  147. // base.OnShown();
  148. // if (this.viewData != null)
  149. // {
  150. // _ui.m_c1.selectedIndex = (int)this.viewData;
  151. // }
  152. // OnBtnTabChange();
  153. //
  154. // //Timers.inst.AddUpdate(CheckGuide);
  155. // }
  156. //
  157. // /// <summary>
  158. // /// 初始化分类菜单文本,点击和未点击是两种样式,需要统一文字
  159. // /// </summary>
  160. // private void InitTypeList()
  161. // {
  162. // for (int i = 0; i < _ui.m_typeList.numChildren; i++)
  163. // {
  164. // UI_Button6 button6 = UI_Button6.Proxy(_ui.m_typeList.GetChildAt(i));
  165. // button6.m_title1.text = button6.target.title;
  166. // UI_Button6.ProxyEnd();
  167. // }
  168. // }
  169. //
  170. // private void OnListItemClick(EventContext context)
  171. // {
  172. // ViewManager.Show<EquipmentExchangeView>(equipmentDicKey);//equipmentDicKey:给子页面传数据
  173. // }
  174. //
  175. // }
  176. // }