FieldWorkDressFIghtView.cs 47 KB

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