FieldWorkDressFIghtView.cs 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158
  1. using UI.DressUp;
  2. using FairyGUI;
  3. using UnityEngine;
  4. using System.Collections.Generic;
  5. using cfg.GfgCfg;
  6. using ET;
  7. namespace GFGGame
  8. {
  9. public class FieldWorkDressFightView : BaseWindow
  10. {
  11. private UI_ArenaDressUpFightUI _ui;
  12. // private DressUpObj _dressUpData = new DressUpObj();
  13. private FieldWorkDataManager _dataManager;
  14. private FightData _roleData;
  15. public List<int> _itemList; //记录打开界面时的穿戴数据(保存后会更新)
  16. private float listType1X = 0;
  17. private float partsListX = 0;
  18. private float partsListScrollingPosY = 0;
  19. private DressUpListType currentListType;
  20. private List<int> _currentList2;
  21. private GameObject _sceneObject;
  22. private List<int> _currentList3 = new List<int>();
  23. private List<int> _currentList4 = new List<int>();
  24. private int _currentMenuType;
  25. private int _currentSuitId;
  26. //暂存cardid
  27. private int cardId;
  28. // private StoryLevelCfg _levelCfg;
  29. // private StoryFightCfg _fightCfg;
  30. private const int SORT_BY_HIGH_SCORE = 0;
  31. private const int SORT_BY_LOW_SCORE = 1;
  32. private int _scoreIndex = SORT_BY_HIGH_SCORE;
  33. private List<LongPressGesture> _listLongPress = new List<LongPressGesture>();
  34. public override void Dispose()
  35. {
  36. if (_sceneObject != null)
  37. {
  38. PrefabManager.Instance.Restore(_sceneObject);
  39. _sceneObject = null;
  40. }
  41. for (int i = 0; i < _listLongPress.Count; i++)
  42. {
  43. _listLongPress[i].Dispose();
  44. }
  45. // _dressUpData.Dispose();
  46. if (_ui != null)
  47. {
  48. _ui.Dispose();
  49. _ui = null;
  50. }
  51. base.Dispose();
  52. }
  53. protected override void Init()
  54. {
  55. base.Init();
  56. packageName = UI_ArenaDressUpFightUI.PACKAGE_NAME;
  57. _ui = UI_ArenaDressUpFightUI.Create();
  58. viewCom = _ui.target;
  59. isfullScreen = true;
  60. isReturnView = true;
  61. }
  62. protected override void OnInit()
  63. {
  64. base.OnInit();
  65. _ui.m_btnLastStep.visible = true;
  66. _ui.m_btnNextStep.visible = true;
  67. _ui.m_btnSearch.visible = true;
  68. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高分优先", "低分优先" };
  69. _ui.m_partsListSearch.m_comboBoxRarity.items = new string[] { "高分优先", "低分优先" };
  70. InitLists();
  71. _ui.m_partsList.m_comboBoxRarity.onChanged.Add(OnComboBoxRarityChanged);
  72. _ui.m_partsListSearch.m_comboBoxRarity.onChanged.Add(OnSearchComboBoxRarityChanged);
  73. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  74. _ui.m_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
  75. _ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
  76. _ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
  77. _ui.m_partsList2.m_list.onClickItem.Add(OnClickSuitPartsListItem);
  78. _ui.m_partsListSearch.m_list.onClickItem.Add(OnClickSearchPartsListItem);
  79. _ui.m_touchPad.onClick.Add(OnTouchPad);
  80. _ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
  81. _ui.m_btnNext.onClick.Add(OnClickBtnNext);
  82. _ui.m_btnSearch.onClick.Add(OnClickBtnSearch);
  83. _ui.m_btnLastStep.onClick.Add(OnClickBtnLastStep);
  84. _ui.m_btnNextStep.onClick.Add(OnClickBtnNextStep);
  85. // _ui.m_comValueInfo.m_btnFightScoreRule.onClick.Add(OnBtnFightScoreRule);
  86. _ui.m_comValueInfo.GetChild("btnFightScoreRule").onClick.Add(OnBtnFightScoreRule);
  87. _ui.m_grhCloseComFightScore.onClick.Add(OnCloseComFightScore);
  88. _ui.m_partsList2.m_comboBoxRarity.visible = false;
  89. _ui.m_partsList2.m_imgTop.visible = true;
  90. _ui.m_partsList.m_imgTop.visible = false;
  91. }
  92. protected override void AddEventListener()
  93. {
  94. base.AddEventListener();
  95. EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdateSerch);
  96. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
  97. EventAgent.AddEventListener(ConstMessage.CARD_SELECTED, UpdateValueInfo);
  98. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
  99. }
  100. protected override void RemoveEventListener()
  101. {
  102. base.RemoveEventListener();
  103. EventAgent.RemoveEventListener(ConstMessage.DRESS_SEARCH, UpdateSerch);
  104. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
  105. EventAgent.RemoveEventListener(ConstMessage.CARD_SELECTED, UpdateValueInfo);
  106. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
  107. }
  108. protected override void OnShown()
  109. {
  110. base.OnShown();
  111. _dataManager = FieldWorkDataManager.Instance;
  112. _roleData = _dataManager.DressupList[_dataManager.SelectThemeIndex];
  113. _itemList = new List<int>(_roleData.itemList);
  114. InstanceZonesDataManager.currentScoreType = _dataManager.ThemeList[_dataManager.SelectThemeIndex];
  115. InstanceZonesDataManager.currentFightTags = _dataManager.DressupList[_dataManager.SelectThemeIndex].tags;
  116. _scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  117. _ui.m_grhCloseComFightScore.visible = false;
  118. //一级菜单
  119. _ui.m_comListType1.m_listType.RemoveChildrenToPool();
  120. _ui.m_comListType1.m_listType.numItems = CommonDataManager.Tables.TblDressUpMenuItemCfg1.DataList.Count - 3;
  121. float maxHeight = _ui.target.height - _ui.m_comListType1.m_listType.y - DressUpView.BOTTOM_BLANK;
  122. if (_ui.m_comListType1.m_listType.height > maxHeight)
  123. {
  124. _ui.m_comListType1.m_listType.height = maxHeight;
  125. }
  126. _ui.m_comListType1.target.x = _ui.target.width;
  127. _ui.m_comListType2.target.x = _ui.target.width;
  128. _ui.m_partsList.target.x = _ui.target.width;
  129. _ui.m_partsList2.target.x = _ui.target.width;
  130. _ui.m_partsListSearch.target.x = _ui.target.width;
  131. this.showListType1();
  132. if (_sceneObject == null)
  133. {
  134. PrefabManager.Instance.InstantiateAsync(
  135. ResPathUtil.GetPrefabPath("SceneArenaDressUpFight"),
  136. (gameObject) =>
  137. {
  138. if (gameObject != null)
  139. {
  140. _sceneObject = gameObject;
  141. MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject, false, false, null, true);
  142. MyDressUpHelper.dressUpObj.AddOrRemove(180001, false);
  143. // GameObject copyObj = _sceneObject.transform.Find("CopyRole").gameObject;
  144. // _dressUpData.setSceneObj(copyObj);
  145. MyDressUpHelper.dressUpObj.PutOnItemList(_roleData.itemList);
  146. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}",
  147. MyDressUpHelper.GetCurrentOrnamentCount(),
  148. CommonDataManager.Tables.TblGlobalCfg.DressLimitCount);
  149. _ui.m_c1.selectedIndex = 1;
  150. UpdateStepBtn(true);
  151. UpdateValueInfo();
  152. SendLog();
  153. }
  154. else
  155. {
  156. Debug.LogError("Failed to instantiate SceneArenaDressUpFight");
  157. }
  158. }
  159. );
  160. return; // 提前返回,等待异步回调
  161. }
  162. MyDressUpHelper.dressUpObj.PutOnItemList(_roleData.itemList);
  163. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(),
  164. CommonDataManager.Tables.TblGlobalCfg.DressLimitCount);
  165. _ui.m_c1.selectedIndex = 1;
  166. UpdateStepBtn(true);
  167. UpdateValueInfo();
  168. SendLog();
  169. cardId = _roleData.cardId;
  170. Timers.inst.AddUpdate(CheckGuide);
  171. }
  172. protected override void OnHide()
  173. {
  174. base.OnHide();
  175. if (_sceneObject != null)
  176. {
  177. PrefabManager.Instance.Restore(_sceneObject);
  178. _sceneObject = null;
  179. }
  180. DressUpMenuItemDataManager.Clear();
  181. MyDressUpHelper.ResetMemory();
  182. _ui.m_grhCloseComFightScore.visible = false;
  183. _ui.m_comValueInfo.GetController("c2").selectedIndex = 0;
  184. }
  185. private void OnClickBtnBack()
  186. {
  187. bool isSave = _itemList.Count == MyDressUpHelper.dressUpObj.itemList.Count;
  188. if (isSave)
  189. {
  190. for (int i = 0; i < _itemList.Count; i++)
  191. {
  192. int itemId = MyDressUpHelper.dressUpObj.itemList[i];
  193. if (_itemList.IndexOf(itemId) < 0)
  194. {
  195. isSave = false;
  196. break;
  197. }
  198. }
  199. }
  200. if (!isSave)
  201. {
  202. AlertUI.Show("当前穿搭尚未保存,是否确定退出?")
  203. .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
  204. {
  205. _roleData.cardId = cardId;
  206. GoBackToView();
  207. });
  208. }
  209. else
  210. {
  211. GoBackToView();
  212. }
  213. }
  214. private void GoBackToView()
  215. {
  216. _roleData.itemList = _itemList;
  217. FightDataManager.Instance.SetItemScoreList(_roleData);
  218. ScoreSystemData.Instance.SetEquipScoresWithPartId(_roleData);
  219. //ViewManager.GoBackFrom(typeof(ArenaDressUpFightView).FullName);
  220. //ViewManager.Show<ArenaDressInfoView>(new object[] { FightRoleType.MINE, 0, ArenaDataManager.Instance.DressupList, "" });
  221. this.Hide();
  222. }
  223. private void OnBtnFightScoreRule()
  224. {
  225. _ui.m_grhCloseComFightScore.visible = true;
  226. }
  227. private void OnCloseComFightScore()
  228. {
  229. _ui.m_comValueInfo.GetController("c2").selectedIndex = 0;
  230. _ui.m_grhCloseComFightScore.visible = false;
  231. }
  232. private void OnClickBtnHome()
  233. {
  234. AlertUI.Show("是否返回?")
  235. .SetLeftButton(true, "否")
  236. .SetRightButton(true, "是", (object data) => { GameController.GoBackToMainView(); });
  237. }
  238. private void UpdateValueInfo()
  239. {
  240. _roleData.itemList = MyDressUpHelper.dressUpObj.itemList;
  241. FightDataManager.Instance.SetItemScoreList(_roleData);
  242. ScoreSystemData.Instance.SetEquipScoresWithPartId(_roleData);
  243. FieldWorkDataManager.Instance.UpdateValue(_ui.m_comFieldValueInfo, _dataManager.SelectThemeIndex,
  244. _dataManager.DressupList);
  245. }
  246. private void OnClickListType1Item(EventContext context)
  247. {
  248. // GuideController.HideGuide();
  249. GObject typeItem = context.data as GObject;
  250. int order = (int)typeItem.data;
  251. DressUpMenuItemCfg1 item1 = CommonDataManager.Tables.TblDressUpMenuItemCfg1.DataList[order - 1];
  252. if (item1.SubMenus.Count > 0)
  253. {
  254. this.showListType2(item1.SubMenus);
  255. }
  256. else
  257. {
  258. if (this.showListParts(item1.Type) == false)
  259. {
  260. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  261. return;
  262. }
  263. this.showListParts(item1.Type);
  264. }
  265. this.hideListType1();
  266. UpdateListPartsSelected();
  267. }
  268. private void OnClickListType2Item(EventContext context)
  269. {
  270. GObject typeItem = context.data as GObject;
  271. int order = (int)typeItem.data;
  272. DressUpMenuItemCfg2 item2 = CommonDataManager.Tables.TblDressUpMenuItemCfg2.DataList[order - 1];
  273. if (this.showListParts(item2.Type) == false)
  274. {
  275. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  276. return;
  277. }
  278. this.hideListType2();
  279. }
  280. private void OnClickSearchPartsListItem(EventContext context)
  281. {
  282. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  283. {
  284. return;
  285. }
  286. GObject listItem = context.data as GObject;
  287. int id = (int)listItem.data;
  288. if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.FieldWork)
  289. {
  290. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  291. {
  292. List<int> suitParts = CommonDataManager.Tables.TblSuitCfg.GetOrDefault(id).Parts;
  293. foreach (var suitpart in suitParts)
  294. {
  295. foreach (var itemDressID in FieldWorkDataManager.Instance.HistoryDressupList)
  296. {
  297. if (suitpart == itemDressID)
  298. {
  299. PromptController.Instance.ShowFloatTextPrompt("该套装包含已使用服装,无法使用!");
  300. return;
  301. }
  302. }
  303. }
  304. }
  305. else
  306. {
  307. foreach (var itemDressID in FieldWorkDataManager.Instance.HistoryDressupList)
  308. {
  309. if (itemDressID == id)
  310. {
  311. PromptController.Instance.ShowFloatTextPrompt("该服装本周使用次数已达上限!");
  312. return;
  313. }
  314. }
  315. }
  316. }
  317. bool isOrnament = DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(id);
  318. bool isDress = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  319. bool isHasSame = MyDressUpHelper.dressUpObj.CheckSameTypeIsOn(id);
  320. bool isMaxCount = MyDressUpHelper.GetCurrentOrnamentCount() >=
  321. CommonDataManager.Tables.TblGlobalCfg.DressLimitCount;
  322. if (isOrnament && !isDress && !isHasSame && isMaxCount)
  323. {
  324. PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
  325. return;
  326. }
  327. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  328. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(),
  329. CommonDataManager.Tables.TblGlobalCfg.DressLimitCount);
  330. UpdateStepBtn(true);
  331. // UpdateSearchListPartsSelected();
  332. UpdateValueInfo();
  333. }
  334. private void OnClickPartsListItem(EventContext context)
  335. {
  336. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  337. {
  338. return;
  339. }
  340. GObject listItem = context.data as GObject;
  341. int id = (int)listItem.data;
  342. if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.FieldWork)
  343. {
  344. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  345. {
  346. List<int> suitParts = CommonDataManager.Tables.TblSuitCfg.GetOrDefault(id).Parts;
  347. foreach (var suitpart in suitParts)
  348. {
  349. foreach (var itemDressID in FieldWorkDataManager.Instance.HistoryDressupList)
  350. {
  351. if (suitpart == itemDressID)
  352. {
  353. PromptController.Instance.ShowFloatTextPrompt("该套装包含已使用服装,无法使用!");
  354. return;
  355. }
  356. }
  357. }
  358. }
  359. else
  360. {
  361. foreach (var itemDressID in FieldWorkDataManager.Instance.HistoryDressupList)
  362. {
  363. if (itemDressID == id)
  364. {
  365. PromptController.Instance.ShowFloatTextPrompt("该服装本周使用次数已达上限");
  366. return;
  367. }
  368. }
  369. }
  370. }
  371. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  372. {
  373. partsListScrollingPosY = _ui.m_partsList.m_list.scrollPane.scrollingPosY;
  374. this.showListParts2(id);
  375. this.hideListParts();
  376. MyDressUpHelper.dressUpObj.PutOnItemList(MyDressUpHelper.GetSuitFightItems(id));
  377. }
  378. else
  379. {
  380. bool isOrnament = DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(id);
  381. bool isDress = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  382. bool isHasSame = MyDressUpHelper.dressUpObj.CheckSameTypeIsOn(id);
  383. bool isMaxCount = MyDressUpHelper.GetCurrentOrnamentCount() >=
  384. CommonDataManager.Tables.TblGlobalCfg.DressLimitCount;
  385. if (isOrnament && !isDress && !isHasSame && isMaxCount)
  386. {
  387. PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
  388. return;
  389. }
  390. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  391. }
  392. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(),
  393. CommonDataManager.Tables.TblGlobalCfg.DressLimitCount);
  394. UpdateStepBtn(true);
  395. // UpdateListPartsSelected();
  396. // UpdateListSuitPartsSelected();
  397. UpdateValueInfo();
  398. }
  399. private void OnClickSuitPartsListItem(EventContext context)
  400. {
  401. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  402. {
  403. return;
  404. }
  405. GObject listItem = (GObject)context.data as GObject;
  406. int id = (int)listItem.data;
  407. bool isOrnament = DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(id);
  408. bool isDress = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  409. bool isHasSame = MyDressUpHelper.dressUpObj.CheckSameTypeIsOn(id);
  410. bool isMaxCount = MyDressUpHelper.GetCurrentOrnamentCount() >=
  411. CommonDataManager.Tables.TblGlobalCfg.DressLimitCount;
  412. if (isOrnament && !isDress && !isHasSame && isMaxCount)
  413. {
  414. PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
  415. return;
  416. }
  417. if (!DressUpMenuItemDataManager.CheckHasItem(id))
  418. {
  419. PromptController.Instance.ShowFloatTextPrompt("还未获得这件装扮");
  420. return;
  421. }
  422. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  423. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(),
  424. CommonDataManager.Tables.TblGlobalCfg.DressLimitCount);
  425. UpdateStepBtn(true);
  426. // UpdateListSuitPartsSelected();
  427. UpdateValueInfo();
  428. }
  429. private void UpdateStepBtn(bool isAdd, int suitId = 0)
  430. {
  431. if (isAdd)
  432. {
  433. MyDressUpHelper.AddMemoryDressup();
  434. }
  435. _ui.m_btnLastStep.enabled = MyDressUpHelper.stepIndex > 0;
  436. _ui.m_btnNextStep.enabled = MyDressUpHelper.stepIndex < MyDressUpHelper.dressMemory.Count - 1;
  437. UpdateListPartsSelected();
  438. UpdateListSuitPartsSelected();
  439. UpdateSearchListPartsSelected();
  440. }
  441. private void OnLongPress(EventContext context)
  442. {
  443. LongPressGesture gesture = (LongPressGesture)context.sender;
  444. int itemId = (int)gesture.host.data;
  445. GoodsItemTipsController.ShowItemTips(itemId);
  446. }
  447. private void OnTouchPad()
  448. {
  449. if (this.currentListType == DressUpListType.List4)
  450. {
  451. this.hideListParts2();
  452. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  453. }
  454. else if (this.currentListType == DressUpListType.List3)
  455. {
  456. if (_currentList2 != null)
  457. {
  458. this.showListType2(_currentList2);
  459. }
  460. else
  461. {
  462. this.showListType1();
  463. }
  464. this.hideListParts();
  465. }
  466. else if (this.currentListType == DressUpListType.List2)
  467. {
  468. this.showListType1();
  469. this.hideListType2();
  470. }
  471. else if (this.currentListType == DressUpListType.List5)
  472. {
  473. this.showListType1();
  474. this.hideSearchListType();
  475. }
  476. }
  477. private void OnClickBtnDelete()
  478. {
  479. MyDressUpHelper.dressUpObj.TakeOffAll();
  480. _roleData.cardId = 0;
  481. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  482. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  483. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(),
  484. CommonDataManager.Tables.TblGlobalCfg.DressLimitCount);
  485. UpdateStepBtn(true);
  486. // UpdateListPartsSelected();
  487. // UpdateListSuitPartsSelected();
  488. UpdateValueInfo();
  489. }
  490. private void OnClickBtnNext()
  491. {
  492. // if (!MyDressUpHelper.CheckPutOnFinish())
  493. // {
  494. // AlertUI.Show("换好衣服才能进行下一步哦~").SetRightButton(true, "好的");
  495. // }
  496. // else
  497. // {
  498. DressUpFinish();
  499. // }
  500. }
  501. private async void DressUpFinish()
  502. {
  503. if (CardDataManager.GetCardListByRoleType(0).Count > 0)
  504. {
  505. ViewManager.Show<FieldWorkChooseCardView>(InstanceZonesDataManager.currentScoreType);
  506. }
  507. else
  508. {
  509. bool result = await FieldWorkSproxy.ReqChangeFieldWorkDressupOne(_dataManager.SelectThemeIndex, 0,
  510. MyDressUpHelper.dressUpObj.itemList);
  511. if (result)
  512. {
  513. _itemList = new List<int>(MyDressUpHelper.dressUpObj.itemList);
  514. PromptController.Instance.ShowFloatTextPrompt("保存成功");
  515. OnClickBtnBack();
  516. }
  517. }
  518. }
  519. // private void OnClickBtnRecommend()
  520. // {
  521. // if (this.currentListType == DressUpListType.List4)
  522. // {
  523. // this.hideListParts2();
  524. // this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  525. // }
  526. // MyDressUpHelper.dressUpObj.CheckCancelActionWhenPutOn(_currentSuitId);
  527. // MyDressUpHelper.PutOnRecommendItems2();
  528. // _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
  529. // UpdateListPartsSelected();
  530. // UpdateListSuitPartsSelected();
  531. // }
  532. private void InitLists()
  533. {
  534. _ui.m_comListType2.m_listType.itemRenderer = ListType2Item;
  535. _ui.m_partsList.m_list.itemRenderer = ListPartsItem;
  536. _ui.m_partsList2.m_list.itemRenderer = ListParts2Item;
  537. _ui.m_partsListSearch.m_list.itemRenderer = ListPartsItem;
  538. listType1X = _ui.m_comListType1.target.x;
  539. partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width;
  540. //一级菜单
  541. _ui.m_comListType1.m_listType.itemRenderer = ListType1Item;
  542. }
  543. private void showListType1()
  544. {
  545. _currentList2 = null;
  546. currentListType = DressUpListType.List1;
  547. _ui.m_comListType1.m_listType.numItems = CommonDataManager.Tables.TblDressUpMenuItemCfg1.DataList.Count - 3;
  548. GTween.To(_ui.target.width, listType1X, 0.5f)
  549. .SetTarget(_ui.m_comListType1.target)
  550. .OnUpdate((GTweener t) => { _ui.m_comListType1.target.x = t.value.x; });
  551. }
  552. private void hideListType1()
  553. {
  554. GTween.To(listType1X, _ui.target.width, 0.5f)
  555. .SetTarget(_ui.m_comListType1.target)
  556. .OnUpdate((GTweener t) => { _ui.m_comListType1.target.x = t.value.x; });
  557. }
  558. private void showListType2(List<int> menuStrArr = null)
  559. {
  560. currentListType = DressUpListType.List2;
  561. if (menuStrArr != null && menuStrArr.Count > 0)
  562. {
  563. int len = menuStrArr.Count;
  564. _currentList2 = menuStrArr;
  565. _ui.m_comListType2.m_listType.RemoveChildrenToPool();
  566. _ui.m_comListType2.m_listType.numItems = len;
  567. //_ui.m_listType2.ResizeToFit(_ui.m_listType2.numItems);
  568. float maxHeight = _ui.target.height - _ui.m_comListType2.m_listType.y - DressUpView.BOTTOM_BLANK;
  569. if (_ui.m_comListType2.m_listType.height > maxHeight)
  570. {
  571. _ui.m_comListType2.m_listType.height = maxHeight;
  572. }
  573. }
  574. GTween.To(_ui.target.width, listType1X, 0.5f)
  575. .SetTarget(_ui.m_comListType2.target)
  576. .OnUpdate((GTweener t) => { _ui.m_comListType2.target.x = t.value.x; });
  577. }
  578. private void hideListType2()
  579. {
  580. GTween.To(listType1X, _ui.target.width, 0.5f)
  581. .SetTarget(_ui.m_comListType2.target)
  582. .OnUpdate((GTweener t) => { _ui.m_comListType2.target.x = t.value.x; });
  583. }
  584. private bool showListParts(int type, bool selectItem = false)
  585. {
  586. _currentMenuType = type;
  587. UpdatePartsListSort();
  588. if (_ui.m_partsList.m_list.numItems <= 0) return false;
  589. _ui.m_partsList.m_list.ResizeToFit(_ui.m_partsList.m_list.numItems);
  590. float maxHeight = _ui.m_partsList.target.height - _ui.m_partsList.m_list.y;
  591. if (_ui.m_partsList.m_list.height > maxHeight)
  592. {
  593. _ui.m_partsList.m_list.height = maxHeight;
  594. }
  595. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  596. {
  597. _ui.m_partsList.m_list.scrollPane.SetPosY(partsListScrollingPosY, false);
  598. partsListScrollingPosY = 0;
  599. }
  600. currentListType = DressUpListType.List3;
  601. GTween.To(_ui.target.width, partsListX, 0.5f)
  602. .SetTarget(_ui.m_partsList)
  603. .OnUpdate((GTweener t) => { _ui.m_partsList.target.x = t.value.x; });
  604. UpdateListPartsSelected();
  605. return true;
  606. }
  607. private void OnComboBoxRarityChanged()
  608. {
  609. _scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  610. this.UpdatePartsListSort();
  611. }
  612. private void OnSearchComboBoxRarityChanged()
  613. {
  614. _scoreIndex = _ui.m_partsListSearch.m_comboBoxRarity.selectedIndex;
  615. this.UpdateSearchList();
  616. }
  617. private void UpdatePartsListSort()
  618. {
  619. if (_currentMenuType == 0) return;
  620. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  621. {
  622. _currentList3 = DressUpMenuSuitDataManager.GetSuitIDList();
  623. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  624. {
  625. _currentList3 = SuitUtil.SortSuitListByHighScore(_currentList3);
  626. }
  627. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  628. {
  629. _currentList3 = SuitUtil.SortSuitListByLowScore(_currentList3);
  630. }
  631. else
  632. {
  633. _currentList3.Reverse();
  634. }
  635. }
  636. else
  637. {
  638. _currentList3 = DressUpMenuItemDataManager.getItemDatasByType(_currentMenuType);
  639. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  640. {
  641. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3);
  642. }
  643. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  644. {
  645. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3);
  646. }
  647. else
  648. {
  649. _currentList3.Reverse();
  650. }
  651. }
  652. if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  653. {
  654. _currentList3 = DressUpMenuItemDataManager.DressSearch(_currentList3);
  655. }
  656. else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  657. {
  658. _currentList3 = DressUpMenuItemDataManager.DressFilter(_currentList3);
  659. }
  660. _ui.m_partsList.m_list.RemoveChildrenToPool();
  661. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  662. }
  663. private void UpdateSuitPartsListSort()
  664. {
  665. if (_currentMenuType == 0) return;
  666. _currentList4 = new List<int>(SuitCfgArray.Instance.GetSuitItems(_currentSuitId, true));
  667. if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  668. {
  669. _currentList4 = DressUpMenuItemDataManager.DressSearch(_currentList4);
  670. }
  671. else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  672. {
  673. _currentList4 = DressUpMenuItemDataManager.DressFilter(_currentList4);
  674. }
  675. _ui.m_partsList2.m_list.RemoveChildrenToPool();
  676. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  677. }
  678. private void hideListParts()
  679. {
  680. GTween.To(partsListX, _ui.target.width, 0.5f)
  681. .SetTarget(_ui.m_partsList)
  682. .OnUpdate((GTweener t) => { _ui.m_partsList.target.x = t.value.x; });
  683. }
  684. private void showListParts2(int suitId)
  685. {
  686. _currentSuitId = suitId;
  687. _ui.m_partsList2.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  688. this.UpdateSuitPartsListSort();
  689. _ui.m_partsList2.m_list.ResizeToFit(_ui.m_partsList2.m_list.numItems);
  690. float maxHeight = _ui.m_partsList2.target.height - _ui.m_partsList2.m_list.y; // - DressUpView.BOTTOM_BLANK;
  691. if (_ui.m_partsList2.m_list.height > maxHeight)
  692. {
  693. _ui.m_partsList2.m_list.height = maxHeight;
  694. }
  695. currentListType = DressUpListType.List4;
  696. GTween.To(_ui.target.width, partsListX, 0.5f)
  697. .SetTarget(_ui.m_partsList2)
  698. .OnUpdate((GTweener t) => { _ui.m_partsList2.target.x = t.value.x; });
  699. }
  700. private void hideListParts2()
  701. {
  702. _currentMenuType = ConstDressUpItemType.TAO_ZHUANG;
  703. GTween.To(partsListX, _ui.target.width, 0.5f)
  704. .SetTarget(_ui.m_partsList2)
  705. .OnUpdate((GTweener t) => { _ui.m_partsList2.target.x = t.value.x; });
  706. }
  707. private void showSearchListType()
  708. {
  709. // _currentList2 = null;
  710. currentListType = DressUpListType.List5;
  711. GTween.To(_ui.target.width, partsListX, 0.5f)
  712. .SetTarget(_ui.m_partsListSearch.target)
  713. .OnUpdate((GTweener t) => { _ui.m_partsListSearch.target.x = t.value.x; });
  714. }
  715. private void hideSearchListType()
  716. {
  717. GTween.To(partsListX, _ui.target.width, 0.5f)
  718. .SetTarget(_ui.m_partsListSearch.target)
  719. .OnUpdate((GTweener t) => { _ui.m_partsListSearch.target.x = t.value.x; });
  720. }
  721. /*****************************************************************************************************/
  722. private void DressResetSerch()
  723. {
  724. if (currentListType == DressUpListType.List5)
  725. {
  726. OnTouchPad();
  727. }
  728. }
  729. private void UpdateSerch(EventContext context)
  730. {
  731. if (context.data.ToString() == ConstMessage.DRESS_SEARCH)
  732. {
  733. _currentList3 = DressUpMenuItemDataManager.DressSearch(false);
  734. }
  735. else if (context.data.ToString() == ConstMessage.DRESS_FILTER)
  736. {
  737. _currentList3 = DressUpMenuItemDataManager.DressFilter(false);
  738. }
  739. ViewManager.Hide<ModalStatusView>();
  740. UpdateSearchList();
  741. if (currentListType != DressUpListType.List5)
  742. {
  743. hideListParts();
  744. hideListParts2();
  745. hideListType1();
  746. hideListType2();
  747. showSearchListType();
  748. }
  749. _currentMenuType = 0;
  750. }
  751. private void UpdateSearchList()
  752. {
  753. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  754. {
  755. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3, true);
  756. }
  757. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  758. {
  759. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3, true);
  760. }
  761. _currentMenuType = 0;
  762. _ui.m_partsListSearch.m_list.numItems = _currentList3.Count;
  763. ;
  764. }
  765. private void ListType1Item(int index, GObject item)
  766. {
  767. UI.DressUp.UI_TypeItem typeItem = UI.DressUp.UI_TypeItem.Proxy(item);
  768. DressUpMenuItemCfg1 item1 = CommonDataManager.Tables.TblDressUpMenuItemCfg1.DataList[index];
  769. typeItem.m_icon.url = "ui://DressUp/hz_fenleitu_" + item1.Id;
  770. typeItem.m_txtname.text = item1.Name;
  771. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
  772. typeItem.target.data = item1.Id;
  773. typeItem.m_imgNeed.visible = false;
  774. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsFirstMenuNew(item1.Id);
  775. UI.DressUp.UI_TypeItem.ProxyEnd();
  776. }
  777. private void ListType2Item(int index, GObject item)
  778. {
  779. UI.DressUp.UI_TypeItem typeItem = UI.DressUp.UI_TypeItem.Proxy(item);
  780. DressUpMenuItemCfg2 item2 =
  781. CommonDataManager.Tables.TblDressUpMenuItemCfg2.DataList[_currentList2[index] - 1];
  782. typeItem.m_icon.url = "ui://DressUp/hz_fenleituej_" + item2.Id;
  783. typeItem.m_txtname.text = item2.Name;
  784. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
  785. typeItem.target.data = item2.Id;
  786. // var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
  787. typeItem.m_imgNeed.visible = false;
  788. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSecondMenuNew(item2.Id);
  789. UI.DressUp.UI_TypeItem.ProxyEnd();
  790. }
  791. private void ListPartsItem(int index, GObject item)
  792. {
  793. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  794. int id = (int)_currentList3[index];
  795. string iconRes = "";
  796. string partName = "";
  797. string ext = "png";
  798. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  799. {
  800. SuitCfg suitCfg = CommonDataManager.Tables.TblSuitCfg.GetOrDefault(id);
  801. iconRes = suitCfg.Res;
  802. partName = suitCfg.Name;
  803. listItem.m_iconSelected.visible = false;
  804. listItem.m_txtScore.text = "" + SuitUtil.GetSuitScore(id);
  805. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  806. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.Rarity;
  807. listItem.m_imgNew.visible = false;
  808. }
  809. else
  810. {
  811. ItemCfg itemCfg = CommonDataManager.Tables.TblItemCfg.GetOrDefault(id);
  812. iconRes = itemCfg.Res;
  813. partName = itemCfg.Name;
  814. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  815. listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id,
  816. InstanceZonesDataManager.currentScoreType, _roleData.tags);
  817. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.Rarity;
  818. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  819. listItem.m_imgNew.visible = isNew;
  820. if (isNew)
  821. {
  822. ItemProxy.ReqSetItemRead(id).Coroutine();
  823. }
  824. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  825. ext = ItemUtil.GetItemResExt(itemCfg.ItemType, itemCfg.SubType, true);
  826. }
  827. if (listItem.target.data == null)
  828. {
  829. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  830. longPressGesture.trigger = GameConfig.LongPressGestureTrigger;
  831. longPressGesture.once = true;
  832. longPressGesture.onAction.Add(OnLongPress);
  833. _listLongPress.Add(longPressGesture);
  834. }
  835. listItem.m_btnAni.visible = false;
  836. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  837. listItem.m_lock.visible = false;
  838. if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.FieldWork)
  839. {
  840. foreach (var itemDressID in FieldWorkDataManager.Instance.HistoryDressupList)
  841. {
  842. if (itemDressID == id)
  843. {
  844. listItem.m_lock.visible = true;
  845. break;
  846. }
  847. }
  848. }
  849. listItem.m_ScoreType.url = "ui://CommonGame/kp_sx_" + InstanceZonesDataManager.currentScoreType;
  850. listItem.m_txtTitle.text = partName;
  851. listItem.target.data = id;
  852. listItem.m_imgNeed.visible = false;
  853. UI_PartsListItem.ProxyEnd();
  854. }
  855. private void ListParts2Item(int index, GObject item)
  856. {
  857. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  858. int id = (int)_currentList4[index];
  859. string iconRes = "";
  860. string partName = "";
  861. string ext = "png";
  862. if (listItem.target.data == null)
  863. {
  864. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  865. longPressGesture.trigger = GameConfig.LongPressGestureTrigger;
  866. longPressGesture.once = true;
  867. longPressGesture.onAction.Add(OnLongPress);
  868. _listLongPress.Add(longPressGesture);
  869. }
  870. ItemCfg itemCfg = CommonDataManager.Tables.TblItemCfg.GetOrDefault(id);
  871. iconRes = itemCfg.Res;
  872. partName = itemCfg.Name;
  873. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  874. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.Rarity;
  875. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  876. ext = ItemUtil.GetItemResExt(itemCfg.ItemType, itemCfg.SubType, true);
  877. listItem.m_ScoreType.visible = true;
  878. // int mainScore;
  879. // int mainValuel;
  880. // ItemDataManager.GetMainScore(id, out mainScore, out mainValuel);
  881. listItem.m_ScoreType.url =
  882. ResPathUtil.GetCommonGameResPath("kp_sx_" + InstanceZonesDataManager.currentScoreType);
  883. listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id,
  884. InstanceZonesDataManager.currentScoreType,
  885. _dataManager.DressupList[_dataManager.SelectThemeIndex].tags);
  886. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  887. listItem.m_txtTitle.text = partName;
  888. listItem.target.data = id;
  889. // listItem.m_txtScore.visible = false;
  890. //listItem.m_ScoreType.visible = true;
  891. listItem.m_imgNeed.visible = false;
  892. listItem.m_btnAni.visible = false;
  893. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  894. listItem.m_imgNew.visible = isNew;
  895. if (isNew)
  896. {
  897. ItemProxy.ReqSetItemRead(id).Coroutine();
  898. }
  899. UI_PartsListItem.ProxyEnd();
  900. }
  901. private void UpdateSearchListPartsSelected()
  902. {
  903. int count = _ui.m_partsListSearch.m_list.numChildren;
  904. int suitId = MyDressUpHelper.dressUpObj.suitId;
  905. for (int i = 0; i < count; i++)
  906. {
  907. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsListSearch.m_list.GetChildAt(i));
  908. int id = (int)listItem.target.data;
  909. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  910. {
  911. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  912. }
  913. else
  914. {
  915. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id); //非套装金判断是否穿戴
  916. var isSceneType = DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(id);
  917. bool isSuit = !isSceneType && suitId > 0 &&
  918. SuitCfgArray.Instance.GetSuitIdOfItem(id) ==
  919. suitId; //非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  920. bool isSceneSuit = isSceneType && suitId > 0 && isPutOn; //场景类, 若当前穿戴套装要判断item是否属已穿戴
  921. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  922. }
  923. UI_PartsListItem.ProxyEnd();
  924. }
  925. }
  926. private void UpdateListPartsSelected()
  927. {
  928. GList list;
  929. if (_ui.m_partsList.target.x == partsListX)
  930. {
  931. list = _ui.m_partsList.m_list;
  932. }
  933. else if (_ui.m_partsListSearch.target.x == partsListX)
  934. {
  935. list = _ui.m_partsListSearch.m_list;
  936. }
  937. else
  938. {
  939. return;
  940. }
  941. int count = list.numChildren;
  942. int suitId = MyDressUpHelper.dressUpObj.suitId;
  943. for (int i = 0; i < count; i++)
  944. {
  945. UI_PartsListItem listItem = UI_PartsListItem.Proxy(list.GetChildAt(i));
  946. int id = (int)listItem.target.data;
  947. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  948. {
  949. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  950. }
  951. else
  952. {
  953. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id); //非套装金判断是否穿戴
  954. var isSceneType = DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(id);
  955. bool isSuit = !isSceneType && suitId > 0 &&
  956. SuitCfgArray.Instance.GetSuitIdOfItem(id) ==
  957. suitId; //非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  958. bool isSceneSuit = isSceneType && suitId > 0 && isPutOn; //场景类, 若当前穿戴套装要判断item是否属已穿戴
  959. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  960. }
  961. UI_PartsListItem.ProxyEnd();
  962. }
  963. }
  964. private void UpdateListSuitPartsSelected()
  965. {
  966. int count = _ui.m_partsList2.m_list.numChildren;
  967. int suitId = MyDressUpHelper.dressUpObj.suitId;
  968. for (int i = 0; i < count; i++)
  969. {
  970. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList2.m_list.GetChildAt(i));
  971. int id = (int)listItem.target.data;
  972. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id); //非套装金判断是否穿戴
  973. var isSceneType = DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(id);
  974. bool isSuit =
  975. !isSceneType && suitId > 0 &&
  976. SuitCfgArray.Instance.GetSuitIdOfItem(id) == suitId; //非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  977. bool isSceneSuit = isSceneType && suitId > 0 && isPutOn; //场景类, 若当前穿戴套装要判断item是否属已穿戴
  978. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  979. UI_PartsListItem.ProxyEnd();
  980. }
  981. }
  982. private void OnClickBtnSearch()
  983. {
  984. ViewManager.Show<DressFilterView>(false);
  985. }
  986. private void OnClickBtnLastStep()
  987. {
  988. if (!MyDressUpHelper.OnClickBtnLastStep()) return;
  989. UpdateStepBtn(false);
  990. }
  991. private void OnClickBtnNextStep()
  992. {
  993. if (!MyDressUpHelper.OnClickBtnNextStep()) return;
  994. UpdateStepBtn(false);
  995. }
  996. private void SendLog()
  997. {
  998. }
  999. private void CheckGuide(object param)
  1000. {
  1001. if ((GuideDataManager.IsGuideFinish(ConstGuideId.FIELD) <= 0
  1002. && InstanceZonesDataManager.FightScene == ConstInstanceZonesType.FieldWork
  1003. && InstanceZonesDataManager.CheckLevelPass(FieldWorkDataManager.Instance.guideLevelID)))
  1004. {
  1005. UpdateCheckGuide(null);
  1006. }
  1007. else
  1008. {
  1009. Timers.inst.Remove(CheckGuide);
  1010. }
  1011. }
  1012. protected void UpdateCheckGuide(object param)
  1013. {
  1014. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  1015. if ((GuideDataManager.IsGuideFinish(ConstGuideId.FIELD) <= 0 &&
  1016. InstanceZonesDataManager.FightScene == ConstInstanceZonesType.FieldWork))
  1017. {
  1018. GuideController.TryGuide(_ui.m_comListType1.m_listType, ConstGuideId.FIELD, 7, "选择服装进行战斗吧!", 1);
  1019. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.FIELD, 8, "选择服装进行战斗吧!", 0);
  1020. GuideController.TryGuide(_ui.m_btnNext, ConstGuideId.FIELD, 9, "下一步!");
  1021. }
  1022. }
  1023. }
  1024. }