GuideWidgetConfig.lua 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804
  1. local function getChildInSubNodes(nodeTable, key)
  2. if #nodeTable == 0 then
  3. return nil
  4. end
  5. local child = nil
  6. local subNodeTable = {}
  7. for _, v in ipairs(nodeTable) do
  8. if tolua.isnull(v) then
  9. return nil
  10. end
  11. child = v:getChildByName(key)
  12. if (child) then
  13. return child
  14. end
  15. end
  16. for _, v in ipairs(nodeTable) do
  17. local subNodes = v:getChildren()
  18. if #subNodes ~= 0 then
  19. for _, v1 in ipairs(subNodes) do
  20. table.insert(subNodeTable, v1)
  21. end
  22. end
  23. end
  24. return getChildInSubNodes(subNodeTable, key)
  25. end
  26. local function getChildByKey(parent, key)
  27. return getChildInSubNodes({parent}, key)
  28. end
  29. -- 基础指引:
  30. -- 0 NPC面板组件 辅助参数.组件id
  31. -- 101 主界面左上挂节点 辅助参数.组件id 挂节点.101
  32. -- 102 主界面右上挂节点 辅助参数.组件id 挂节点.102
  33. -- 103 主界面左下挂节点 辅助参数.组件id 挂节点.103
  34. -- 104 主界面右下挂节点 辅助参数.组件id 挂节点.104
  35. -- 105 主界面左中挂节点 辅助参数.组件id 挂节点.105
  36. -- 106 主界面上中挂节点 辅助参数.组件id 挂节点.106
  37. -- 107 主界面右中挂节点 辅助参数.组件id 挂节点.107
  38. -- 108 主界面下中挂节点 辅助参数.组件id 挂节点.108
  39. -- GuideWidgetConfig.lua
  40. local function store_func(config)
  41. local id = tostring(config.typeassist)
  42. local PageStoreLayerMediator = global.Facade:retrieveMediator("PageStoreLayerMediator")
  43. if not PageStoreLayerMediator or not PageStoreLayerMediator._layer then
  44. return nil
  45. end
  46. if not PageStoreLayerMediator._layer.itemList then
  47. return nil
  48. end
  49. local chs = PageStoreLayerMediator._layer.itemList:getChildren()
  50. for i,v in ipairs(chs) do
  51. local layout = v:getChildByName("Panel_item")
  52. if id == (layout and tostring(layout["guide_id"])) then
  53. return layout, PageStoreLayerMediator._layer
  54. end
  55. end
  56. return nil
  57. end
  58. local config = {
  59. -- npc面板组件
  60. [0] = function(config)
  61. local NPCLayerMediator = global.Facade:retrieveMediator("NPCLayerMediator")
  62. if not NPCLayerMediator._layer then
  63. return nil
  64. end
  65. local widget = getChildByKey(NPCLayerMediator._layer, tostring(config.typeassist))
  66. local parent = NPCLayerMediator._layer
  67. return widget, parent
  68. end,
  69. -- 背包道具
  70. [1] = function(config)
  71. local BagLayerMediator = global.Facade:retrieveMediator("BagLayerMediator")
  72. local HeroPropertyProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroPropertyProxy)
  73. if HeroPropertyProxy:getIsMergePanelMode() then
  74. BagLayerMediator = global.Facade:retrieveMediator("MergeBagLayerMediator")--合并面板模式
  75. if not BagLayerMediator._layer or not BagLayerMediator._layer.Panel_items or BagLayerMediator._layer:getShowType() ~= 1 then
  76. return nil
  77. end
  78. else
  79. if not BagLayerMediator._layer or not BagLayerMediator._layer.Panel_items then
  80. return nil
  81. end
  82. end
  83. local Panel_items = BagLayerMediator._layer.Panel_items
  84. if not Panel_items then
  85. return nil
  86. end
  87. local items = Panel_items:getChildren()
  88. local widget = nil
  89. if tonumber(config.typeassist) == -1 then
  90. widget = BagLayerMediator._layer._quickUI.Button_store_hero_bag or BagLayerMediator._layer._quickUI.Button_store_mode
  91. else
  92. for i, v in ipairs(items) do
  93. if v:getTag() == tonumber(config.typeassist) then
  94. widget = v
  95. break
  96. end
  97. end
  98. end
  99. local parent = BagLayerMediator._layer
  100. return widget, parent
  101. end,
  102. -- 人物装备位
  103. [2] = function(config)
  104. local PlayerEquipLayerMediator = global.Facade:retrieveMediator("PlayerEquipLayerMediator")
  105. if not PlayerEquipLayerMediator._layer or not PlayerEquipLayerMediator._layer._root then
  106. return nil
  107. end
  108. local widget = getChildByKey(PlayerEquipLayerMediator._layer._root, "Panel_pos"..tostring(config.typeassist))
  109. if not widget then --没找到装备位找自定义的
  110. widget = getChildByKey(PlayerEquipLayerMediator._layer, tostring(config.typeassist))
  111. end
  112. local parent = PlayerEquipLayerMediator._layer
  113. return widget, parent
  114. end,
  115. -- 英雄背包
  116. [3] = function(config)
  117. local HeroBagLayerMediator = global.Facade:retrieveMediator("HeroBagLayerMediator")
  118. local HeroPropertyProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroPropertyProxy)
  119. local isMergeMode = false
  120. if HeroPropertyProxy:getIsMergePanelMode() then
  121. isMergeMode = true
  122. HeroBagLayerMediator = global.Facade:retrieveMediator("MergeBagLayerMediator")
  123. if not HeroBagLayerMediator._layer or not HeroBagLayerMediator._layer.Panel_items or HeroBagLayerMediator._layer:getShowType() ~= 2 then
  124. return nil
  125. end
  126. else
  127. if not HeroBagLayerMediator._layer or not HeroBagLayerMediator._layer.itemPanel then
  128. return nil
  129. end
  130. end
  131. local Panel_items = isMergeMode and HeroBagLayerMediator._layer.Panel_items or HeroBagLayerMediator._layer.itemPanel
  132. if not Panel_items then
  133. return nil
  134. end
  135. local items = Panel_items:getChildren()
  136. local widget = nil
  137. if tonumber(config.typeassist) ~= -1 then
  138. for i, v in ipairs(items) do
  139. if v:getTag() == tonumber(config.typeassist) then
  140. widget = v
  141. break
  142. end
  143. end
  144. end
  145. local parent = HeroBagLayerMediator._layer
  146. return widget, parent
  147. end,
  148. -- 背包挂接组件
  149. [7] = function(config)
  150. local BagLayerMediator = global.Facade:retrieveMediator("BagLayerMediator")
  151. local HeroPropertyProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroPropertyProxy)
  152. if HeroPropertyProxy:getIsMergePanelMode() then
  153. BagLayerMediator = global.Facade:retrieveMediator("MergeBagLayerMediator")
  154. if not BagLayerMediator._layer or BagLayerMediator._layer:getShowType() ~= 1 then
  155. return nil
  156. end
  157. else
  158. if not BagLayerMediator._layer then
  159. return nil
  160. end
  161. end
  162. local widget = getChildByKey(BagLayerMediator._layer, tostring(config.typeassist))
  163. local parent = BagLayerMediator._layer
  164. return widget, parent
  165. end,
  166. --商店
  167. [9] = store_func,
  168. [10] = store_func,
  169. [11] = store_func,
  170. [12] = store_func,
  171. --英雄状态板
  172. [40] = function(config)
  173. --1 英雄头像 2 状态 3 背包 4召唤/收回
  174. local widget, parent
  175. local uiid = tonumber(config.typeassist)
  176. if uiid > 4 or uiid < 1 then
  177. return
  178. end
  179. if uiid == 1 or not global.isWinPlayMode then
  180. local HeroStateLayerMediator = global.Facade:retrieveMediator("HeroStateLayerMediator")
  181. if not HeroStateLayerMediator._layer then
  182. return nil
  183. end
  184. local child = {"Image_head", "Button_state", "Button_bag", "Button_hero"}
  185. widget = getChildByKey(HeroStateLayerMediator._layer, child[tonumber(config.typeassist)])
  186. parent = HeroStateLayerMediator._layer
  187. else
  188. local MainPropertyMediator = global.Facade:retrieveMediator("MainPropertyMediator")
  189. if not MainPropertyMediator._layer then
  190. return
  191. end
  192. local child = {"Image_head", "Button_heroinfo", "Button_herobag", "Button_herostate"}
  193. widget = getChildByKey(MainPropertyMediator._layer, child[tonumber(config.typeassist)])
  194. parent = MainPropertyMediator._layer
  195. end
  196. if uiid < 4 then
  197. local HeroPropertyProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroPropertyProxy)
  198. if not HeroPropertyProxy:HeroIsLogin() then
  199. return
  200. end
  201. end
  202. return widget, parent
  203. end,
  204. -- 英雄装备位
  205. [41] = function(config)
  206. local HeroEquipLayerMediator = global.Facade:retrieveMediator("HeroEquipLayerMediator")
  207. if not HeroEquipLayerMediator._layer or not HeroEquipLayerMediator._layer._root then
  208. return nil
  209. end
  210. local widget = getChildByKey(HeroEquipLayerMediator._layer._root, "Panel_pos"..tostring(config.typeassist))
  211. local parent = HeroEquipLayerMediator._layer
  212. return widget, parent
  213. end,
  214. -- 主界面 挂接组件 左上
  215. [101] = function(config)
  216. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  217. if not MainRootMediator._layer then
  218. return nil
  219. end
  220. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_SUI_LT], tostring(config.typeassist))
  221. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  222. return widget, parent
  223. end,
  224. -- 主界面 挂接组件 右上
  225. [102] = function(config)
  226. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  227. if not MainRootMediator._layer then
  228. return nil
  229. end
  230. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_SUI_RT], tostring(config.typeassist))
  231. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  232. return widget, parent
  233. end,
  234. -- 主界面 挂接组件 左下
  235. [103] = function(config)
  236. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  237. if not MainRootMediator._layer then
  238. return nil
  239. end
  240. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_SUI_LB], tostring(config.typeassist))
  241. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  242. return widget, parent
  243. end,
  244. -- 主界面 挂接组件 右下
  245. [104] = function(config)
  246. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  247. if not MainRootMediator._layer then
  248. return nil
  249. end
  250. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_SUI_RB], tostring(config.typeassist))
  251. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  252. return widget, parent
  253. end,
  254. -- 主界面 挂接组件 左中
  255. [105] = function(config)
  256. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  257. if not MainRootMediator._layer then
  258. return nil
  259. end
  260. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_SUI_LM], tostring(config.typeassist))
  261. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  262. return widget, parent
  263. end,
  264. -- 主界面 挂接组件 上中
  265. [106] = function(config)
  266. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  267. if not MainRootMediator._layer then
  268. return nil
  269. end
  270. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_SUI_TM], tostring(config.typeassist))
  271. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  272. return widget, parent
  273. end,
  274. -- 主界面 挂接组件 右中
  275. [107] = function(config)
  276. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  277. if not MainRootMediator._layer then
  278. return nil
  279. end
  280. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_SUI_RM], tostring(config.typeassist))
  281. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  282. return widget, parent
  283. end,
  284. -- 主界面 挂接组件 下中
  285. [108] = function(config)
  286. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  287. if not MainRootMediator._layer then
  288. return nil
  289. end
  290. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_SUI_BM], tostring(config.typeassist))
  291. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  292. return widget, parent
  293. end,
  294. -- 主界面技能模块 按钮
  295. [109] = function(config)
  296. local MainSkillMediator = global.Facade:retrieveMediator("MainSkillMediator")
  297. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  298. if not MainSkillMediator or not MainRootMediator or not MainSkillMediator._layer or not MainRootMediator._layer then
  299. return nil
  300. end
  301. local widget = getChildByKey(MainSkillMediator._layer._layoutActive, tostring(config.typeassist))
  302. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  303. return widget, parent
  304. end,
  305. -- 导航栏 任务
  306. [110] = function(config)
  307. local MainAssistMediator = global.Facade:retrieveMediator("MainAssistMediator")
  308. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  309. if not MainAssistMediator then
  310. return nil
  311. end
  312. if not MainAssistMediator._layer then
  313. return nil
  314. end
  315. if not MainRootMediator._layer then
  316. return nil
  317. end
  318. if not global.isWinPlayMode then
  319. if MainAssistMediator._layer._assistGroup ~= 2 then
  320. return nil
  321. end
  322. if MainAssistMediator._layer._contentIndex ~= 1 then
  323. return nil
  324. end
  325. end
  326. local listview = MainAssistMediator._layer._listviewCells
  327. if not listview then
  328. return nil
  329. end
  330. listview:doLayout()
  331. local cell = MainAssist and MainAssist._missionCells and MainAssist._missionCells[tonumber(config.typeassist)]
  332. if not cell then--没找到任务的 找挂接按钮
  333. local widget = getChildByKey(MainAssistMediator._layer, tostring(config.typeassist))
  334. local parent = MainAssistMediator._layer
  335. return widget,parent
  336. end
  337. if not cell.quickUI or not cell.quickUI.Button_act then
  338. return
  339. end
  340. local anchorY = listview:getAnchorPoint().y
  341. local limitYMAX = listview:getWorldPosition().y + listview:getContentSize().height * (1 - anchorY)
  342. local limitYMIN = listview:getWorldPosition().y - listview:getContentSize().height * anchorY
  343. local btnAnY = cell.quickUI.Button_act:getAnchorPoint().y
  344. local cellYMAX = cell.quickUI.Button_act:getWorldPosition().y + cell.quickUI.Button_act:getContentSize().height * (1 - btnAnY)
  345. local cellYMIN = cell.quickUI.Button_act:getWorldPosition().y - cell.quickUI.Button_act:getContentSize().height * btnAnY
  346. if cellYMAX > limitYMAX or cellYMIN < limitYMIN then
  347. local idx = listview:getIndex(cell.quickUI.nativeUI)
  348. if idx then
  349. listview:jumpToItem(idx, cc.p(0, 0), cc.p(0, 0))
  350. end
  351. -- return nil
  352. end
  353. local widget = cell.quickUI.Button_act
  354. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  355. return widget, parent
  356. end,
  357. -- 主界面 挂接组件 最底左上
  358. [1001] = function(config)
  359. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  360. if not MainRootMediator._layer then
  361. return nil
  362. end
  363. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_BOTTOM_LT], tostring(config.typeassist))
  364. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  365. return widget, parent
  366. end,
  367. -- 主界面 挂接组件 最底右上
  368. [1002] = function(config)
  369. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  370. if not MainRootMediator._layer then
  371. return nil
  372. end
  373. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_BOTTOM_RT], tostring(config.typeassist))
  374. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  375. return widget, parent
  376. end,
  377. -- 主界面 挂接组件 最底左下
  378. [1003] = function(config)
  379. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  380. if not MainRootMediator._layer then
  381. return nil
  382. end
  383. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_BOTTOM_LB], tostring(config.typeassist))
  384. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  385. return widget, parent
  386. end,
  387. -- 主界面 挂接组件 最底右下
  388. [1004] = function(config)
  389. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  390. if not MainRootMediator._layer then
  391. return nil
  392. end
  393. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_BOTTOM_RB], tostring(config.typeassist))
  394. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  395. return widget, parent
  396. end,
  397. -- 主界面 挂接组件 最顶左上
  398. [1101] = function(config)
  399. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  400. if not MainRootMediator._layer then
  401. return nil
  402. end
  403. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_SUI_TOP_LT], tostring(config.typeassist))
  404. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  405. return widget, parent
  406. end,
  407. -- 主界面 挂接组件 最顶右上
  408. [1102] = function(config)
  409. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  410. if not MainRootMediator._layer then
  411. return nil
  412. end
  413. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_SUI_TOP_RT], tostring(config.typeassist))
  414. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  415. return widget, parent
  416. end,
  417. -- 主界面 挂接组件 最顶左下
  418. [1103] = function(config)
  419. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  420. if not MainRootMediator._layer then
  421. return nil
  422. end
  423. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_SUI_TOP_LB], tostring(config.typeassist))
  424. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  425. return widget, parent
  426. end,
  427. -- 主界面 挂接组件 最顶右下
  428. [1104] = function(config)
  429. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  430. if not MainRootMediator._layer then
  431. return nil
  432. end
  433. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_SUI_TOP_RB], tostring(config.typeassist))
  434. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  435. return widget, parent
  436. end,
  437. -- 996盒子导航
  438. [111] = function(config)
  439. local Box996MainLayerMediator = global.Facade:retrieveMediator("Box996MainLayerMediator")
  440. if not Box996MainLayerMediator._layer then
  441. return nil
  442. end
  443. local widget,parent
  444. local index = tonumber(config.typeassist)
  445. parent = Box996MainLayerMediator._layer._ui.Panel_1
  446. if index == 5 then
  447. widget = Box996MainLayerMediator._layer._ui.Button_close
  448. elseif index >= 1 and index <= 4 then
  449. widget = Box996MainLayerMediator._layer._ui["Button_"..index]
  450. else
  451. widget = getChildByKey(Box996MainLayerMediator._layer._ui.Node_child, tostring(config.typeassist))
  452. end
  453. return widget, parent
  454. end,
  455. -- 双端背包 等按钮 因为要支持pc只能固定id 100-102 个人信息 背包 技能信息
  456. [200] = function(config)
  457. if global.isWinPlayMode then
  458. local num = tonumber(config.typeassist)
  459. if num < 100 or num >102 then
  460. return nil
  461. end
  462. local MainPropertyMediator = global.Facade:retrieveMediator("MainPropertyMediator")
  463. if not MainPropertyMediator._layer then
  464. return nil
  465. end
  466. local btnname = {"Button_role", "Button_bag", "Button_skill"}
  467. local widget = MainPropertyMediator._layer._quickUI[btnname[num - 99]]
  468. local parent = MainPropertyMediator._layer
  469. return widget, parent
  470. else
  471. local MainRootMediator = global.Facade:retrieveMediator("MainRootMediator")
  472. if not MainRootMediator._layer then
  473. return nil
  474. end
  475. local widget = getChildByKey(MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_SUI_RB], tostring(config.typeassist))
  476. local parent = MainRootMediator._layer._nodes[global.MMO.MAIN_NODE_GUIDE]
  477. return widget, parent
  478. end
  479. end,
  480. --右下角切换按钮
  481. [201] = function (config)
  482. local num = tonumber(config.typeassist)
  483. if global.isWinPlayMode then
  484. return nil
  485. end
  486. local MainSkillMediator = global.Facade:retrieveMediator("MainSkillMediator")
  487. if not MainSkillMediator or not MainSkillMediator._layer then
  488. return nil
  489. end
  490. if not MainSkillMediator._layer.ui or not MainSkillMediator._layer.ui.Button_change then
  491. return nil
  492. end
  493. return MainSkillMediator._layer.ui.Button_change, MainSkillMediator._layer
  494. end,
  495. --玩家主面板
  496. [202] = function(config)
  497. local num = tonumber(config.typeassist)
  498. local PlayerFrameMediator
  499. local HeroPropertyProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroPropertyProxy)
  500. if HeroPropertyProxy:getIsMergePanelMode() then--合并面板模式
  501. PlayerFrameMediator = global.Facade:retrieveMediator("MergePlayerLayerMediator")
  502. else
  503. PlayerFrameMediator = global.Facade:retrieveMediator("PlayerFrameMediator")
  504. end
  505. if not PlayerFrameMediator or not PlayerFrameMediator._layer then
  506. return nil
  507. end
  508. local parent = PlayerFrameMediator._layer
  509. if num and num >= 1 and num <= 6 then
  510. local btnList = PlayerFrameMediator._layer._ui.Panel_btnList
  511. local btn = {1, 2, 3, 4, 6, 11}
  512. local name = "Button_" .. btn[num]
  513. local ch = btnList:getChildByName(name)
  514. if ch then
  515. return ch, parent
  516. end
  517. elseif num and num >= 101 and num <= 104 then -- 内功页签按钮
  518. local btnList = PlayerFrameMediator._layer._ui.Panel_btnList_ng
  519. if btnList and btnList:isVisible() then
  520. local name = "Button_" .. (num % 100)
  521. local btn = btnList:getChildByName(name)
  522. if btn then
  523. return btn, parent
  524. end
  525. end
  526. elseif num == 1001 or num == 1002 then -- 基础/内功
  527. local layout = PlayerFrameMediator._layer._ui.topLayout
  528. if layout and layout:isVisible() then
  529. local btnNameL = {
  530. [1001] = "base_btn",
  531. [1002] = "ng_btn"
  532. }
  533. local btn = layout:getChildByName(btnNameL[num])
  534. if btn then
  535. return btn, parent
  536. end
  537. end
  538. else
  539. local ch = getChildByKey(PlayerFrameMediator._layer, tostring(config.typeassist))
  540. return ch, parent
  541. end
  542. return nil
  543. end,
  544. --英雄主面板
  545. [203] = function(config)
  546. local num = tonumber(config.typeassist)
  547. local PlayerFrameMediator
  548. local HeroPropertyProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroPropertyProxy)
  549. if HeroPropertyProxy:getIsMergePanelMode() then--合并面板模式
  550. PlayerFrameMediator = global.Facade:retrieveMediator("MergePlayerLayerMediator")
  551. else
  552. PlayerFrameMediator = global.Facade:retrieveMediator("HeroFrameMediator")
  553. end
  554. if not PlayerFrameMediator or not PlayerFrameMediator._layer then
  555. return nil
  556. end
  557. local parent = PlayerFrameMediator._layer
  558. if num and num >= 1 and num <= 6 then
  559. local btnList = PlayerFrameMediator._layer._ui.Panel_btnList
  560. local btn = {1, 2, 3, 4, 6, 11}
  561. local name = "Button_" .. btn[num]
  562. local ch = btnList:getChildByName(name)
  563. if ch then
  564. return ch, parent
  565. end
  566. elseif num and num >= 101 and num <= 104 then -- 内功页签按钮
  567. local btnList = PlayerFrameMediator._layer._ui.Panel_btnList_ng
  568. if btnList and btnList:isVisible() then
  569. local name = "Button_" .. (num % 100)
  570. local btn = btnList:getChildByName(name)
  571. if btn then
  572. return btn, parent
  573. end
  574. end
  575. elseif num == 1001 or num == 1002 then -- 基础/内功
  576. local layout = PlayerFrameMediator._layer._ui.topLayout
  577. if layout and layout:isVisible() then
  578. local btnNameL = {
  579. [1001] = "base_btn",
  580. [1002] = "ng_btn"
  581. }
  582. local btn = layout:getChildByName(btnNameL[num])
  583. if btn then
  584. return btn, parent
  585. end
  586. end
  587. else
  588. local ch = getChildByKey(PlayerFrameMediator._layer, tostring(config.typeassist))
  589. return ch, parent
  590. end
  591. return nil
  592. end,
  593. -- 人物经脉面板-按钮
  594. [204] = function(config)
  595. local mediator = global.Facade:retrieveMediator("PlayerInternalMeridianLayerMediator")
  596. if not mediator._layer or not mediator._layer._root then
  597. return nil
  598. end
  599. local idList = {2, 3, 4, 5, 1}
  600. local idx = tonumber(config.typeassist)
  601. local parent = mediator._layer
  602. if mediator._layer._ui.Panel_content and idx then
  603. local name = idList[idx] and string.format("Button_%s", idList[idx])
  604. local widget = name and mediator._layer._ui.Panel_content:getChildByName(name)
  605. if widget then
  606. return widget, parent
  607. end
  608. end
  609. -- 找挂接的
  610. local widget = getChildByKey(mediator._layer, tostring(config.typeassist))
  611. return widget, parent
  612. end,
  613. -- 英雄经脉面板-按钮
  614. [205] = function(config)
  615. local mediator = global.Facade:retrieveMediator("HeroInternalMeridianLayerMediator")
  616. if not mediator._layer or not mediator._layer._root then
  617. return nil
  618. end
  619. local idList = {2, 3, 4, 5, 1}
  620. local idx = tonumber(config.typeassist)
  621. local parent = mediator._layer
  622. if mediator._layer._ui.Panel_content and idx then
  623. local name = idList[idx] and string.format("Button_%s", idList[idx])
  624. local widget = name and mediator._layer._ui.Panel_content:getChildByName(name)
  625. if widget then
  626. return widget, parent
  627. end
  628. end
  629. -- 找挂接的
  630. local widget = getChildByKey(mediator._layer, tostring(config.typeassist))
  631. return widget, parent
  632. end,
  633. --人物状态面板
  634. [211] = function(config)
  635. local PlayerBaseAttLayerMediator = global.Facade:retrieveMediator("PlayerBaseAttLayerMediator")
  636. if not PlayerBaseAttLayerMediator._layer or not PlayerBaseAttLayerMediator._layer._root then
  637. return nil
  638. end
  639. local widget = getChildByKey(PlayerBaseAttLayerMediator._layer, tostring(config.typeassist))
  640. local parent = PlayerBaseAttLayerMediator._layer
  641. return widget, parent
  642. end,
  643. --人物属性面板
  644. [212] = function(config)
  645. local PlayerExtraAttLayerMediator = global.Facade:retrieveMediator("PlayerExtraAttLayerMediator")
  646. if not PlayerExtraAttLayerMediator._layer or not PlayerExtraAttLayerMediator._layer._root then
  647. return nil
  648. end
  649. local widget = getChildByKey(PlayerExtraAttLayerMediator._layer, tostring(config.typeassist))
  650. local parent = PlayerExtraAttLayerMediator._layer
  651. return widget, parent
  652. end,
  653. --人物技能面板
  654. [213] = function(config)
  655. local PlayerSkillLayerMediator = global.Facade:retrieveMediator("PlayerSkillLayerMediator")
  656. if not PlayerSkillLayerMediator._layer or not PlayerSkillLayerMediator._layer._root then
  657. return nil
  658. end
  659. local widget = getChildByKey(PlayerSkillLayerMediator._layer, tostring(config.typeassist))
  660. local parent = PlayerSkillLayerMediator._layer
  661. return widget, parent
  662. end,
  663. --人物称号面板
  664. [214] = function(config)
  665. local PlayerTitleLayerMediator = global.Facade:retrieveMediator("PlayerTitleLayerMediator")
  666. if not PlayerTitleLayerMediator._layer or not PlayerTitleLayerMediator._layer._root then
  667. return nil
  668. end
  669. local widget = getChildByKey(PlayerTitleLayerMediator._layer, tostring(config.typeassist))
  670. local parent = PlayerTitleLayerMediator._layer
  671. return widget, parent
  672. end,
  673. --人物时装面板
  674. [215] = function(config)
  675. local PlayerSuperEquipMediator = global.Facade:retrieveMediator("PlayerSuperEquipMediator")
  676. if not PlayerSuperEquipMediator._layer or not PlayerSuperEquipMediator._layer._root then
  677. return nil
  678. end
  679. local widget = getChildByKey(PlayerSuperEquipMediator._layer, tostring(config.typeassist))
  680. local parent = PlayerSuperEquipMediator._layer
  681. return widget, parent
  682. end,
  683. --英雄状态面板
  684. [231] = function(config)
  685. local HeroBaseAttLayerMediator = global.Facade:retrieveMediator("HeroBaseAttLayerMediator")
  686. if not HeroBaseAttLayerMediator._layer or not HeroBaseAttLayerMediator._layer._root then
  687. return nil
  688. end
  689. local widget = getChildByKey(HeroBaseAttLayerMediator._layer, tostring(config.typeassist))
  690. local parent = HeroBaseAttLayerMediator._layer
  691. return widget, parent
  692. end,
  693. --英雄属性面板
  694. [232] = function(config)
  695. local HeroExtraAttLayerMediator = global.Facade:retrieveMediator("HeroExtraAttLayerMediator")
  696. if not HeroExtraAttLayerMediator._layer or not HeroExtraAttLayerMediator._layer._root then
  697. return nil
  698. end
  699. local widget = getChildByKey(HeroExtraAttLayerMediator._layer, tostring(config.typeassist))
  700. local parent = HeroExtraAttLayerMediator._layer
  701. return widget, parent
  702. end,
  703. --英雄技能面板
  704. [233] = function(config)
  705. local HeroSkillLayerMediator = global.Facade:retrieveMediator("HeroSkillLayerMediator")
  706. if not HeroSkillLayerMediator._layer or not HeroSkillLayerMediator._layer._root then
  707. return nil
  708. end
  709. local widget = getChildByKey(HeroSkillLayerMediator._layer, tostring(config.typeassist))
  710. local parent = HeroSkillLayerMediator._layer
  711. return widget, parent
  712. end,
  713. --英雄称号面板
  714. [234] = function(config)
  715. local HeroTitleLayerMediator = global.Facade:retrieveMediator("HeroTitleLayerMediator")
  716. if not HeroTitleLayerMediator._layer or not HeroTitleLayerMediator._layer._root then
  717. return nil
  718. end
  719. local widget = getChildByKey(HeroTitleLayerMediator._layer, tostring(config.typeassist))
  720. local parent = HeroTitleLayerMediator._layer
  721. return widget, parent
  722. end,
  723. --英雄时装面板
  724. [235] = function(config)
  725. local HeroSuperEquipMediator = global.Facade:retrieveMediator("HeroSuperEquipMediator")
  726. if not HeroSuperEquipMediator._layer or not HeroSuperEquipMediator._layer._root then
  727. return nil
  728. end
  729. local widget = getChildByKey(HeroSuperEquipMediator._layer, tostring(config.typeassist))
  730. local parent = HeroSuperEquipMediator._layer
  731. return widget, parent
  732. end,
  733. -- 内挂- 保护
  734. [303] = function(config)
  735. local SettingProtectMediator = global.Facade:retrieveMediator("SettingProtectMediator")
  736. if not SettingProtectMediator._layer or not SettingProtectMediator._layer:GetSUIParent() then
  737. return nil
  738. end
  739. local widget = getChildByKey(SettingProtectMediator._layer, tostring(config.typeassist))
  740. local parent = SettingProtectMediator._layer
  741. return widget, parent
  742. end
  743. }
  744. return config