FieldWorkDressFIghtView.cs 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099
  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. _sceneObject = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("SceneArenaDressUpFight"));
  134. MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject, false, false, null, true);
  135. MyDressUpHelper.dressUpObj.AddOrRemove(180001, false);
  136. // GameObject copyObj = _sceneObject.transform.Find("CopyRole").gameObject;
  137. // _dressUpData.setSceneObj(copyObj);
  138. }
  139. MyDressUpHelper.dressUpObj.PutOnItemList(_roleData.itemList);
  140. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), CommonDataManager.Tables.TblGlobalCfg.DressLimitCount);
  141. _ui.m_c1.selectedIndex = 1;
  142. UpdateStepBtn(true);
  143. UpdateValueInfo();
  144. SendLog();
  145. cardId = _roleData.cardId;
  146. Timers.inst.AddUpdate(CheckGuide);
  147. }
  148. protected override void OnHide()
  149. {
  150. base.OnHide();
  151. if (_sceneObject != null)
  152. {
  153. PrefabManager.Instance.Restore(_sceneObject);
  154. _sceneObject = null;
  155. }
  156. DressUpMenuItemDataManager.Clear();
  157. MyDressUpHelper.ResetMemory();
  158. _ui.m_grhCloseComFightScore.visible = false;
  159. _ui.m_comValueInfo.GetController("c2").selectedIndex = 0;
  160. }
  161. private void OnClickBtnBack()
  162. {
  163. bool isSave = _itemList.Count == MyDressUpHelper.dressUpObj.itemList.Count;
  164. if (isSave)
  165. {
  166. for (int i = 0; i < _itemList.Count; i++)
  167. {
  168. int itemId = MyDressUpHelper.dressUpObj.itemList[i];
  169. if (_itemList.IndexOf(itemId) < 0)
  170. {
  171. isSave = false;
  172. break;
  173. }
  174. }
  175. }
  176. if (!isSave)
  177. {
  178. AlertUI.Show("当前穿搭尚未保存,是否确定退出?")
  179. .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
  180. {
  181. _roleData.cardId = cardId;
  182. GoBackToView();
  183. });
  184. }
  185. else
  186. {
  187. GoBackToView();
  188. }
  189. }
  190. private void GoBackToView()
  191. {
  192. _roleData.itemList = _itemList;
  193. FightDataManager.Instance.SetItemScoreList(_roleData);
  194. ScoreSystemData.Instance.SetEquipScoresWithPartId(_roleData);
  195. //ViewManager.GoBackFrom(typeof(ArenaDressUpFightView).FullName);
  196. //ViewManager.Show<ArenaDressInfoView>(new object[] { FightRoleType.MINE, 0, ArenaDataManager.Instance.DressupList, "" });
  197. this.Hide();
  198. }
  199. private void OnBtnFightScoreRule()
  200. {
  201. _ui.m_grhCloseComFightScore.visible = true;
  202. }
  203. private void OnCloseComFightScore()
  204. {
  205. _ui.m_comValueInfo.GetController("c2").selectedIndex = 0;
  206. _ui.m_grhCloseComFightScore.visible = false;
  207. }
  208. private void OnClickBtnHome()
  209. {
  210. AlertUI.Show("是否返回?")
  211. .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
  212. {
  213. GameController.GoBackToMainView();
  214. });
  215. }
  216. private void UpdateValueInfo()
  217. {
  218. _roleData.itemList = MyDressUpHelper.dressUpObj.itemList;
  219. FightDataManager.Instance.SetItemScoreList(_roleData);
  220. ScoreSystemData.Instance.SetEquipScoresWithPartId(_roleData);
  221. FieldWorkDataManager.Instance.UpdateValue(_ui.m_comFieldValueInfo, _dataManager.SelectThemeIndex, _dataManager.DressupList);
  222. }
  223. private void OnClickListType1Item(EventContext context)
  224. {
  225. // GuideController.HideGuide();
  226. GObject typeItem = context.data as GObject;
  227. int order = (int)typeItem.data;
  228. DressUpMenuItemCfg1 item1 = CommonDataManager.Tables.TblDressUpMenuItemCfg1.DataList[order - 1];
  229. if (item1.SubMenus.Count > 0)
  230. {
  231. this.showListType2(item1.SubMenus);
  232. }
  233. else
  234. {
  235. if (this.showListParts(item1.Type) == false)
  236. {
  237. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  238. return;
  239. }
  240. this.showListParts(item1.Type);
  241. }
  242. this.hideListType1();
  243. UpdateListPartsSelected();
  244. }
  245. private void OnClickListType2Item(EventContext context)
  246. {
  247. GObject typeItem = context.data as GObject;
  248. int order = (int)typeItem.data;
  249. DressUpMenuItemCfg2 item2 = CommonDataManager.Tables.TblDressUpMenuItemCfg2.DataList[order - 1];
  250. if (this.showListParts(item2.Type) == false)
  251. {
  252. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  253. return;
  254. }
  255. this.hideListType2();
  256. }
  257. private void OnClickSearchPartsListItem(EventContext context)
  258. {
  259. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  260. {
  261. return;
  262. }
  263. GObject listItem = context.data as GObject;
  264. int id = (int)listItem.data;
  265. if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.FieldWork)
  266. {
  267. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  268. {
  269. List<int> suitParts = CommonDataManager.Tables.TblSuitCfg.GetOrDefault(id).Parts;
  270. foreach (var suitpart in suitParts)
  271. {
  272. foreach (var itemDressID in FieldWorkDataManager.Instance.HistoryDressupList)
  273. {
  274. if (suitpart == itemDressID)
  275. {
  276. PromptController.Instance.ShowFloatTextPrompt("该套装包含已使用服装,无法使用!");
  277. return;
  278. }
  279. }
  280. }
  281. }
  282. else
  283. {
  284. foreach (var itemDressID in FieldWorkDataManager.Instance.HistoryDressupList)
  285. {
  286. if (itemDressID == id)
  287. {
  288. PromptController.Instance.ShowFloatTextPrompt("该服装本周使用次数已达上限!");
  289. return;
  290. }
  291. }
  292. }
  293. }
  294. bool isOrnament = DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(id);
  295. bool isDress = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  296. bool isHasSame = MyDressUpHelper.dressUpObj.CheckSameTypeIsOn(id);
  297. bool isMaxCount = MyDressUpHelper.GetCurrentOrnamentCount() >= CommonDataManager.Tables.TblGlobalCfg.DressLimitCount;
  298. if (isOrnament && !isDress && !isHasSame && isMaxCount)
  299. {
  300. PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
  301. return;
  302. }
  303. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  304. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), CommonDataManager.Tables.TblGlobalCfg.DressLimitCount);
  305. UpdateStepBtn(true);
  306. // UpdateSearchListPartsSelected();
  307. UpdateValueInfo();
  308. }
  309. private void OnClickPartsListItem(EventContext context)
  310. {
  311. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  312. {
  313. return;
  314. }
  315. GObject listItem = context.data as GObject;
  316. int id = (int)listItem.data;
  317. if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.FieldWork)
  318. {
  319. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  320. {
  321. List<int> suitParts = CommonDataManager.Tables.TblSuitCfg.GetOrDefault(id).Parts;
  322. foreach(var suitpart in suitParts)
  323. {
  324. foreach (var itemDressID in FieldWorkDataManager.Instance.HistoryDressupList)
  325. {
  326. if (suitpart == itemDressID)
  327. {
  328. PromptController.Instance.ShowFloatTextPrompt("该套装包含已使用服装,无法使用!");
  329. return;
  330. }
  331. }
  332. }
  333. }
  334. else
  335. {
  336. foreach (var itemDressID in FieldWorkDataManager.Instance.HistoryDressupList)
  337. {
  338. if (itemDressID == id)
  339. {
  340. PromptController.Instance.ShowFloatTextPrompt("该服装本周使用次数已达上限");
  341. return;
  342. }
  343. }
  344. }
  345. }
  346. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  347. {
  348. partsListScrollingPosY = _ui.m_partsList.m_list.scrollPane.scrollingPosY;
  349. this.showListParts2(id);
  350. this.hideListParts();
  351. MyDressUpHelper.dressUpObj.PutOnItemList(MyDressUpHelper.GetSuitFightItems(id));
  352. }
  353. else
  354. {
  355. bool isOrnament = DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(id);
  356. bool isDress = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  357. bool isHasSame = MyDressUpHelper.dressUpObj.CheckSameTypeIsOn(id);
  358. bool isMaxCount = MyDressUpHelper.GetCurrentOrnamentCount() >= CommonDataManager.Tables.TblGlobalCfg.DressLimitCount;
  359. if (isOrnament && !isDress && !isHasSame && isMaxCount)
  360. {
  361. PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
  362. return;
  363. }
  364. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  365. }
  366. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), CommonDataManager.Tables.TblGlobalCfg.DressLimitCount);
  367. UpdateStepBtn(true);
  368. // UpdateListPartsSelected();
  369. // UpdateListSuitPartsSelected();
  370. UpdateValueInfo();
  371. }
  372. private void OnClickSuitPartsListItem(EventContext context)
  373. {
  374. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  375. {
  376. return;
  377. }
  378. GObject listItem = (GObject)context.data as GObject;
  379. int id = (int)listItem.data;
  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() >= CommonDataManager.Tables.TblGlobalCfg.DressLimitCount;
  384. if (isOrnament && !isDress && !isHasSame && isMaxCount)
  385. {
  386. PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
  387. return;
  388. }
  389. if (!DressUpMenuItemDataManager.CheckHasItem(id))
  390. {
  391. PromptController.Instance.ShowFloatTextPrompt("还未获得这件装扮");
  392. return;
  393. }
  394. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  395. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), CommonDataManager.Tables.TblGlobalCfg.DressLimitCount);
  396. UpdateStepBtn(true);
  397. // UpdateListSuitPartsSelected();
  398. UpdateValueInfo();
  399. }
  400. private void UpdateStepBtn(bool isAdd, int suitId = 0)
  401. {
  402. if (isAdd)
  403. {
  404. MyDressUpHelper.AddMemoryDressup();
  405. }
  406. _ui.m_btnLastStep.enabled = MyDressUpHelper.stepIndex > 0;
  407. _ui.m_btnNextStep.enabled = MyDressUpHelper.stepIndex < MyDressUpHelper.dressMemory.Count - 1;
  408. UpdateListPartsSelected();
  409. UpdateListSuitPartsSelected();
  410. UpdateSearchListPartsSelected();
  411. }
  412. private void OnLongPress(EventContext context)
  413. {
  414. LongPressGesture gesture = (LongPressGesture)context.sender;
  415. int itemId = (int)gesture.host.data;
  416. GoodsItemTipsController.ShowItemTips(itemId);
  417. }
  418. private void OnTouchPad()
  419. {
  420. if (this.currentListType == DressUpListType.List4)
  421. {
  422. this.hideListParts2();
  423. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  424. }
  425. else if (this.currentListType == DressUpListType.List3)
  426. {
  427. if (_currentList2 != null)
  428. {
  429. this.showListType2(_currentList2);
  430. }
  431. else
  432. {
  433. this.showListType1();
  434. }
  435. this.hideListParts();
  436. }
  437. else if (this.currentListType == DressUpListType.List2)
  438. {
  439. this.showListType1();
  440. this.hideListType2();
  441. }
  442. else if (this.currentListType == DressUpListType.List5)
  443. {
  444. this.showListType1();
  445. this.hideSearchListType();
  446. }
  447. }
  448. private void OnClickBtnDelete()
  449. {
  450. MyDressUpHelper.dressUpObj.TakeOffAll();
  451. _roleData.cardId = 0;
  452. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  453. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  454. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), CommonDataManager.Tables.TblGlobalCfg.DressLimitCount);
  455. UpdateStepBtn(true);
  456. // UpdateListPartsSelected();
  457. // UpdateListSuitPartsSelected();
  458. UpdateValueInfo();
  459. }
  460. private void OnClickBtnNext()
  461. {
  462. // if (!MyDressUpHelper.CheckPutOnFinish())
  463. // {
  464. // AlertUI.Show("换好衣服才能进行下一步哦~").SetRightButton(true, "好的");
  465. // }
  466. // else
  467. // {
  468. DressUpFinish();
  469. // }
  470. }
  471. private async void DressUpFinish()
  472. {
  473. if (CardDataManager.GetCardListByRoleType(0).Count > 0)
  474. {
  475. ViewManager.Show<FieldWorkChooseCardView>(InstanceZonesDataManager.currentScoreType);
  476. }
  477. else
  478. {
  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 = CommonDataManager.Tables.TblDressUpMenuItemCfg1.DataList.Count - 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(List<int> menuStrArr = null)
  534. {
  535. currentListType = DressUpListType.List2;
  536. if (menuStrArr != null && menuStrArr.Count > 0)
  537. {
  538. int len = menuStrArr.Count;
  539. _currentList2 = menuStrArr;
  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 = CommonDataManager.Tables.TblDressUpMenuItemCfg1.DataList[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 = CommonDataManager.Tables.TblDressUpMenuItemCfg2.DataList[_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 = CommonDataManager.Tables.TblSuitCfg.GetOrDefault(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 = CommonDataManager.Tables.TblItemCfg.GetOrDefault(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 = CommonDataManager.Tables.TblItemCfg.GetOrDefault(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. UpdateCheckGuide(null);
  993. }
  994. else
  995. {
  996. Timers.inst.Remove(CheckGuide);
  997. }
  998. }
  999. protected void UpdateCheckGuide(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. }