DressUpFightView.cs 66 KB

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