FieldWorkDressFIghtView.cs 46 KB

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