DressUpFightView.cs 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556
  1. using UI.DressUp;
  2. using FairyGUI;
  3. using UnityEngine;
  4. using System.Collections.Generic;
  5. using System;
  6. using ET;
  7. using System.Collections;
  8. namespace GFGGame
  9. {
  10. public class DressUpFightType
  11. {
  12. public int levelID;
  13. public int teaPartID;
  14. }
  15. public class DressUpFightView : BaseView
  16. {
  17. private UI_DressUpFightUI _ui;
  18. private int _fightID;
  19. private int _levelID;
  20. private int _TeaPartyID;
  21. private float listType1X = 0;
  22. private float partsListX = 0;
  23. private float partsListScrollingPosY = 0;
  24. private DressUpListType currentListType;
  25. private int[] _currentList2;
  26. private GameObject _sceneObject;
  27. private List<int> _currentList3 = new List<int>();
  28. private List<int> _currentList4 = new List<int>();
  29. private int _currentMenuType;
  30. private int _currentSuitId;
  31. private StoryLevelCfg _levelCfg;
  32. private StoryFightCfg _fightCfg;
  33. private int scoreType = 0; //目标分数类型保存
  34. private bool _IsTeaParty = false;
  35. private const int SORT_BY_HIGH_SCORE = 0;
  36. private const int SORT_BY_LOW_SCORE = 1;
  37. private int _scoreIndex = SORT_BY_HIGH_SCORE;
  38. private List<LongPressGesture> _listLongPress = new List<LongPressGesture>();
  39. public override void Dispose()
  40. {
  41. if (_sceneObject != null)
  42. {
  43. PrefabManager.Instance.Restore(_sceneObject);
  44. _sceneObject = null;
  45. }
  46. for (int i = 0; i < _listLongPress.Count; i++)
  47. {
  48. _listLongPress[i].Dispose();
  49. }
  50. if (_ui != null)
  51. {
  52. _ui.Dispose();
  53. _ui = null;
  54. }
  55. base.Dispose();
  56. }
  57. protected override void OnInit()
  58. {
  59. base.OnInit();
  60. packageName = UI_DressUpFightUI.PACKAGE_NAME;
  61. _ui = UI_DressUpFightUI.Create();
  62. viewCom = _ui.target;
  63. isfullScreen = true;
  64. //isReturnView = true;
  65. _ui.m_btnClose.width = GRoot.inst.width;
  66. _ui.m_btnClose.height = GRoot.inst.height;
  67. _ui.m_btnClose.AddRelation(GRoot.inst, RelationType.Size);
  68. _ui.m_btnLastStep.visible = true;
  69. _ui.m_btnNextStep.visible = true;
  70. _ui.m_btnClose.visible = false;
  71. _ui.m_grpTips.visible = false;
  72. _ui.m_btnRepeal.visible = false;
  73. _ui.m_btnRenewal.visible = false;
  74. _ui.m_btnSearch.visible = true;
  75. // _ui.m_comboBox.items = new string[] { "我的套装一", "我的套装二", "我的套装三", "我的套装四", "我的套装五", "我的套装六" };
  76. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高分优先", "低分优先" };
  77. _ui.m_partsListSearch.m_comboBoxRarity.items = new string[] { "高分优先", "低分优先" };
  78. InitLists();
  79. _ui.m_partsList.m_comboBoxRarity.onChanged.Add(OnComboBoxRarityChanged);
  80. _ui.m_partsListSearch.m_comboBoxRarity.onChanged.Add(OnSearchComboBoxRarityChanged);
  81. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  82. _ui.m_btnHome.onClick.Add(OnClickBtnHome);
  83. // _ui.m_btnClothingShop.onClick.Add(OnClickBtnClothingShop);
  84. // _ui.m_comboBox.onChanged.Add(OnComboBoxChanged);
  85. _ui.m_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
  86. _ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
  87. _ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
  88. _ui.m_partsList2.m_list.onClickItem.Add(OnClickSuitPartsListItem);
  89. _ui.m_partsListSearch.m_list.onClickItem.Add(OnClickSearchPartsListItem);
  90. _ui.m_touchPad.onClick.Add(OnTouchPad);
  91. _ui.m_btnHint.onClick.Add(OnClickBtnHint);
  92. // _ui.m_btnGuide.onClick.Add(OnTouchPad);
  93. _ui.m_btnClose.onClick.Add(OnClickBtnClose);
  94. _ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
  95. _ui.m_btnNext.onClick.Add(OnClickBtnNext);
  96. _ui.m_btnRecommend.onClick.Add(OnClickBtnRecommend);
  97. _ui.m_btnSearch.onClick.Add(OnClickBtnSearch);
  98. _ui.m_btnAutoPlay.onClick.Add(OnClickBtnAutoPlay);
  99. _ui.m_btnLastStep.onClick.Add(OnClickBtnLastStep);
  100. _ui.m_btnNextStep.onClick.Add(OnClickBtnNextStep);
  101. _ui.m_btnSubmission.onClick.Add(OnClickBtnSubmission);
  102. _ui.m_compNeed.target.onClick.Add(OnClickComNeed);
  103. _ui.m_compNeed.m_listTag.itemRenderer = RenderListTagItem;
  104. // _ui.m_btnShow.onClick.Add(OnClickBtnShow);
  105. // _ui.m_btnHide.onClick.Add(OnClickBtnHide);
  106. // _ui.m_loaShow.onClick.Add(OnClickLoaShow);
  107. // _ui.m_btnHide.visible = false;
  108. // EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdatePartsListSort);
  109. _ui.m_partsList2.m_comboBoxRarity.visible = false;
  110. _ui.m_partsList2.m_imgTop.visible = true;
  111. _ui.m_partsList.m_imgTop.visible = false;
  112. }
  113. protected override void AddEventListener()
  114. {
  115. base.AddEventListener();
  116. EventAgent.AddEventListener(ConstMessage.CARD_CHOOSE, StartCalculateScore);
  117. EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdateSerch);
  118. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
  119. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
  120. EventAgent.AddEventListener(ConstMessage.TEA_PARTY_STATU, TeaPartyStatuChange);
  121. EventAgent.AddEventListener(ConstMessage.CLOTHING_SYNTHETIC_SUCCESS, UpdateNeedClothesState);
  122. // EventAgent.AddEventListener(ConstMessage.DRESS_UP_SCORE_CHANGED, UpdateScore);
  123. }
  124. protected override void RemoveEventListener()
  125. {
  126. base.RemoveEventListener();
  127. EventAgent.RemoveEventListener(ConstMessage.CARD_CHOOSE, StartCalculateScore);
  128. EventAgent.RemoveEventListener(ConstMessage.DRESS_SEARCH, UpdateSerch);
  129. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
  130. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
  131. EventAgent.RemoveEventListener(ConstMessage.TEA_PARTY_STATU, TeaPartyStatuChange);
  132. EventAgent.RemoveEventListener(ConstMessage.CLOTHING_SYNTHETIC_SUCCESS, UpdateNeedClothesState);
  133. // EventAgent.RemoveEventListener(ConstMessage.DRESS_UP_SCORE_CHANGED, UpdateScore);
  134. }
  135. protected override void OnShown()
  136. {
  137. base.OnShown();
  138. var objData = (DressUpFightType)this.viewData;
  139. if (objData.teaPartID > 0) {
  140. _IsTeaParty = true;
  141. _TeaPartyID = objData.teaPartID;
  142. }
  143. else
  144. _IsTeaParty = false;
  145. _levelID = objData.levelID;
  146. if (!_IsTeaParty)
  147. _ui.m_c1.selectedIndex = 0;
  148. else
  149. _ui.m_c1.selectedIndex = 2;
  150. _ui.m_loaGuide.visible = true;
  151. InstanceZonesDataManager.usedRecommend = false;
  152. // _ui.m_comboBox.title = "我的套装";
  153. _ui.m_txtRecommendCount.SetVar("v1", "" + GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.RecommendCount)).FlushVars();
  154. _ui.m_txtRecommendCount.SetVar("v2", GlobalCfgArray.globalCfg.recommendCount.ToString()).FlushVars();
  155. _scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  156. _ui.m_btnAutoPlay.selected = FightDataManager.Instance.autoPlay;
  157. _ui.m_btnAutoPlay.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
  158. _ui.m_btnRecommend.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
  159. if (!_IsTeaParty) {
  160. InstanceZonesDataManager.currentLevelCfgId = _levelID;
  161. _levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
  162. _fightCfg = StoryFightCfgArray.Instance.GetCfg(_levelCfg.fightID);
  163. if (_levelCfg.type == ConstInstanceZonesType.Field)
  164. {
  165. scoreType = FieldDataManager.Instance.fieldInfos.theme;
  166. _ui.m_btnAutoPlay.visible = false;
  167. }
  168. else {
  169. scoreType = _fightCfg.scoreType;
  170. }
  171. InstanceZonesDataManager.FightScene = _levelCfg.type;
  172. _ui.m_compNeed.target.visible = _fightCfg.needItemId > 0 || _fightCfg.needSuitId > 0 || _fightCfg.needTagsArr.Length > 0;
  173. UpdateNeedClothesState();
  174. }
  175. //判断日志,后续解决飞花令需要删除
  176. if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.Arena && _levelID != 0)
  177. {
  178. Debug.LogError($"text :_levelID: {_levelID}");
  179. }
  180. InstanceZonesDataManager.currentScoreType = scoreType;
  181. //一级菜单
  182. _ui.m_comListType1.m_listType.RemoveChildrenToPool();
  183. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length - 3;
  184. //_ui.m_comListType1.m_listType1.ResizeToFit(_ui.m_listType1.numItems);
  185. float maxHeight = _ui.target.height - _ui.m_comListType1.m_listType.y - DressUpView.BOTTOM_BLANK;
  186. if (_ui.m_comListType1.m_listType.height > maxHeight)
  187. {
  188. _ui.m_comListType1.m_listType.height = maxHeight;
  189. }
  190. _ui.m_comListType1.target.x = _ui.target.width;
  191. _ui.m_comListType2.target.x = _ui.target.width;
  192. _ui.m_partsList.target.x = _ui.target.width;
  193. _ui.m_partsList2.target.x = _ui.target.width;
  194. _ui.m_partsListSearch.target.x = _ui.target.width;
  195. _ui.m_scoreType.url = "ui://CommonGame/kp_sx_" + scoreType;
  196. this.showListType1();
  197. if (_sceneObject == null)
  198. {
  199. _sceneObject = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("SceneDressUpFight"));
  200. MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject, false, false);
  201. MyDressUpHelper.dressUpObj.PutOnDefaultDressUpData(_IsTeaParty);
  202. if (_IsTeaParty) {
  203. foreach (var id in LeagueDataManager.Instance.RoleTeapartyInfo.TempEquipIds)
  204. {
  205. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  206. }
  207. }
  208. }
  209. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
  210. UpdateStepBtn(true);
  211. UpdateScore();
  212. if (!_IsTeaParty)
  213. SendLog();
  214. else
  215. {
  216. var teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(LeagueDataManager.Instance.TeaPartyId);
  217. _ui.m_txtTeaPartyName.text = teapartyRoleCfg[objData.teaPartID - 1].name;
  218. }
  219. Timers.inst.AddUpdate(CheckGuide);
  220. TeaPartyStatuChange();
  221. }
  222. protected override void OnHide()
  223. {
  224. base.OnHide();
  225. _ui.m_btnClose.visible = false;
  226. _ui.m_grpTips.visible = false;
  227. if (_sceneObject != null)
  228. {
  229. PrefabManager.Instance.Restore(_sceneObject);
  230. _sceneObject = null;
  231. }
  232. _fightCfg = null;
  233. _levelCfg = null;
  234. DressUpMenuItemDataManager.Clear();
  235. MyDressUpHelper.ResetMemory();
  236. Timers.inst.Remove(CheckGuide);
  237. }
  238. private void OnClickBtnLastStep()
  239. {
  240. if (!MyDressUpHelper.OnClickBtnLastStep()) return;
  241. UpdateStepBtn(false);
  242. }
  243. private void OnClickBtnNextStep()
  244. {
  245. if (!MyDressUpHelper.OnClickBtnNextStep()) return;
  246. UpdateStepBtn(false);
  247. }
  248. //茶话会提交搭配
  249. private void OnClickBtnSubmission()
  250. {
  251. AlertUI.Show("是否确认提交本次搭配?")
  252. .SetLeftButton(true, "取消")
  253. .SetRightButton(true, "确认", (object param) =>
  254. {
  255. ChangeTeapartyDressup();
  256. });
  257. }
  258. private async void ChangeTeapartyDressup()
  259. {
  260. DressUpData dressUpData = MyDressUpHelper.dressUpObj.DressUpDataClone();
  261. bool result = await LeagueSproxy.ChangeTeapartyDressup(RoleDataManager.roleId, _TeaPartyID, dressUpData.itemList);
  262. if (result)
  263. {
  264. backView();
  265. }
  266. }
  267. private void backView()
  268. {
  269. if (_IsTeaParty)
  270. {
  271. ViewManager.Show<LeagueTeaPartyView>();
  272. }
  273. else if (_levelCfg.type == ConstInstanceZonesType.Studio && _levelCfg.subType != ConstInstanceZonesSubType.Hard3)
  274. {
  275. ViewManager.Show(StudioDataManager.Instance.VIEW_NAME, StudioDataManager.Instance.PROPERTY_SELECT_INDEX, ViewManager.GetGoBackDatas(StudioDataManager.Instance.VIEW_NAME));
  276. }
  277. else if (_levelCfg.type == ConstInstanceZonesType.Studio && _levelCfg.subType == ConstInstanceZonesSubType.Hard3)
  278. {
  279. if (StudioDataManager.Instance.IsluckyBoxFilingChapter())
  280. {
  281. ViewManager.Show<StudioFilingView>(StudioDataManager.Instance.GetLuckyBoxActivityID(), ViewManager.GetGoBackDatas(typeof(StudioFilingView).FullName));
  282. }
  283. else
  284. {
  285. ViewManager.Show<StudioFilingView>(null, ViewManager.GetGoBackDatas(typeof(StudioFilingView).FullName));
  286. }
  287. }
  288. else if (_levelCfg.type == ConstInstanceZonesType.Field)
  289. {
  290. ViewManager.GoBackFrom(typeof(DressUpFightView).FullName);
  291. }
  292. else
  293. {
  294. //ViewManager.GoBackFrom(typeof(StoryChapterView).FullName);
  295. ViewManager.Show<StoryChapterView>(_levelCfg.chapterId);//, new object[] { typeof(StoryChapterListView).FullName}
  296. }
  297. //MyDressUpHelper.dressUpObj.TakeOffAll();
  298. this.Hide();
  299. }
  300. private void OnClickBtnBack()
  301. {
  302. if (!_IsTeaParty) {
  303. AlertUI.Show("是否确定退出?")
  304. .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
  305. {
  306. backView();
  307. });
  308. }
  309. else {
  310. DressUpData dressUpData = MyDressUpHelper.dressUpObj.DressUpDataClone();
  311. ChangeTempCollocation(dressUpData.itemList);
  312. backView();
  313. }
  314. //ViewManager.Show<StoryChapterView>(StoryDataManager.currentChapter);
  315. }
  316. private async void ChangeTempCollocation(List<int> tempEquipIds)
  317. {
  318. bool result = await LeagueSproxy.ChangeTempCollocation(tempEquipIds);
  319. if (result)
  320. {
  321. }
  322. }
  323. private void OnClickBtnHome()
  324. {
  325. AlertUI.Show("是否返回?")
  326. .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
  327. {
  328. //MyDressUpHelper.dressUpObj.TakeOffAll();
  329. GameController.GoBackToMainView();
  330. });
  331. }
  332. private void OnClickBtnClothingShop()
  333. {
  334. ViewManager.Show<ClothingShopView>(new object[] { null, scoreType }, null, false, true);
  335. }
  336. private void OnClickListType1Item(EventContext context)
  337. {
  338. //GuideController.HideGuide();
  339. GObject typeItem = context.data as GObject;
  340. int order = (int)typeItem.data;
  341. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[order - 1];
  342. if (item1.subMenusArr.Length > 0)
  343. {
  344. this.showListType2(item1.subMenusArr);
  345. }
  346. else
  347. {
  348. if (this.showListParts(item1.type) == false)
  349. {
  350. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  351. return;
  352. }
  353. this.showListParts(item1.type);
  354. }
  355. this.hideListType1();
  356. UpdateListPartsSelected();
  357. }
  358. private void OnClickListType2Item(EventContext context)
  359. {
  360. GObject typeItem = context.data as GObject;
  361. int order = (int)typeItem.data;
  362. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[order - 1];
  363. if (this.showListParts(item2.type) == false)
  364. {
  365. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  366. return;
  367. }
  368. this.hideListType2();
  369. }
  370. private void OnClickSearchPartsListItem(EventContext context)
  371. {
  372. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  373. {
  374. return;
  375. }
  376. GObject listItem = context.data as GObject;
  377. int id = (int)listItem.data;
  378. bool isOrnament = DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(id);
  379. bool isDress = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  380. bool isHasSame = MyDressUpHelper.dressUpObj.CheckSameTypeIsOn(id);
  381. bool isMaxCount = MyDressUpHelper.GetCurrentOrnamentCount() >= GlobalCfgArray.globalCfg.dressLimitCount;
  382. if (isOrnament && !isDress && !isHasSame && isMaxCount)
  383. {
  384. PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
  385. return;
  386. }
  387. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  388. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
  389. UpdateStepBtn(true);
  390. // UpdateSearchListPartsSelected();
  391. UpdateScore();
  392. }
  393. private void OnClickPartsListItem(EventContext context)
  394. {
  395. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  396. {
  397. return;
  398. }
  399. GObject listItem = context.data as GObject;
  400. int id = (int)listItem.data;
  401. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  402. {
  403. partsListScrollingPosY = _ui.m_partsList.m_list.scrollPane.scrollingPosY;
  404. this.showListParts2(id);
  405. this.hideListParts();
  406. MyDressUpHelper.dressUpObj.PutOnItemList(MyDressUpHelper.GetSuitFightItems(id));
  407. UpdateStepBtn(true);
  408. // MyDressUpHelper.dressUpObj.PutOnSuitCfg(id, false);
  409. }
  410. else
  411. {
  412. bool isOrnament = DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(id);
  413. bool isDress = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  414. bool isHasSame = MyDressUpHelper.dressUpObj.CheckSameTypeIsOn(id);
  415. bool isMaxCount = MyDressUpHelper.GetCurrentOrnamentCount() >= GlobalCfgArray.globalCfg.dressLimitCount;
  416. if (isOrnament && !isDress && !isHasSame && isMaxCount)
  417. {
  418. PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
  419. return;
  420. }
  421. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  422. UpdateStepBtn(true);
  423. }
  424. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
  425. // UpdateListPartsSelected();
  426. // UpdateListSuitPartsSelected();
  427. UpdateScore();
  428. }
  429. private void OnClickSuitPartsListItem(EventContext context)
  430. {
  431. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  432. {
  433. return;
  434. }
  435. GObject listItem = (GObject)context.data as GObject;
  436. int id = (int)listItem.data;
  437. bool isOrnament = DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(id);
  438. bool isDress = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  439. bool isHasSame = MyDressUpHelper.dressUpObj.CheckSameTypeIsOn(id);
  440. bool isMaxCount = MyDressUpHelper.GetCurrentOrnamentCount() >= GlobalCfgArray.globalCfg.dressLimitCount;
  441. if (isOrnament && !isDress && !isHasSame && isMaxCount)
  442. {
  443. PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
  444. return;
  445. }
  446. if (!DressUpMenuItemDataManager.CheckHasItem(id))
  447. {
  448. PromptController.Instance.ShowFloatTextPrompt("还未获得这件装扮");
  449. return;
  450. }
  451. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  452. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
  453. UpdateStepBtn(true);
  454. // UpdateListSuitPartsSelected();
  455. UpdateScore();
  456. }
  457. private void UpdateStepBtn(bool isAdd, int suitId = 0)
  458. {
  459. if (isAdd)
  460. {
  461. MyDressUpHelper.AddMemoryDressup();
  462. }
  463. _ui.m_btnLastStep.enabled = MyDressUpHelper.stepIndex > 0;
  464. _ui.m_btnNextStep.enabled = MyDressUpHelper.stepIndex < MyDressUpHelper.dressMemory.Count - 1;
  465. UpdateListPartsSelected();
  466. UpdateListSuitPartsSelected();
  467. UpdateScore();
  468. }
  469. private void OnLongPress(EventContext context)
  470. {
  471. LongPressGesture gesture = (LongPressGesture)context.sender;
  472. int itemId = (int)gesture.host.data;
  473. GoodsItemTipsController.ShowItemTips(itemId);
  474. }
  475. private void OnTouchPad()
  476. {
  477. if (this.currentListType == DressUpListType.List4)
  478. {
  479. this.hideListParts2();
  480. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  481. }
  482. else if (this.currentListType == DressUpListType.List3)
  483. {
  484. if (_currentList2 != null)
  485. {
  486. this.showListType2(_currentList2);
  487. }
  488. else
  489. {
  490. this.showListType1();
  491. }
  492. this.hideListParts();
  493. }
  494. else if (this.currentListType == DressUpListType.List2)
  495. {
  496. this.showListType1();
  497. this.hideListType2();
  498. }
  499. else if (this.currentListType == DressUpListType.List5)
  500. {
  501. this.showListType1();
  502. this.hideSearchListType();
  503. }
  504. }
  505. private void OnClickBtnHint()
  506. {
  507. this.ShowTaskHint();
  508. }
  509. private void OnClickBtnDelete()
  510. {
  511. MyDressUpHelper.dressUpObj.TakeOffAll();
  512. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  513. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  514. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
  515. UpdateStepBtn(true);
  516. // UpdateListPartsSelected();
  517. // UpdateListSuitPartsSelected();
  518. }
  519. private void OnClickBtnClose()
  520. {
  521. _ui.m_btnClose.visible = false;
  522. _ui.m_grpTips.visible = false;
  523. }
  524. private void OnClickBtnNext()
  525. {
  526. // if (!MyDressUpHelper.CheckPutOnFinish())
  527. // {
  528. // AlertUI.Show("只有换好衣服才能出门哦!")
  529. // .SetRightButton(true, "好的");
  530. // return;
  531. // }
  532. if (!CheckHasNeed())
  533. {
  534. AlertUI.Show("未穿戴必需品。").SetRightButton(true, "好的");
  535. return;
  536. }
  537. var levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
  538. if (RoleDataManager.power < levelCfg.power)
  539. {
  540. ItemUtil.AddPower(OnClickBtnPhotograph);
  541. return;
  542. }
  543. OnClickBtnPhotograph();
  544. }
  545. private bool CheckHasNeed()
  546. {
  547. int _suitId = MyDressUpHelper.dressUpObj.suitId;
  548. bool isNoSuit = _fightCfg.needSuitId > 0 && _suitId != _fightCfg.needSuitId;//需要套装但未穿套装
  549. bool isDressUpItem = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(_fightCfg.needItemId);
  550. bool isIncludeItem = _suitId > 0 && Array.IndexOf(SuitCfgArray.Instance.GetCfg(_suitId).partsArr, _fightCfg.needItemId) >= 0;
  551. bool isNoItem = _fightCfg.needItemId > 0 && !isDressUpItem && !isIncludeItem;
  552. if (isNoSuit || isNoItem)
  553. {
  554. return false;
  555. }
  556. return true;
  557. }
  558. private void OnClickBtnPhotograph()
  559. {
  560. Timers.inst.StartCoroutine(ScreenShotTex());
  561. }
  562. private IEnumerator ScreenShotTex()
  563. {
  564. GameObject Role = _sceneObject.transform.Find("Role").gameObject;
  565. GameObject CopyRoleParent = _sceneObject.transform.Find("CopyRole").gameObject;
  566. Transform CopyRole = CopyRoleParent.transform.Find("Role");
  567. if (CopyRole != null)
  568. {
  569. GameObject.DestroyImmediate(CopyRole.gameObject);
  570. }
  571. Transform transform = GameObject.Instantiate(Role, CopyRoleParent.transform.position, Quaternion.identity).transform;//实例化物体
  572. transform.parent = CopyRoleParent.transform;
  573. transform.name = "Role";
  574. GameObject gameObject = _sceneObject.transform.Find("FightCamera").gameObject;
  575. Camera camera = gameObject.GetComponent<Camera>();
  576. FightDataManager.Instance.RoleTextuex = FightDataManager.Instance.GetPrintscreenNTexture(camera);
  577. yield return new WaitForEndOfFrame();
  578. if (CardDataManager.GetCardListByRoleType(0).Count > 0)
  579. {
  580. ViewManager.Show<StoryCardChoose>(scoreType);
  581. }
  582. else
  583. {
  584. StartCalculateScore();
  585. }
  586. }
  587. private void StartCalculateScore()
  588. {
  589. InstanceZonesDataManager.currentLevelCfgId = _levelID;
  590. //不可移动代码位置
  591. bool hasFightTarget = _fightCfg.targetName != null && _fightCfg.targetName.Length > 0;
  592. if (_levelCfg.type == ConstInstanceZonesType.Field)
  593. {
  594. FieldFightDataManager.Instance.CurrentCardId = InstanceZonesDataManager.currentCardId;
  595. FieldFightDataManager.Instance.CurrentScoreType = InstanceZonesDataManager.currentScoreType;
  596. FieldFightDataManager.Instance.currentLevelCfgId = InstanceZonesDataManager.currentLevelCfgId;
  597. }
  598. if (hasFightTarget)
  599. {
  600. ViewManager.Show<StoryFightTargetView>();
  601. }
  602. else
  603. {
  604. ViewManager.Show<StoryFightSingleView>();
  605. }
  606. this.Hide();
  607. }
  608. private void OnClickBtnRecommend()
  609. {
  610. if (this.currentListType == DressUpListType.List4)
  611. {
  612. this.hideListParts2();
  613. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  614. }
  615. InstanceZonesDataManager.usedRecommend = true;
  616. // MyDressUpHelper.PutOnRecommendItems();
  617. InstanceZonesDataManager.currentLevelCfgId = _levelID;
  618. MyDressUpHelper.PutOnRecommendItems2();
  619. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
  620. UpdateStepBtn(true);
  621. // UpdateListPartsSelected();
  622. // UpdateListSuitPartsSelected();
  623. UpdateScore();
  624. if (!CheckHasNeed())
  625. {
  626. PromptController.Instance.ShowFloatTextPrompt("未拥有必需品");
  627. }
  628. }
  629. private void InitLists()
  630. {
  631. _ui.m_comListType2.m_listType.itemRenderer = ListType2Item;
  632. _ui.m_partsList.m_list.itemRenderer = ListPartsItem;
  633. _ui.m_partsList2.m_list.itemRenderer = ListParts2Item;
  634. _ui.m_partsListSearch.m_list.itemRenderer = ListPartsItem;
  635. listType1X = _ui.m_comListType1.target.x;
  636. partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width;
  637. //一级菜单
  638. _ui.m_comListType1.m_listType.itemRenderer = ListType1Item;
  639. }
  640. private void showListType1()
  641. {
  642. _currentList2 = null;
  643. currentListType = DressUpListType.List1;
  644. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length - 3;
  645. GTween.To(_ui.target.width, listType1X, 0.5f)
  646. .SetTarget(_ui.m_comListType1.target)
  647. .OnUpdate((GTweener t) =>
  648. {
  649. _ui.m_comListType1.target.x = t.value.x;
  650. });
  651. }
  652. private void hideListType1()
  653. {
  654. GTween.To(listType1X, _ui.target.width, 0.5f)
  655. .SetTarget(_ui.m_comListType1.target)
  656. .OnUpdate((GTweener t) =>
  657. {
  658. _ui.m_comListType1.target.x = t.value.x;
  659. });
  660. }
  661. private void showListType2(int[] menuStrArr = null)
  662. {
  663. currentListType = DressUpListType.List2;
  664. if (menuStrArr != null && menuStrArr.Length > 0)
  665. {
  666. int len = menuStrArr.Length;
  667. _currentList2 = menuStrArr.Clone() as int[];
  668. _ui.m_comListType2.m_listType.RemoveChildrenToPool();
  669. _ui.m_comListType2.m_listType.numItems = len;
  670. //_ui.m_listType2.ResizeToFit(_ui.m_listType2.numItems);
  671. float maxHeight = _ui.target.height - _ui.m_comListType2.m_listType.y - DressUpView.BOTTOM_BLANK;
  672. if (_ui.m_comListType2.m_listType.height > maxHeight)
  673. {
  674. _ui.m_comListType2.m_listType.height = maxHeight;
  675. }
  676. }
  677. GTween.To(_ui.target.width, listType1X, 0.5f)
  678. .SetTarget(_ui.m_comListType2.target)
  679. .OnUpdate((GTweener t) =>
  680. {
  681. _ui.m_comListType2.target.x = t.value.x;
  682. });
  683. }
  684. private void hideListType2()
  685. {
  686. GTween.To(listType1X, _ui.target.width, 0.5f)
  687. .SetTarget(_ui.m_comListType2.target)
  688. .OnUpdate((GTweener t) =>
  689. {
  690. _ui.m_comListType2.target.x = t.value.x;
  691. });
  692. }
  693. private bool showListParts(int type, bool selectItem = false)
  694. {
  695. _currentMenuType = type;
  696. UpdatePartsListSort();
  697. if (_ui.m_partsList.m_list.numItems <= 0) return false;
  698. _ui.m_partsList.m_list.ResizeToFit(_ui.m_partsList.m_list.numItems);
  699. float maxHeight = _ui.m_partsList.target.height - _ui.m_partsList.m_list.y;
  700. if (_ui.m_partsList.m_list.height > maxHeight)
  701. {
  702. _ui.m_partsList.m_list.height = maxHeight;
  703. }
  704. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  705. {
  706. _ui.m_partsList.m_list.scrollPane.SetPosY(partsListScrollingPosY, false);
  707. partsListScrollingPosY = 0;
  708. }
  709. currentListType = DressUpListType.List3;
  710. GTween.To(_ui.target.width, partsListX, 0.5f)
  711. .SetTarget(_ui.m_partsList)
  712. .OnUpdate((GTweener t) =>
  713. {
  714. _ui.m_partsList.target.x = t.value.x;
  715. });
  716. UpdateListPartsSelected();
  717. return true;
  718. }
  719. private void OnComboBoxRarityChanged()
  720. {
  721. _scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  722. this.UpdatePartsListSort();
  723. }
  724. private void OnSearchComboBoxRarityChanged()
  725. {
  726. _scoreIndex = _ui.m_partsListSearch.m_comboBoxRarity.selectedIndex;
  727. this.UpdateSearchList();
  728. }
  729. private void UpdatePartsListSort()
  730. {
  731. if (_currentMenuType == 0) return;
  732. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  733. {
  734. _currentList3 = DressUpMenuSuitDataManager.GetSuitIDList();
  735. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  736. {
  737. if (!_IsTeaParty)
  738. _currentList3 = SuitUtil.SortSuitListByHighScore(_currentList3);
  739. else
  740. _currentList3 = SuitUtil.SortTeaPartySuitByHighScore(_currentList3);
  741. }
  742. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  743. {
  744. if (!_IsTeaParty)
  745. _currentList3 = SuitUtil.SortSuitListByLowScore(_currentList3);
  746. else
  747. _currentList3 = SuitUtil.SortTeaPartySuitByLowScore(_currentList3);
  748. }
  749. else
  750. {
  751. _currentList3.Reverse();
  752. }
  753. }
  754. else
  755. {
  756. _currentList3 = DressUpMenuItemDataManager.getItemDatasByType(_currentMenuType);
  757. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  758. {
  759. if (!_IsTeaParty)
  760. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3, true);
  761. else
  762. _currentList3 = DressUpMenuItemDataManager.SortItemTeaPartyByHighScore(_currentList3);
  763. }
  764. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  765. {
  766. if (!_IsTeaParty)
  767. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3, true);
  768. else
  769. _currentList3 = DressUpMenuItemDataManager.SortItemTeaPartyByLowsore(_currentList3);
  770. }
  771. else
  772. {
  773. _currentList3.Reverse();
  774. }
  775. }
  776. // if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  777. // {
  778. // _currentList3 = DressUpMenuItemDataManager.DressSearch(_currentList3);
  779. // }
  780. // else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  781. // {
  782. // _currentList3 = DressUpMenuItemDataManager.DressFilter(_currentList3);
  783. // }
  784. //必穿品放在列表最前面
  785. if (_fightCfg!= null && _fightCfg.needItemId > 0)
  786. {
  787. int index = _currentList3.IndexOf(_fightCfg.needItemId);
  788. if (index >= 0)
  789. {
  790. int item = _currentList3[index];
  791. _currentList3.Remove(_currentList3[index]);
  792. _currentList3.Insert(0, item);
  793. }
  794. }
  795. else if (_fightCfg != null && _fightCfg.needSuitId > 0)
  796. {
  797. int index = _currentList3.IndexOf(_fightCfg.needSuitId);
  798. if (index >= 0)
  799. {
  800. int item = _currentList3[index];
  801. _currentList3.Remove(_currentList3[index]);
  802. _currentList3.Insert(0, item);
  803. }
  804. }
  805. _ui.m_partsList.m_list.RemoveChildrenToPool();
  806. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  807. }
  808. private void UpdateSuitPartsListSort()
  809. {
  810. if (_currentMenuType == 0) return;
  811. _currentList4 = new List<int>(SuitCfgArray.Instance.GetSuitItems(_currentSuitId, true));
  812. // if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  813. // {
  814. // _currentList4 = DressUpMenuItemDataManager.DressSearch(_currentList4);
  815. // }
  816. // else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  817. // {
  818. // _currentList4 = DressUpMenuItemDataManager.DressFilter(_currentList4);
  819. // }
  820. _ui.m_partsList2.m_list.RemoveChildrenToPool();
  821. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  822. }
  823. private void hideListParts()
  824. {
  825. GTween.To(partsListX, _ui.target.width, 0.5f)
  826. .SetTarget(_ui.m_partsList)
  827. .OnUpdate((GTweener t) =>
  828. {
  829. _ui.m_partsList.target.x = t.value.x;
  830. });
  831. }
  832. private void showListParts2(int suitId)
  833. {
  834. _currentSuitId = suitId;
  835. _ui.m_partsList2.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  836. this.UpdateSuitPartsListSort();
  837. _ui.m_partsList2.m_list.ResizeToFit(_ui.m_partsList2.m_list.numItems);
  838. float maxHeight = _ui.m_partsList2.target.height - _ui.m_partsList2.m_list.y;// - DressUpView.BOTTOM_BLANK;
  839. if (_ui.m_partsList2.m_list.height > maxHeight)
  840. {
  841. _ui.m_partsList2.m_list.height = maxHeight;
  842. }
  843. currentListType = DressUpListType.List4;
  844. GTween.To(_ui.target.width, partsListX, 0.5f)
  845. .SetTarget(_ui.m_partsList2)
  846. .OnUpdate((GTweener t) =>
  847. {
  848. _ui.m_partsList2.target.x = t.value.x;
  849. });
  850. }
  851. private void hideListParts2()
  852. {
  853. _currentMenuType = ConstDressUpItemType.TAO_ZHUANG;
  854. GTween.To(partsListX, _ui.target.width, 0.5f)
  855. .SetTarget(_ui.m_partsList2)
  856. .OnUpdate((GTweener t) =>
  857. {
  858. _ui.m_partsList2.target.x = t.value.x;
  859. });
  860. }
  861. private void showSearchListType()
  862. {
  863. // _currentList2 = null;
  864. currentListType = DressUpListType.List5;
  865. GTween.To(_ui.target.width, partsListX, 0.5f)
  866. .SetTarget(_ui.m_partsListSearch.target)
  867. .OnUpdate((GTweener t) =>
  868. {
  869. _ui.m_partsListSearch.target.x = t.value.x;
  870. });
  871. }
  872. private void hideSearchListType()
  873. {
  874. GTween.To(partsListX, _ui.target.width, 0.5f)
  875. .SetTarget(_ui.m_partsListSearch.target)
  876. .OnUpdate((GTweener t) =>
  877. {
  878. _ui.m_partsListSearch.target.x = t.value.x;
  879. });
  880. }
  881. /*****************************************************************************************************/
  882. private void DressResetSerch()
  883. {
  884. if (currentListType == DressUpListType.List5)
  885. {
  886. OnTouchPad();
  887. }
  888. }
  889. private void UpdateSerch(EventContext context)
  890. {
  891. if (context.data.ToString() == ConstMessage.DRESS_SEARCH)
  892. {
  893. _currentList3 = DressUpMenuItemDataManager.DressSearch(false);
  894. }
  895. else if (context.data.ToString() == ConstMessage.DRESS_FILTER)
  896. {
  897. _currentList3 = DressUpMenuItemDataManager.DressFilter(false);
  898. }
  899. ViewManager.Hide<ModalStatusView>();
  900. UpdateSearchList();
  901. if (currentListType != DressUpListType.List5)
  902. {
  903. hideListParts();
  904. hideListParts2();
  905. hideListType1();
  906. hideListType2();
  907. showSearchListType();
  908. }
  909. _currentMenuType = 0;
  910. }
  911. private void UpdateSearchList()
  912. {
  913. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  914. {
  915. if (!_IsTeaParty)
  916. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3, true);
  917. else
  918. _currentList3 = DressUpMenuItemDataManager.SortItemTeaPartyByHighScore(_currentList3);
  919. }
  920. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  921. {
  922. if (!_IsTeaParty)
  923. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3, true);
  924. else
  925. _currentList3 = DressUpMenuItemDataManager.SortItemTeaPartyByLowsore(_currentList3);
  926. }
  927. _currentMenuType = 0;
  928. _ui.m_partsListSearch.m_list.numItems = _currentList3.Count; ;
  929. }
  930. private void ListType1Item(int index, GObject item)
  931. {
  932. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  933. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[index];
  934. typeItem.m_icon.url = "ui://DressUp/hz_fenleitu_" + item1.id;
  935. typeItem.m_txtname.text = item1.name;
  936. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
  937. typeItem.target.data = item1.id;
  938. if (!_IsTeaParty)
  939. {
  940. typeItem.m_imgNeed.visible = ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, item1.id);
  941. typeItem.m_itemType.selectedIndex = 0;
  942. }
  943. else
  944. typeItem.m_itemType.selectedIndex = 1;
  945. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsFirstMenuNew(item1.id);
  946. UI_TypeItem.ProxyEnd();
  947. }
  948. private void ListType2Item(int index, GObject item)
  949. {
  950. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  951. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[_currentList2[index] - 1];
  952. typeItem.m_icon.url = "ui://DressUp/hz_fenleituej_" + item2.id;
  953. typeItem.m_txtname.text = item2.name;
  954. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
  955. typeItem.target.data = item2.id;
  956. if (!_IsTeaParty) {
  957. typeItem.m_itemType.selectedIndex = 0;
  958. var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
  959. typeItem.m_imgNeed.visible = subType == item2.type;
  960. }
  961. else
  962. typeItem.m_itemType.selectedIndex = 1;
  963. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSecondMenuNew(item2.id);
  964. UI_TypeItem.ProxyEnd();
  965. }
  966. private void ListTagItem(int index, GObject item)
  967. {
  968. string[][] tagsArr = (string[][])item.parent.data;
  969. UI_ComTagItem listItem = UI_ComTagItem.Proxy(item);
  970. int tagType = TagCfgArray.Instance.GetCfg(tagsArr[index][0]).type;
  971. UI.CommonGame.UI_ComTag itemTag = UI.CommonGame.UI_ComTag.Proxy(listItem.m_loaTag);
  972. itemTag.m_txtTag.text = tagsArr[index][0];
  973. itemTag.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tagType);
  974. itemTag.m_loaTag.scale = new Vector2(0.8f, 0.8f);
  975. UI.CommonGame.UI_ComTag.ProxyEnd();
  976. listItem.m_txtScore.text = tagsArr[index][1];
  977. UI_ComTagItem.ProxyEnd();
  978. }
  979. private void ListPartsItem(int index, GObject item)
  980. {
  981. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  982. int id = (int)_currentList3[index];
  983. string iconRes = "";
  984. string partName = "";
  985. string ext = "png";
  986. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  987. {
  988. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  989. iconRes = suitCfg.res;
  990. partName = suitCfg.name;
  991. listItem.m_iconSelected.visible = false;
  992. if (!_IsTeaParty)
  993. {
  994. listItem.m_txtScore.text = "" + SuitUtil.GetSuitScore(id);
  995. listItem.m_itemType.selectedIndex = 0;
  996. }
  997. else
  998. {
  999. if (listItem.m_ListTag.data == null)
  1000. listItem.m_ListTag.itemRenderer = ListTagItem;
  1001. listItem.m_ListTag.data = suitCfg.tagsArr;
  1002. listItem.m_ListTag.numItems = suitCfg.tagsArr.Length;
  1003. listItem.m_itemType.selectedIndex = 1;
  1004. }
  1005. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  1006. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  1007. listItem.m_imgNew.visible = false;
  1008. }
  1009. else
  1010. {
  1011. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  1012. iconRes = itemCfg.res;
  1013. partName = itemCfg.name;
  1014. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  1015. if (!_IsTeaParty) {
  1016. listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
  1017. listItem.m_itemType.selectedIndex = 0;
  1018. }
  1019. else {
  1020. if (listItem.m_ListTag.data == null)
  1021. listItem.m_ListTag.itemRenderer = ListTagItem;
  1022. listItem.m_ListTag.data = itemCfg.tagsArr;
  1023. listItem.m_ListTag.numItems = itemCfg.tagsArr.Length;
  1024. listItem.m_itemType.selectedIndex = 1;
  1025. }
  1026. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  1027. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  1028. listItem.m_imgNew.visible = isNew;
  1029. if (isNew)
  1030. {
  1031. ItemProxy.ReqSetItemRead(id).Coroutine();
  1032. }
  1033. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  1034. ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
  1035. }
  1036. if (listItem.target.data == null)
  1037. {
  1038. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  1039. longPressGesture.once = true;
  1040. longPressGesture.onAction.Add(OnLongPress);
  1041. _listLongPress.Add(longPressGesture);
  1042. }
  1043. listItem.m_btnAni.visible = false;
  1044. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  1045. listItem.m_ScoreType.url = "ui://CommonGame/kp_sx_" + scoreType;
  1046. listItem.m_txtTitle.text = partName;
  1047. listItem.target.data = id;
  1048. listItem.m_imgNeed.visible = _fightCfg != null && (_fightCfg.needItemId == id || _fightCfg.needSuitId == id);
  1049. UI_PartsListItem.ProxyEnd();
  1050. }
  1051. private void ListParts2Item(int index, GObject item)
  1052. {
  1053. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  1054. int id = (int)_currentList4[index];
  1055. string iconRes = "";
  1056. string partName = "";
  1057. string ext = "png";
  1058. if (listItem.target.data == null)
  1059. {
  1060. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  1061. longPressGesture.once = true;
  1062. longPressGesture.onAction.Add(OnLongPress);
  1063. _listLongPress.Add(longPressGesture);
  1064. }
  1065. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  1066. iconRes = itemCfg.res;
  1067. partName = itemCfg.name;
  1068. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  1069. if (!_IsTeaParty) {
  1070. listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
  1071. listItem.m_itemType.selectedIndex = 0;
  1072. }
  1073. else
  1074. {
  1075. if (listItem.m_ListTag.data == null)
  1076. listItem.m_ListTag.itemRenderer = ListTagItem;
  1077. listItem.m_ListTag.data = itemCfg.tagsArr;
  1078. listItem.m_ListTag.numItems = itemCfg.tagsArr.Length;
  1079. listItem.m_itemType.selectedIndex = 1;
  1080. }
  1081. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  1082. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  1083. ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
  1084. listItem.m_ScoreType.visible = true;
  1085. // int mainScore;
  1086. // int mainValuel;
  1087. // ItemDataManager.GetMainScore(id, out mainScore, out mainValuel);
  1088. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + scoreType);
  1089. if (!_IsTeaParty) {
  1090. listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
  1091. listItem.m_itemType.selectedIndex = 0;
  1092. }
  1093. else
  1094. {
  1095. if (listItem.m_ListTag.data == null)
  1096. {
  1097. listItem.m_ListTag.itemRenderer = ListTagItem;
  1098. }
  1099. listItem.m_ListTag.data = itemCfg.tagsArr;
  1100. listItem.m_ListTag.numItems = itemCfg.tagsArr.Length;
  1101. listItem.m_itemType.selectedIndex = 1;
  1102. }
  1103. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  1104. listItem.m_txtTitle.text = partName;
  1105. listItem.target.data = id;
  1106. // listItem.m_txtScore.visible = false;
  1107. //listItem.m_ScoreType.visible = true;
  1108. listItem.m_imgNeed.visible = false;
  1109. listItem.m_btnAni.visible = false;
  1110. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  1111. listItem.m_imgNew.visible = isNew;
  1112. if (isNew)
  1113. {
  1114. ItemProxy.ReqSetItemRead(id).Coroutine();
  1115. }
  1116. UI_PartsListItem.ProxyEnd();
  1117. }
  1118. private void UpdateListPartsSelected()
  1119. {
  1120. GList list;
  1121. if (_ui.m_partsList.target.x == partsListX)
  1122. {
  1123. list = _ui.m_partsList.m_list;
  1124. }
  1125. else if (_ui.m_partsListSearch.target.x == partsListX)
  1126. {
  1127. list = _ui.m_partsListSearch.m_list;
  1128. }
  1129. else
  1130. {
  1131. return;
  1132. }
  1133. int count = list.numChildren;
  1134. int suitId = MyDressUpHelper.dressUpObj.suitId;
  1135. for (int i = 0; i < count; i++)
  1136. {
  1137. UI_PartsListItem listItem = UI_PartsListItem.Proxy(list.GetChildAt(i));
  1138. int id = (int)listItem.target.data;
  1139. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  1140. {
  1141. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  1142. }
  1143. else
  1144. {
  1145. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
  1146. var isSceneType = DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(id);
  1147. bool isSuit = !isSceneType && suitId > 0 && SuitCfgArray.Instance.GetSuitIdOfItem(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  1148. bool isSceneSuit = isSceneType && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
  1149. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  1150. }
  1151. UI_PartsListItem.ProxyEnd();
  1152. }
  1153. }
  1154. private void UpdateSearchListPartsSelected()
  1155. {
  1156. int count = _ui.m_partsListSearch.m_list.numChildren;
  1157. int suitId = MyDressUpHelper.dressUpObj.suitId;
  1158. for (int i = 0; i < count; i++)
  1159. {
  1160. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsListSearch.m_list.GetChildAt(i));
  1161. int id = (int)listItem.target.data;
  1162. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  1163. {
  1164. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  1165. }
  1166. else
  1167. {
  1168. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
  1169. var isSceneType = DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(id);
  1170. bool isSuit = !isSceneType && suitId > 0 && SuitCfgArray.Instance.GetSuitIdOfItem(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  1171. bool isSceneSuit = isSceneType && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
  1172. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  1173. }
  1174. UI_PartsListItem.ProxyEnd();
  1175. }
  1176. }
  1177. private void UpdateListSuitPartsSelected()
  1178. {
  1179. int count = _ui.m_partsList2.m_list.numChildren;
  1180. int suitId = MyDressUpHelper.dressUpObj.suitId;
  1181. for (int i = 0; i < count; i++)
  1182. {
  1183. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList2.m_list.GetChildAt(i));
  1184. int id = (int)listItem.target.data;
  1185. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
  1186. var isSceneType = DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(id);
  1187. bool isSuit = !isSceneType && suitId > 0 && SuitCfgArray.Instance.GetSuitIdOfItem(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  1188. bool isSceneSuit = isSceneType && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
  1189. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  1190. UI_PartsListItem.ProxyEnd();
  1191. }
  1192. }
  1193. private void ShowTaskHint()
  1194. {
  1195. _ui.m_btnClose.visible = true;
  1196. _ui.m_grpTips.visible = true;
  1197. string str = "";
  1198. if (!_IsTeaParty)
  1199. str = _levelCfg.hint;
  1200. else {
  1201. var teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(LeagueDataManager.Instance.TeaPartyId);
  1202. str = teapartyRoleCfg[_TeaPartyID - 1].hint;
  1203. }
  1204. _ui.m_txtHint.text = str;
  1205. if (this._ui.m_txtHint.textHeight > this._ui.m_txtHint.textFormat.size * 2)
  1206. {
  1207. this._ui.m_txtHint.align = AlignType.Left;
  1208. }
  1209. else
  1210. {
  1211. this._ui.m_txtHint.align = AlignType.Center;
  1212. }
  1213. }
  1214. private void UpdateScore()
  1215. {
  1216. if (!_IsTeaParty)
  1217. _ui.m_txtScore.text = "" + FightDataManager.Instance.GetScore(InstanceZonesDataManager.roleData).ToString();
  1218. // GuideController.TryGuideDressUpFightViewBtnNext(_ui.m_btnNext);
  1219. else
  1220. _ui.m_txtMatch.text = "" + LeagueDataManager.Instance.GetTeaPartyMatchedValue(InstanceZonesDataManager.roleData);
  1221. }
  1222. private void OnClickBtnSearch()
  1223. {
  1224. int type = 0;
  1225. if (_IsTeaParty)
  1226. type = 1;
  1227. ViewManager.Show<DressFilterView>(new object[] { 0, 0, type}, new object[] { typeof(DressUpView).FullName});
  1228. }
  1229. private void OnClickBtnAutoPlay()
  1230. {
  1231. FightDataManager.Instance.autoPlay = _ui.m_btnAutoPlay.selected;
  1232. }
  1233. private void OnClickComNeed()
  1234. {
  1235. if (_fightCfg.needItemId <= 0 && _fightCfg.needSuitId <= 0)
  1236. {
  1237. return;
  1238. }
  1239. if (_fightCfg.needSuitId > 0)
  1240. {
  1241. ViewManager.Show<SuitPartsDetailView>(_fightCfg.needSuitId, new object[] { typeof(DressUpFightView).FullName, this.viewData });
  1242. }
  1243. else
  1244. {
  1245. int itemId = (int)_ui.m_compNeed.target.data;
  1246. object[] sourceDatas = new object[] { itemId, new object[] { typeof(DressUpFightView).FullName, this.viewData }, 1 };
  1247. GoodsItemTipsController.ShowItemTips(itemId, sourceDatas);
  1248. }
  1249. }
  1250. private void RenderListTagItem(int index, GObject obj)
  1251. {
  1252. UI.CommonGame.UI_ComTag item = UI.CommonGame.UI_ComTag.Proxy(obj);
  1253. string tag = _fightCfg.needTagsArr[index];
  1254. int tagType = TagCfgArray.Instance.GetCfg(tag).type;
  1255. item.m_txtTag.text = tag;
  1256. item.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tagType);
  1257. UI.CommonGame.UI_ComTag.ProxyEnd();
  1258. }
  1259. private bool CheckListCount(int type)
  1260. {
  1261. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  1262. {
  1263. return DressUpMenuSuitDataManager.GetSuitIDList().Count > 0;
  1264. }
  1265. else
  1266. {
  1267. return DressUpMenuItemDataManager.getItemDatasByType(type).Count > 0;
  1268. }
  1269. }
  1270. private void SendLog()
  1271. {
  1272. var levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
  1273. switch (levelCfg.type)
  1274. {
  1275. case ConstInstanceZonesType.Story:
  1276. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.CHUN_ZHONG_LOU, 2);
  1277. break;
  1278. case ConstInstanceZonesType.Studio:
  1279. StudioCfg studioCfg = StudioCfgArray.Instance.GetCfg(levelCfg.chapterId);
  1280. if (studioCfg.funId == typeof(StudioMetalView).Name)
  1281. {
  1282. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.JIN_SHU_XIU_FU, 2);
  1283. }
  1284. else if (studioCfg.funId == typeof(StudioFabricView).Name)
  1285. {
  1286. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZHI_WU_XIU_FU, 2);
  1287. }
  1288. else if (studioCfg.funId == typeof(StudioPropertyView).Name)
  1289. {
  1290. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHU_HUA_XIU_FU, 2);
  1291. }
  1292. break;
  1293. }
  1294. }
  1295. private void CheckGuide(object param)
  1296. {
  1297. if (GuideDataManager.IsGuideFinish(ConstGuideId.BUY_CLOTHING) <= 0
  1298. || GuideDataManager.IsGuideFinish(ConstGuideId.START_FIGHT) <= 0
  1299. || GuideDataManager.IsGuideFinish(ConstGuideId.AUTOPLAY_FIGHT) <= 0
  1300. || GuideDataManager.IsGuideFinish(ConstGuideId.CLOTHING_SYNTHETIC) <= 0)
  1301. {
  1302. UpdateToCheckGuide(null);
  1303. }
  1304. else
  1305. {
  1306. Timers.inst.Remove(CheckGuide);
  1307. }
  1308. _ui.m_loaGuide.visible = false;
  1309. }
  1310. protected override void UpdateToCheckGuide(object param)
  1311. {
  1312. if (!ViewManager.CheckIsTopView(this.viewCom) || _IsTeaParty) return;
  1313. int buyClothingIndex = 0;
  1314. int buyClothingSubIndex = 0;
  1315. int taozhuangIndex = 0;
  1316. int len = _ui.m_comListType1.m_listType.numChildren;
  1317. for (int i = 0; i < len; i++)
  1318. {
  1319. UI_TypeItem item = UI_TypeItem.Proxy(_ui.m_comListType1.m_listType.GetChildAt(i));
  1320. if (item != null)
  1321. {
  1322. int menuID = (int)item.target.data;
  1323. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  1324. if (GuideDataManager.IsGuideFinish(ConstGuideId.START_FIGHT) <= 0 && dressUpMenuItemCfg1.type == ConstDressUpItemType.TAO_ZHUANG)
  1325. {
  1326. taozhuangIndex = i;
  1327. break;
  1328. }
  1329. if (GuideDataManager.IsGuideFinish(ConstGuideId.BUY_CLOTHING) <= 0 && _fightCfg.needItemId > 0 && ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, dressUpMenuItemCfg1.id))
  1330. {
  1331. buyClothingIndex = i;
  1332. break;
  1333. }
  1334. }
  1335. UI_TypeItem.ProxyEnd();
  1336. }
  1337. buyClothingSubIndex = _currentList3.IndexOf(_fightCfg.needItemId);
  1338. GuideController.TryGuide(_ui.m_comListType1.m_listType, ConstGuideId.START_FIGHT, 3, "点击相应的分类,可以快速找到服饰。", taozhuangIndex);
  1339. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.START_FIGHT, 4, "", 0);
  1340. GuideController.TryGuide(_ui.m_btnNext, ConstGuideId.START_FIGHT, 5, "穿着完毕,来验证一下,换上的服饰是否符合需求。");
  1341. // GuideController.TryCompleteGuide(ConstGuideId.START_FIGHT, 5);
  1342. GuideController.TryGuide(_ui.m_compNeed.target, ConstGuideId.BUY_CLOTHING, 3, "当提示有“必需品”时,需要穿上对应物品才能通关。");
  1343. GuideController.TryGuide(_ui.m_btnRecommend, ConstGuideId.BUY_CLOTHING, 7, "点击推荐搭配,可以快速穿上必须品。");
  1344. GuideController.TryGuide(_ui.m_btnAutoPlay, ConstGuideId.BUY_CLOTHING, 8, "勾选后,会自动进行比拼哦~~");
  1345. GuideController.TryCompleteGuide(ConstGuideId.BUY_CLOTHING, 8);
  1346. GuideController.TryGuide(_ui.m_btnHint, ConstGuideId.FIGHT_TIPS, 1, "这里可以看看通关提示呢~");
  1347. GuideController.TryCompleteGuide(ConstGuideId.FIGHT_TIPS, 1);
  1348. GuideController.TryGuide(_ui.m_btnRecommend, ConstGuideId.AUTOPLAY_FIGHT, 1, "", -1, true, 0, true, true);//这个引导自动完成,测试中策划要求件推荐搭配引导提前,为避免意外,没有改引导表,而是直接吧推荐搭配加到买必须品的引导力,这个引导自动完成
  1349. if (GuideDataManager.currentGuideId == GuideCfgArray.Instance.GetCfg(ConstGuideId.AUTOPLAY_FIGHT).id) {
  1350. GuideController.TryCompleteGuideIndex(ConstGuideId.AUTOPLAY_FIGHT, 1);
  1351. }
  1352. GuideController.TryCompleteGuide(ConstGuideId.AUTOPLAY_FIGHT, 1);
  1353. GuideController.TryGuide(_ui.m_compNeed.target, ConstGuideId.CLOTHING_SYNTHETIC, 1, "当提示有\"必需品\"时。需要穿上对应物品才能通关",-1,false);
  1354. GuideController.TryCompleteGuide(ConstGuideId.CLOTHING_SYNTHETIC, 6);
  1355. }
  1356. protected override void TryCompleteGuide()
  1357. {
  1358. base.TryCompleteGuide();
  1359. // GuideController.TryCompleteGuide(ConstGuideId.START_FIGHT, 5);
  1360. }
  1361. private void TeaPartyStatuChange()
  1362. {
  1363. if (_IsTeaParty && LeagueDataManager.Instance.TeaPartyStatus == LeagueTeaPartyStatus.YesGo)
  1364. {
  1365. AlertUI.Show("管理员已开启茶会,请前往挑战!")
  1366. .SetLeftButton(false).SetRightButton(true, "确定", (object data) =>
  1367. {
  1368. this.Hide();
  1369. if (LeagueDataManager.Instance.TeaPartyStatus == LeagueTeaPartyStatus.YesGo)
  1370. {
  1371. if (LeagueDataManager.Instance.RoleTeapartyInfo.Status && !LeagueDataManager.Instance.RoleTeapartyInfo.IsComplete)
  1372. {
  1373. ViewManager.Show<LeagueTeaPartyShowView>();
  1374. }
  1375. else
  1376. ViewManager.Show<LeagueTeaPartyView>();
  1377. }
  1378. });
  1379. }
  1380. }
  1381. /// <summary>
  1382. /// 更新必需品的拥有状态
  1383. /// </summary>
  1384. private void UpdateNeedClothesState()
  1385. {
  1386. if (_ui.m_compNeed.target.visible)
  1387. {
  1388. _ui.m_compNeed.m_c1.selectedIndex = 0;
  1389. if (_fightCfg.needItemId > 0)
  1390. {
  1391. _ui.m_compNeed.m_txtNeedName.text = ItemUtil.GetItemName(_fightCfg.needItemId);
  1392. _ui.m_compNeed.target.data = _fightCfg.needItemId;
  1393. _ui.m_compNeed.m_imgGot.visible = ItemDataManager.GetItemNum(_fightCfg.needItemId) > 0;
  1394. }
  1395. else if (_fightCfg.needSuitId > 0)
  1396. {
  1397. _ui.m_compNeed.m_txtNeedName.text = ItemUtil.GetSuitName(_fightCfg.needSuitId);
  1398. _ui.m_compNeed.target.data = _fightCfg.needSuitId;
  1399. _ui.m_compNeed.m_imgGot.visible = DressUpMenuSuitDataManager.CheckHaveSuit(_fightCfg.needSuitId);
  1400. }
  1401. else
  1402. {
  1403. _ui.m_compNeed.m_c1.selectedIndex = 1;
  1404. _ui.m_compNeed.m_listTag.numItems = _fightCfg.needTagsArr.Length;
  1405. _ui.m_compNeed.m_imgGot.visible = false;
  1406. }
  1407. }
  1408. }
  1409. }
  1410. }