DressUpView.cs 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077
  1. using UI.DressUp;
  2. using FairyGUI;
  3. using UnityEngine;
  4. using System.Collections.Generic;
  5. using ET;
  6. namespace GFGGame
  7. {
  8. public class DressUpView : BaseView
  9. {
  10. public const int MAX_MEMORY_STEP = 20;//最大记录步数
  11. public const int BOTTOM_BLANK = 20;
  12. public const int RIGHT_BLANK = 36;
  13. private const int SORT_BY_HIGH_RARITY = 0;
  14. private const int SORT_BY_LOW_RARITY = 1;
  15. private const int SORT_BY_GET_TIME = 2;
  16. private UI_DressUpUI _ui;
  17. private float listType1X = 0;
  18. private float partsListX = 0;
  19. private DressUpListType currentListType;
  20. /// <summary>
  21. /// 子菜单列表
  22. /// </summary>
  23. private int[] _currentList2;
  24. private GameObject _scenePrefab;
  25. private GameObject _sceneObject;
  26. private List<int> _currentList3 = new List<int>();
  27. private List<int> _currentList4 = new List<int>();
  28. private int _currentMenuType;
  29. private int _currentSuitId;
  30. private bool _isNormalSuitType = false;//当前套装部件列表是否为普通动作列表
  31. private int _rarityIndex = SORT_BY_HIGH_RARITY;
  32. private UI_TypeItem listTypeItem_FreedomDress;
  33. private List<LongPressGesture> _listLongPress = new List<LongPressGesture>();
  34. private int currentIndex = 0;
  35. private int _stepIndex = -1;
  36. private List<CustomSuitData> _dressMemory = new List<CustomSuitData>();
  37. public override void Dispose()
  38. {
  39. if (_sceneObject != null)
  40. {
  41. GameObject.Destroy(_sceneObject);
  42. _sceneObject = null;
  43. }
  44. for (int i = 0; i < _listLongPress.Count; i++)
  45. {
  46. _listLongPress[i].Dispose();
  47. }
  48. _listLongPress.Clear();
  49. if (_ui != null)
  50. {
  51. _ui.Dispose();
  52. _ui = null;
  53. }
  54. base.Dispose();
  55. }
  56. protected override void Init()
  57. {
  58. base.Init();
  59. packageName = UI_DressUpUI.PACKAGE_NAME;
  60. _ui = UI_DressUpUI.Create();
  61. viewCom = _ui.target;
  62. isfullScreen = true;
  63. _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUp"));
  64. }
  65. protected override void OnInit()
  66. {
  67. base.OnInit();
  68. _ui.m_btnLastStep.visible = false;
  69. _ui.m_btnNextStep.visible = false;
  70. _ui.m_btnSearch.visible = true;
  71. _ui.m_btnPhoto.visible = true;
  72. _ui.m_btnAction.visible = false;
  73. // _ui.m_comboBox.items = new string[] { "我的套装一", "我的套装二", "我的套装三", "我的套装四", "我的套装五", "我的套装六" };
  74. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  75. InitLists();
  76. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  77. _ui.m_btnHome.onClick.Add(OnClickBtnHome);
  78. _ui.m_btnLastStep.onClick.Add(OnClickBtnLastStep);
  79. _ui.m_btnNextStep.onClick.Add(OnClickBtnNextStep);
  80. _ui.m_comboBox.onChanged.Add(OnComboBoxChanged);
  81. _ui.m_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
  82. _ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
  83. // _ui.m_partsList.m_list.SetVirtual();
  84. _ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
  85. _ui.m_partsList2.m_list.onClickItem.Add(OnClickSuitPartsListItem);
  86. _ui.m_touchPad.onClick.Add(OnTouchPad);
  87. _ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
  88. _ui.m_btnSave.onClick.Add(OnClickBtnSave);
  89. _ui.m_partsList.m_comboBoxRarity.onChanged.Add(OnComboBoxRarityChanged);
  90. _ui.m_btnAction.onClick.Add(OnClickBtnAction);
  91. _ui.m_btnSearch.onClick.Add(OnClickBtnSearch);
  92. _ui.m_btnNext.onClick.Add(OnClickBtnNext);
  93. _ui.m_btnShow.onClick.Add(OnClickBtnShow);
  94. _ui.m_btnHide.onClick.Add(OnClickBtnHide);
  95. _ui.m_loaShow.onClick.Add(OnClickLoaShow);
  96. _ui.m_btnPhoto.onClick.Add(OnClickBtnPhoto);
  97. _ui.m_partsList2.m_comboBoxRarity.visible = false;
  98. _ui.m_partsList2.m_imgTop.visible = true;
  99. _ui.m_partsList.m_imgTop.visible = false;
  100. }
  101. protected override void AddEventListener()
  102. {
  103. base.AddEventListener();
  104. EventAgent.AddEventListener(ConstMessage.CLOSE_PHOTOGRAPHVIEW, UpdateScene);
  105. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
  106. EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
  107. }
  108. protected override void OnShown()
  109. {
  110. base.OnShown();
  111. if (this.viewData != null)
  112. {
  113. _ui.m_c2.selectedIndex = (int)this.viewData;
  114. }
  115. _rarityIndex = SORT_BY_HIGH_RARITY;
  116. // MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DRESS_UP, "mp3"));
  117. _ui.m_comListType1.target.x = _ui.target.width;
  118. _ui.m_comListType2.target.x = _ui.target.width;
  119. _ui.m_partsList.target.x = _ui.target.width;
  120. _ui.m_partsList2.target.x = _ui.target.width;
  121. this.showListType1();
  122. if (_sceneObject == null)
  123. {
  124. _sceneObject = GameObject.Instantiate(_scenePrefab);
  125. }
  126. MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject);
  127. currentIndex = CustomSuitDataManager.currentIndex;
  128. _ui.m_comboBox.items = CustomSuitDataManager.GetSuitPosItems();
  129. _ui.m_comboBox.selectedIndex = currentIndex;
  130. MyDressUpHelper.PutOnSuitSavedByPos(currentIndex);
  131. Timers.inst.AddUpdate(CheckGuide);
  132. }
  133. protected override void OnHide()
  134. {
  135. base.OnHide();
  136. listTypeItem_FreedomDress = null;
  137. // MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
  138. MyDressUpHelper.dressUpObj.TakeOffAll();
  139. if (_sceneObject != null)
  140. {
  141. GameObject.Destroy(_sceneObject);
  142. _sceneObject = null;
  143. }
  144. _ui.m_c2.selectedIndex = 0;
  145. Reset();
  146. Timers.inst.Remove(CheckGuide);
  147. }
  148. protected override void RemoveEventListener()
  149. {
  150. base.RemoveEventListener();
  151. EventAgent.RemoveEventListener(ConstMessage.CLOSE_PHOTOGRAPHVIEW, UpdateScene);
  152. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
  153. EventAgent.RemoveEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
  154. }
  155. private void OnClickBtnBack()
  156. {
  157. Reset();
  158. // this.Hide();
  159. // ViewManager.Show(ViewName.MAINUI_VIEW);
  160. ViewManager.GoBackFrom(typeof(DressUpView).FullName);
  161. }
  162. private void OnClickBtnHome()
  163. {
  164. GameController.GoBackToMainView();
  165. Reset();
  166. }
  167. private void Reset()
  168. {
  169. DressUpMenuItemDataManager.Clear();
  170. _stepIndex = -1;
  171. _dressMemory.Clear();
  172. }
  173. private void OnClickBtnLastStep()
  174. {
  175. if (_stepIndex - 1 < 0) return;
  176. _stepIndex--;
  177. MyDressUpHelper.dressUpObj.PutOnDressUpData(_dressMemory[_stepIndex].dressUpData);
  178. _ui.m_comboBox.selectedIndex = _dressMemory[_stepIndex].pos;
  179. UpdateStepBtn();
  180. }
  181. private void OnClickBtnNextStep()
  182. {
  183. if (_stepIndex + 1 >= MAX_MEMORY_STEP) return;
  184. _stepIndex++;
  185. MyDressUpHelper.dressUpObj.PutOnDressUpData(_dressMemory[_stepIndex].dressUpData);
  186. _ui.m_comboBox.selectedIndex = _dressMemory[_stepIndex].pos;
  187. UpdateStepBtn();
  188. }
  189. private void OnComboBoxChanged()
  190. {
  191. if (_ui.m_comboBox.selectedIndex == currentIndex) return;
  192. if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.Gold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.Gold))
  193. {
  194. ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_GOLD_CARD });
  195. _ui.m_comboBox.selectedIndex = currentIndex;
  196. return;
  197. }
  198. if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.BlackGold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.BlackGold))
  199. {
  200. ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_BLACK_CARD });
  201. _ui.m_comboBox.selectedIndex = currentIndex;
  202. return;
  203. }
  204. currentIndex = _ui.m_comboBox.selectedIndex;
  205. MyDressUpHelper.PutOnSuitSavedByPos(_ui.m_comboBox.selectedIndex);
  206. }
  207. private void OnClickListType1Item(EventContext context)
  208. {
  209. GObject typeItem = (GObject)context.data as GObject;
  210. int order = (int)typeItem.data;
  211. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[order - 1];
  212. if (item1.subMenusArr.Length > 0)
  213. {
  214. this.showListType2(item1.subMenusArr);
  215. }
  216. else
  217. {
  218. if (this.showListParts(item1.type) == false)
  219. {
  220. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  221. return;
  222. }
  223. }
  224. this.hideListType1();
  225. UpdateListPartsSelected();
  226. }
  227. private void OnClickListType2Item(EventContext context)
  228. {
  229. GObject typeItem = (GObject)context.data as GObject;
  230. int order = (int)typeItem.data;
  231. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[order - 1];
  232. if (this.showListParts(item2.type) == false)
  233. {
  234. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  235. return;
  236. }
  237. this.hideListType2();
  238. }
  239. private void OnClickPartsListItem(EventContext context)
  240. {
  241. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  242. {
  243. return;
  244. }
  245. UI_PartsListItem listItem = UI_PartsListItem.Proxy(context.data as GObject);// (GObject)context.data as GObject;
  246. int id = (int)listItem.target.data;
  247. // bool isSuit = SuitCfgArray.Instance.GetTotalCountOfOneSuit(id) > 0;
  248. if (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG)
  249. {
  250. if (GuideDataManager.IsGuideFinish(ConstGuideId.FREEDOM_DRESS) <= 0 && GuideDataManager.currentGuideId == GuideCfgArray.Instance.GetCfg(ConstGuideId.FREEDOM_DRESS).id)
  251. {
  252. ShowSuitPartList(id, true);
  253. }
  254. else if (SuitCfgArray.Instance.CheckSuitHasAction(id))
  255. {
  256. listItem.m_comAxtionSelect.target.visible = true;
  257. UI_PartsListItem.ProxyEnd();
  258. }
  259. else
  260. {
  261. ShowSuitPartList(id, false);
  262. }
  263. }
  264. else if (_currentMenuType == ConstDressUpItemType.DONG_ZUO)
  265. {
  266. MyDressUpHelper.dressUpObj.PutOnOrTakeOffAction(id);
  267. }
  268. else
  269. {
  270. if (MyDressUpHelper.dressUpObj.IsAction)
  271. {
  272. if (SuitCfgArray.Instance.CheckItemReaplaceableByAction(id, MyDressUpHelper.dressUpObj.actionId))
  273. {
  274. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  275. }
  276. else
  277. {
  278. if (!SuitCfgArray.Instance.CheckActionContainsItem(id, MyDressUpHelper.dressUpObj.actionId))
  279. {
  280. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  281. }
  282. MyDressUpHelper.dressUpObj.CancelAction();
  283. }
  284. }
  285. else
  286. {
  287. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  288. }
  289. }
  290. UpdateListPartsSelected(id);
  291. UpdateListSuitPartsSelected();
  292. // AddMemoryDressup();
  293. }
  294. private void OnBtnNormalClick(EventContext context)
  295. {
  296. // _isNormalSuitType = true;
  297. GObject gObject = context.sender as GObject;
  298. int suitId = (int)gObject.data;
  299. ShowSuitPartList(suitId, false);
  300. }
  301. private void OnBtnActionClick(EventContext context)
  302. {
  303. // _isNormalSuitType = false;
  304. GObject gObject = context.sender as GObject;
  305. int suitId = (int)gObject.data;
  306. ShowSuitPartList(suitId, true);
  307. }
  308. private void ShowSuitPartList(int suitId, bool showAction)
  309. {
  310. _isNormalSuitType = !showAction;
  311. this.showListParts2(suitId);
  312. this.hideListParts();
  313. MyDressUpHelper.dressUpObj.TakeOffAll();
  314. if (showAction)
  315. {
  316. MyDressUpHelper.dressUpObj.PutOnSuitCfg(suitId, true);
  317. }
  318. else
  319. {
  320. MyDressUpHelper.dressUpObj.PutOnSuitCfg(suitId, false);
  321. }
  322. }
  323. private void OnClickSuitPartsListItem(EventContext context)
  324. {
  325. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  326. {
  327. return;
  328. }
  329. GObject listItem = (GObject)context.data as GObject;
  330. int id = (int)listItem.data;
  331. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  332. if (itemCfg != null)
  333. {
  334. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  335. }
  336. else
  337. {
  338. MyDressUpHelper.dressUpObj.PutOnOrTakeOffAction(id);
  339. }
  340. UpdateListSuitPartsSelected();
  341. }
  342. private void AddMemoryDressup()
  343. {
  344. _stepIndex++;
  345. if (_stepIndex == MAX_MEMORY_STEP)
  346. {
  347. _stepIndex = MAX_MEMORY_STEP - 1;
  348. _dressMemory.RemoveAt(0);
  349. }
  350. if (_dressMemory.Count > _stepIndex)
  351. {
  352. _dressMemory.RemoveRange(_stepIndex, _dressMemory.Count - _stepIndex);
  353. }
  354. CustomSuitData suitSavedData = MyDressUpHelper.GetCurSuitDataClone(_ui.m_comboBox.selectedIndex);
  355. _dressMemory.Add(suitSavedData);
  356. UpdateStepBtn();
  357. }
  358. private void UpdateStepBtn()
  359. {
  360. _ui.m_btnLastStep.enabled = _stepIndex > 0;
  361. _ui.m_btnNextStep.enabled = _stepIndex < _dressMemory.Count - 1;
  362. }
  363. private void OnLongPress(EventContext context)
  364. {
  365. LongPressGesture gesture = (LongPressGesture)context.sender;
  366. int itemId = (int)gesture.host.data;
  367. GoodsItemTipsController.ShowItemTips(itemId);
  368. }
  369. private void OnTouchPad()
  370. {
  371. if (this.currentListType == DressUpListType.List4)
  372. {
  373. this.hideListParts2();
  374. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  375. }
  376. else if (this.currentListType == DressUpListType.List3)
  377. {
  378. if (_currentList2 != null)
  379. {
  380. this.showListType2(_currentList2);
  381. // _ui.m_comListType2.m_listType.numItems = _ui.m_comListType2.m_listType.numItems;
  382. }
  383. else
  384. {
  385. this.showListType1();
  386. }
  387. this.hideListParts();
  388. }
  389. else if (this.currentListType == DressUpListType.List2)
  390. {
  391. this.showListType1();
  392. this.hideListType2();
  393. }
  394. // _ui.m_comListType1.m_listType.numItems = _ui.m_comListType1.m_listType.numItems;
  395. // this.ShowSubList();
  396. }
  397. private void OnClickBtnDelete()
  398. {
  399. MyDressUpHelper.dressUpObj.TakeOffAll();
  400. MyDressUpHelper.dressUpObj.AddOrRemove(ConstItemID.DEFULT_BG, false);
  401. UpdateBtnAction();
  402. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  403. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  404. }
  405. private void OnClickBtnSave()
  406. {
  407. CustomSuitDataManager.SaveCurrentSuit(_ui.m_comboBox.selectedIndex);
  408. }
  409. private void OnComboBoxRarityChanged()
  410. {
  411. _rarityIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  412. this.UpdatePartsListSort();
  413. }
  414. private void OnClickBtnAction()
  415. {
  416. MyDressUpHelper.dressUpObj.PutOnOrTakeOffAction(201003);
  417. }
  418. private void OnClickBtnSearch()
  419. {
  420. ViewManager.Show<DressFilterView>(true, new object[] { ViewName.DRESS_UP_VIEW });
  421. }
  422. private void InitLists()
  423. {
  424. _ui.m_comListType2.m_listType.itemRenderer = ListType2Item;
  425. _ui.m_partsList.m_list.itemRenderer = ListPartsItem;
  426. _ui.m_partsList2.m_list.itemRenderer = ListParts2Item;
  427. listType1X = _ui.m_comListType1.target.x;
  428. partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width;// - DressUpView.RIGHT_BLANK;
  429. //一级菜单
  430. _ui.m_comListType1.m_listType.itemRenderer = ListType1Item;
  431. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length;
  432. //_ui.m_comListType1.m_listType1.ResizeToFit(_ui.m_comListType1.m_listType1.numItems);
  433. float maxHeight = _ui.target.height - _ui.m_comListType1.target.y - DressUpView.BOTTOM_BLANK;
  434. if (_ui.m_comListType1.m_listType.height > maxHeight)
  435. {
  436. _ui.m_comListType1.m_listType.height = maxHeight;
  437. }
  438. }
  439. private void showListType1()
  440. {
  441. _currentList2 = null;
  442. currentListType = DressUpListType.List1;
  443. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length;
  444. GTween.To(_ui.target.width, listType1X, 0.5f)
  445. .SetTarget(_ui.m_comListType1.target)
  446. .OnUpdate((GTweener t) =>
  447. {
  448. _ui.m_comListType1.target.x = t.value.x;
  449. });
  450. }
  451. private void hideListType1()
  452. {
  453. GTween.To(listType1X, _ui.target.width, 0.5f)
  454. .SetTarget(_ui.m_comListType1.target)
  455. .OnUpdate((GTweener t) =>
  456. {
  457. _ui.m_comListType1.target.x = t.value.x;
  458. });
  459. }
  460. private void showListType2(int[] menuStrArr = null)
  461. {
  462. currentListType = DressUpListType.List2;
  463. if (menuStrArr != null && menuStrArr.Length > 0)
  464. {
  465. int len = menuStrArr.Length;
  466. _currentList2 = menuStrArr.Clone() as int[];
  467. _ui.m_comListType2.m_listType.RemoveChildrenToPool();
  468. _ui.m_comListType2.m_listType.numItems = len;
  469. //_ui.m_comListType2.m_listType2.ResizeToFit(_ui.m_comListType2.m_listType2.numItems);
  470. float maxHeight = _ui.target.height - _ui.m_comListType2.m_listType.y - DressUpView.BOTTOM_BLANK;
  471. if (_ui.m_comListType2.m_listType.height > maxHeight)
  472. {
  473. _ui.m_comListType2.m_listType.height = maxHeight;
  474. }
  475. }
  476. GTween.To(_ui.target.width, listType1X, 0.5f)
  477. .SetTarget(_ui.m_comListType2.target)
  478. .OnUpdate((GTweener t) =>
  479. {
  480. _ui.m_comListType2.target.x = t.value.x;
  481. });
  482. }
  483. private void hideListType2()
  484. {
  485. GTween.To(listType1X, _ui.target.width, 0.5f)
  486. .SetTarget(_ui.m_comListType2.target)
  487. .OnUpdate((GTweener t) =>
  488. {
  489. _ui.m_comListType2.target.x = t.value.x;
  490. });
  491. }
  492. private bool showListParts(int type, bool selectItem = false)
  493. {
  494. _currentMenuType = type;
  495. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  496. {
  497. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  498. if (_rarityIndex >= SORT_BY_GET_TIME)
  499. {
  500. _rarityIndex = SORT_BY_HIGH_RARITY;
  501. }
  502. }
  503. else
  504. {
  505. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  506. }
  507. this.UpdatePartsListSort();
  508. if (_ui.m_partsList.m_list.numItems <= 0) return false;
  509. _ui.m_partsList.m_list.ResizeToFit(_ui.m_partsList.m_list.numItems);
  510. float maxHeight = _ui.m_partsList.target.height - _ui.m_partsList.m_list.y;// - DressUpView.BOTTOM_BLANK;
  511. if (_ui.m_partsList.m_list.height > maxHeight)
  512. {
  513. _ui.m_partsList.m_list.height = maxHeight;
  514. }
  515. if (selectItem)
  516. {
  517. int itemId = 0;
  518. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  519. {
  520. itemId = _currentSuitId;
  521. }
  522. else
  523. {
  524. itemId = MyDressUpHelper.dressUpObj.GetItemIdBuyType(_currentMenuType);
  525. }
  526. if (itemId > 0)
  527. {
  528. int index = _currentList3.IndexOf(itemId);
  529. if (index >= 0 && index < _ui.m_partsList.m_list.numItems)
  530. {
  531. _ui.m_partsList.m_list.ScrollToView(index);
  532. }
  533. }
  534. }
  535. currentListType = DressUpListType.List3;
  536. GTween.To(_ui.target.width, partsListX, 0.5f)
  537. .SetTarget(_ui.m_partsList)
  538. .OnUpdate((GTweener t) =>
  539. {
  540. _ui.m_partsList.target.x = t.value.x;
  541. });
  542. UpdateBtnAction();
  543. UpdateListPartsSelected();
  544. return true;
  545. }
  546. private void hideListParts()
  547. {
  548. // _currentMenuType = 0;
  549. UpdateBtnAction();
  550. GTween.To(partsListX, _ui.target.width, 0.5f)
  551. .SetTarget(_ui.m_partsList)
  552. .OnUpdate((GTweener t) =>
  553. {
  554. _ui.m_partsList.target.x = t.value.x;
  555. });
  556. }
  557. private void showListParts2(int suitId)
  558. {
  559. _currentSuitId = suitId;
  560. _ui.m_partsList2.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  561. if (_rarityIndex >= SORT_BY_GET_TIME)
  562. {
  563. _rarityIndex = SORT_BY_HIGH_RARITY;
  564. }
  565. this.UpdateSuitPartsListSort();
  566. _ui.m_partsList2.m_list.ResizeToFit(_ui.m_partsList2.m_list.numItems);
  567. float maxHeight = _ui.m_partsList2.target.height - _ui.m_partsList2.m_list.y;// - DressUpView.BOTTOM_BLANK;
  568. if (_ui.m_partsList2.m_list.height > maxHeight)
  569. {
  570. _ui.m_partsList2.m_list.height = maxHeight;
  571. }
  572. currentListType = DressUpListType.List4;
  573. GTween.To(_ui.target.width, partsListX, 0.5f)
  574. .SetTarget(_ui.m_partsList2)
  575. .OnUpdate((GTweener t) =>
  576. {
  577. _ui.m_partsList2.target.x = t.value.x;
  578. });
  579. UpdateBtnAction();
  580. }
  581. private void hideListParts2()
  582. {
  583. _currentMenuType = ConstDressUpItemType.TAO_ZHUANG;
  584. UpdateBtnAction();
  585. GTween.To(partsListX, _ui.target.width, 0.5f)
  586. .SetTarget(_ui.m_partsList2)
  587. .OnUpdate((GTweener t) =>
  588. {
  589. _ui.m_partsList2.target.x = t.value.x;
  590. });
  591. }
  592. /****************************************************************************************************************************/
  593. private void ListType1Item(int index, GObject item)
  594. {
  595. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  596. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[index];
  597. typeItem.m_icon.url = "ui://DressUp/hz_fenleitu_" + item1.id;
  598. typeItem.m_txtname.text = item1.name;
  599. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
  600. typeItem.target.data = item1.id;
  601. typeItem.m_imgNeed.visible = false;
  602. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsFirstMenuNew(item1.id);
  603. UI_TypeItem.ProxyEnd();
  604. }
  605. private void ListType2Item(int index, GObject item)
  606. {
  607. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  608. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[_currentList2[index] - 1];
  609. typeItem.m_icon.url = "ui://DressUp/hz_fenleituej_" + item2.id;
  610. typeItem.m_txtname.text = item2.name;
  611. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
  612. typeItem.target.data = item2.id;
  613. typeItem.m_imgNeed.visible = false;
  614. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSecondMenuNew(item2.id);
  615. UI_TypeItem.ProxyEnd();
  616. }
  617. private void ListPartsItem(int index, GObject item)
  618. {
  619. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  620. int id = (int)_currentList3[index];
  621. string iconRes = "";
  622. string partName = "";
  623. string ext = "png";
  624. listItem.m_comAxtionSelect.target.visible = false;
  625. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  626. {
  627. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  628. iconRes = suitCfg.res;
  629. partName = suitCfg.name;
  630. listItem.m_iconSelected.visible = false;
  631. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  632. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  633. listItem.m_ScoreType.visible = false;
  634. listItem.m_imgNew.visible = false;
  635. listItem.m_comAxtionSelect.m_btnNormal.icon = ResPathUtil.GetIconPath(suitCfg.res, ext);
  636. listItem.m_comAxtionSelect.m_btnAction.icon = ResPathUtil.GetIconPath(suitCfg.res, ext);
  637. if (listItem.m_comAxtionSelect.m_btnNormal.data == null)
  638. {
  639. listItem.m_comAxtionSelect.m_btnNormal.onClick.Add(OnBtnNormalClick);
  640. }
  641. listItem.m_comAxtionSelect.m_btnNormal.data = id;
  642. if (listItem.m_comAxtionSelect.m_btnAction.data == null)
  643. {
  644. listItem.m_comAxtionSelect.m_btnAction.onClick.Add(OnBtnActionClick);
  645. }
  646. listItem.m_comAxtionSelect.m_btnAction.data = id;
  647. }
  648. else if (_currentMenuType == (int)ConstDressUpItemType.DONG_ZUO)
  649. {
  650. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  651. iconRes = suitCfg.res;
  652. partName = suitCfg.name;
  653. listItem.m_iconSelected.visible = false;
  654. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  655. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  656. listItem.m_ScoreType.visible = false;
  657. listItem.m_imgNew.visible = false;
  658. }
  659. else
  660. {
  661. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  662. iconRes = itemCfg.res;
  663. partName = itemCfg.name;
  664. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  665. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  666. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  667. // ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
  668. listItem.m_ScoreType.visible = true;
  669. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + itemCfg.mainScore);
  670. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  671. listItem.m_imgNew.visible = isNew;
  672. if (isNew)
  673. {
  674. ItemProxy.ReqSetItemRead(id).Coroutine();
  675. }
  676. }
  677. if (listItem.target.data == null)
  678. {
  679. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  680. longPressGesture.once = true;
  681. longPressGesture.onAction.Add(OnLongPress);
  682. _listLongPress.Add(longPressGesture);
  683. }
  684. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  685. listItem.m_txtTitle.text = partName;
  686. listItem.target.data = id;
  687. listItem.m_grpScore.visible = false;
  688. //listItem.m_ScoreType.visible = true;
  689. listItem.m_imgNeed.visible = false;
  690. UI_PartsListItem.ProxyEnd();
  691. }
  692. private void ListParts2Item(int index, GObject item)
  693. {
  694. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  695. int id = (int)_currentList4[index];
  696. string iconRes = "";
  697. string partName = "";
  698. // string ext = "png";
  699. if (listItem.target.data == null)
  700. {
  701. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  702. longPressGesture.once = true;
  703. longPressGesture.onAction.Add(OnLongPress);
  704. _listLongPress.Add(longPressGesture);
  705. }
  706. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  707. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  708. iconRes = itemCfg != null ? itemCfg.res : suitCfg.res;
  709. partName = itemCfg != null ? itemCfg.name : suitCfg.name;
  710. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  711. bool isAction = MyDressUpHelper.dressUpObj.IsAction && SuitCfgArray.Instance.CheckActionContainsItem(id, MyDressUpHelper.dressUpObj.actionId);
  712. listItem.m_iconSelected.visible = isPutOn || isAction;
  713. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, itemCfg == null);
  714. listItem.m_ScoreType.visible = false;
  715. if (itemCfg != null)
  716. {
  717. listItem.m_ScoreType.visible = true;
  718. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + itemCfg.mainScore);
  719. }
  720. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, "png");
  721. listItem.m_txtTitle.text = partName;
  722. listItem.target.data = id;
  723. listItem.m_grpScore.visible = false;
  724. //listItem.m_ScoreType.visible = true;
  725. listItem.m_imgNeed.visible = false;
  726. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  727. listItem.m_imgNew.visible = isNew;
  728. if (isNew)
  729. {
  730. ItemProxy.ReqSetItemRead(id).Coroutine();
  731. }
  732. UI_PartsListItem.ProxyEnd();
  733. }
  734. private void UpdateListPartsSelected(int selectSuitId = 0)
  735. {
  736. int count = _ui.m_partsList.m_list.numChildren;
  737. int suitId = MyDressUpHelper.dressUpObj.suitId;
  738. for (int i = 0; i < count; i++)
  739. {
  740. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList.m_list.GetChildAt(i));
  741. int id = (int)listItem.target.data;
  742. if (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG)
  743. {
  744. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  745. listItem.m_comAxtionSelect.target.visible = id == selectSuitId && SuitCfgArray.Instance.CheckSuitHasAction(id);
  746. }
  747. else if (_currentMenuType == ConstDressUpItemType.DONG_ZUO)
  748. {
  749. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.IsAction && MyDressUpHelper.dressUpObj.actionId == id;
  750. }
  751. else
  752. {
  753. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  754. bool isAction = MyDressUpHelper.dressUpObj.IsAction && SuitCfgArray.Instance.CheckActionContainsItem(id, MyDressUpHelper.dressUpObj.actionId);
  755. listItem.m_iconSelected.visible = isPutOn || isAction;
  756. }
  757. UI_PartsListItem.ProxyEnd();
  758. }
  759. }
  760. private void UpdateListSuitPartsSelected()
  761. {
  762. int count = _ui.m_partsList2.m_list.numChildren;
  763. for (int i = 0; i < count; i++)
  764. {
  765. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList2.m_list.GetChildAt(i));
  766. int id = (int)listItem.target.data;
  767. bool isSuitSelect = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);//可换部件是否穿戴
  768. bool isActionSelect = MyDressUpHelper.dressUpObj.actionId == id;
  769. listItem.m_iconSelected.visible = isSuitSelect || isActionSelect;
  770. UI_PartsListItem.ProxyEnd();
  771. }
  772. }
  773. private void UpdatePartsListSort()
  774. {
  775. if (_currentMenuType == 0) return;
  776. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  777. {
  778. _currentList3 = DressUpMenuSuitDataManager.GetSuitIDList();
  779. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  780. {
  781. _currentList3 = SuitUtil.SortSuitListByHighRarity(_currentList3);
  782. }
  783. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  784. {
  785. _currentList3 = SuitUtil.SortSuitListByLowRarity(_currentList3);
  786. }
  787. else
  788. {
  789. _currentList3.Reverse();
  790. }
  791. }
  792. else if (_currentMenuType == (int)ConstDressUpItemType.DONG_ZUO)
  793. {
  794. _currentList3 = DressUpMenuSuitDataManager.GetActionIDList();
  795. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  796. {
  797. _currentList3 = SuitUtil.SortSuitListByHighRarity(_currentList3);
  798. }
  799. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  800. {
  801. _currentList3 = SuitUtil.SortSuitListByLowRarity(_currentList3);
  802. }
  803. else
  804. {
  805. _currentList3.Reverse();
  806. }
  807. }
  808. else
  809. {
  810. _currentList3 = DressUpMenuItemDataManager.getItemDatasByType(_currentMenuType);
  811. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  812. {
  813. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighRarity(_currentList3);
  814. }
  815. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  816. {
  817. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowRarity(_currentList3);
  818. }
  819. else
  820. {
  821. _currentList3.Reverse();
  822. }
  823. }
  824. if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  825. {
  826. _currentList3 = DressUpMenuItemDataManager.DressSearch(_currentList3);
  827. }
  828. else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  829. {
  830. _currentList3 = DressUpMenuItemDataManager.DressFilter(_currentList3);
  831. }
  832. _ui.m_partsList.m_list.RemoveChildrenToPool();
  833. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  834. }
  835. private void UpdateSuitPartsListSort()
  836. {
  837. if (_currentMenuType == 0) return;
  838. if (_isNormalSuitType)
  839. {
  840. _currentList4 = new List<int>(SuitCfgArray.Instance.GetSuitItems(_currentSuitId));
  841. }
  842. else
  843. {
  844. _currentList4 = SuitCfgArray.Instance.GetOneSuitAllNotActionParts(_currentSuitId);
  845. _currentList4.Add(_currentSuitId);
  846. }
  847. if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  848. {
  849. _currentList4 = DressUpMenuItemDataManager.DressSearch(_currentList4);
  850. }
  851. else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  852. {
  853. _currentList4 = DressUpMenuItemDataManager.DressFilter(_currentList4);
  854. }
  855. _ui.m_partsList2.m_list.RemoveChildrenToPool();
  856. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  857. }
  858. private void UpdateBtnAction()
  859. {
  860. // _ui.m_btnAction.visible = (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG) || this.currentListType == DressUpListType.List4;
  861. // if (_ui.m_btnAction.visible)
  862. // {
  863. //_ui.m_btnAction.grayed = !EquipDataCache.cacher.HasSuitActionRes;
  864. // }
  865. }
  866. private void OnClickBtnShow()
  867. {
  868. Timers.inst.Remove(SetBtnShowVisable);
  869. _ui.m_c1.selectedIndex = 0;
  870. _ui.m_btnHide.visible = true;
  871. _ui.m_btnShow.visible = false;
  872. _ui.m_loaShow.visible = false;
  873. }
  874. private void OnClickBtnHide()
  875. {
  876. _ui.m_c1.selectedIndex = 1;
  877. _ui.m_btnHide.visible = false;
  878. _ui.m_btnShow.visible = true;
  879. _ui.m_loaShow.visible = true;
  880. Timers.inst.Add(2f, 1, SetBtnShowVisable);
  881. }
  882. private void OnClickLoaShow()
  883. {
  884. _ui.m_btnShow.alpha = 1;
  885. _ui.m_btnShow.enabled = true;
  886. Timers.inst.Add(2f, 1, SetBtnShowVisable);
  887. }
  888. private void OnClickBtnPhoto()
  889. {
  890. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.PAI_ZHAO, 1);
  891. if (!ViewManager.Show<PhotographView>())
  892. {
  893. return;
  894. }
  895. _ui.target.visible = false;
  896. this._sceneObject.gameObject.SetActive(false);
  897. }
  898. private void OnClickBtnNext()
  899. {
  900. // if (!EquipDataCache.cacher.CheckPutOnFinish())
  901. // {
  902. // AlertUI.Show("只有换好衣服才能出门哦!")
  903. // .SetRightButton(true, "好的");
  904. // return;
  905. // }
  906. if (!ViewManager.Show<PhotographView>(this.viewData))
  907. {
  908. return;
  909. }
  910. _ui.target.visible = false;
  911. this._sceneObject.gameObject.SetActive(false);
  912. }
  913. private void UpdateScene()
  914. {
  915. _ui.target.visible = true;
  916. this._sceneObject.gameObject.SetActive(true);
  917. }
  918. private void SetBtnShowVisable(object param)
  919. {
  920. _ui.m_btnShow.enabled = false;
  921. GTween.To(1, 0, 0.3f).SetTarget(_ui.m_btnShow, TweenPropType.Alpha);
  922. }
  923. private bool CheckListCount(int type)
  924. {
  925. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  926. {
  927. return DressUpMenuSuitDataManager.GetSuitIDList().Count > 0;
  928. }
  929. else
  930. {
  931. return DressUpMenuItemDataManager.getItemDatasByType(type).Count > 0;
  932. }
  933. }
  934. private void CheckGuide(object param)
  935. {
  936. if (GuideDataManager.IsGuideFinish(ConstGuideId.FREEDOM_DRESS) <= 0
  937. || GuideDataManager.IsGuideFinish(ConstGuideId.ENTER_CHAPTER) <= 0)
  938. {
  939. UpdateToCheckGuide(null);
  940. }
  941. else
  942. {
  943. Timers.inst.Remove(CheckGuide);
  944. }
  945. }
  946. protected override void UpdateToCheckGuide(object param)
  947. {
  948. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  949. if (listTypeItem_FreedomDress == null && GuideDataManager.IsGuideFinish(ConstGuideId.FREEDOM_DRESS) <= 0)
  950. {
  951. int len = _ui.m_comListType1.m_listType.numChildren;
  952. for (int i = 0; i < len; i++)
  953. {
  954. UI_TypeItem item = UI_TypeItem.Proxy(_ui.m_comListType1.m_listType.GetChildAt(i));
  955. if (item != null)
  956. {
  957. int menuID = (int)item.target.data;
  958. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  959. if (dressUpMenuItemCfg1.type == ConstDressUpItemType.TAO_ZHUANG)
  960. {
  961. listTypeItem_FreedomDress = item;
  962. _ui.m_comListType1.m_listType.ScrollToView(i);
  963. break;
  964. }
  965. }
  966. UI_TypeItem.ProxyEnd();
  967. }
  968. }
  969. if (listTypeItem_FreedomDress != null) GuideController.TryGuide(listTypeItem_FreedomDress.target, ConstGuideId.FREEDOM_DRESS, 3, "套装分类里,可以查看集齐成套的服饰,点击一键换上。");
  970. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.FREEDOM_DRESS, 4, "", 0);
  971. // if (_ui.m_partsList.m_list.numItems > 0)
  972. // {
  973. // UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList.m_list.GetChildAt(0).asCom);
  974. // GuideController.TryGuide(listItem.m_comAxtionSelect.m_btnAction, ConstGuideId.FREEDOM_DRESS, 5, "选择特殊动作并穿上。");
  975. // UI_PartsListItem.ProxyEnd();
  976. // }
  977. GuideController.TryGuide(_ui.m_btnSave, ConstGuideId.FREEDOM_DRESS, 5, "搭配好的服饰,可以保存到主界面显示。");
  978. GuideController.TryGuide(_ui.m_btnPhoto, ConstGuideId.FREEDOM_DRESS, 6, "辛苦搭配完,去拍个照片留念呀~~");
  979. GuideController.TryGuide(_ui.m_btnBack, ConstGuideId.ENTER_CHAPTER, 2, "");
  980. }
  981. }
  982. }