KLUIPlayerInfoPanel.lua 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953
  1. ---@class KLUIPlayerInfoPanel:UIKmlLuaPanelBase
  2. ---@field view KLUIPlayerInfoPanelView
  3. ---@field exprienceTmeplateList table
  4. ---@field buffInfoTemplateList table
  5. ---@field KLUIBuffInfoListPanel KLUIBuffInfoListPanel
  6. local KLUIPlayerInfoPanel = class(UIKmlLuaPanelBase)
  7. local pkName = {
  8. [0] = "全体",
  9. [1] = "和平",
  10. [4] = "组队",
  11. [5] = "战盟",
  12. }
  13. ---创建时调用一次
  14. function KLUIPlayerInfoPanel:Init()
  15. --local _, rootMinY = GUI:GetOffsetMin(self.view.root)
  16. --local _, rootMaxY = GUI:GetOffsetMax(self.view.root)
  17. --local _, sliderMinY = GUI:GetOffsetMin(self.view.sliderExperience)
  18. --local _, sliderMaxY = GUI:GetOffsetMax(self.view.sliderExperience)
  19. --local _, leftBgMinY = GUI:GetOffsetMin(self.view.leftBg)
  20. --local _, leftBgMaxY = GUI:GetOffsetMax(self.view.leftBg)
  21. --GUI:SetOffsetMin(self.view.root,0,rootMinY)
  22. --GUI:SetOffsetMax(self.view.root,0,rootMaxY)
  23. --GUI:SetOffsetMin(self.view.sliderExperience,0,sliderMinY)
  24. --GUI:SetOffsetMax(self.view.sliderExperience,0,sliderMaxY)
  25. --GUI:SetOffsetMin(self.view.leftBg,0,leftBgMinY)
  26. --GUI:SetOffsetMax(self.view.leftBg,0,leftBgMaxY)
  27. self.experienceTemplateList = {}
  28. self.buffInfoTemplateList = {}
  29. self.buffInfoList = {}
  30. self.freeBuffInfo = {}
  31. self.pkModeTemplateList = {}
  32. -- local tbl = SL:GetConfigTable("cfg_free_buff")
  33. if false then
  34. ---@param v cfg_free_buff_column
  35. for i, v in pairs(tbl) do
  36. if v.showType == 1 then
  37. self.freeBuffInfo[v.id] = v
  38. end
  39. end
  40. end
  41. self.level = SL:GetMetaValue("LEVEL")
  42. self:RefreshFastItem()
  43. self.expEffects = TablePool()
  44. end
  45. ---创建或者刷新界面数据时调用
  46. function KLUIPlayerInfoPanel:Refresh()
  47. self:Clear()
  48. self:RefreshPlayerHp()
  49. self:RefreshPlayerMp()
  50. self:RefreshPlayerLevel()
  51. self:RefreshExperienceAdd()
  52. self:RefreshShield()
  53. --self:RefreshAgsto()
  54. self:InitPKMode()
  55. self:RefreshComboSkillValue()
  56. self:RefreshTotalExpGain()
  57. local power = SL:GetMetaValue(EMetaVarGetKey.BATTERY)
  58. GUI:SetLoadingbar_startper(self.view.sliderPower, power)
  59. self.timer = SL:Schedule(self.timer,0, 30, -1, function()
  60. local power = SL:GetMetaValue(EMetaVarGetKey.BATTERY)
  61. GUI:SetLoadingbar_startper(self.view.sliderPower, power)
  62. end)
  63. --[[ self.MonthTime = SL:Schedule(self.MonthTime,0, 1, -1, function()
  64. if InfoManager.monthCardInfo:IsHaveDayTime() then
  65. ---小于1天 大于0时才显示
  66. GUI:SetActive(self.view.MonthCardBtn, true)
  67. else
  68. GUI:SetActive(self.view.MonthCardBtn, false)
  69. end
  70. end)
  71. local index = 1
  72. self.UIWeekTime = SL:Schedule(self.UIWeekTime,0, 0.2, -1, function()
  73. if InfoManager.monthCardInfo:IsHaveDayTime() then
  74. ---闪烁
  75. if index <= 0.2 then
  76. index = 1
  77. end
  78. index = index - 0.15
  79. SL:SetImageAlpha(self.view.MonthCardBtn, 1, 1, 1, index)
  80. end
  81. end)]]
  82. end
  83. ---注册UI事件和服务器消息
  84. function KLUIPlayerInfoPanel:RegistEvents()
  85. SL:RegisterLUAEvent(LUA_EVENT_LEVELCHANGE, self.LUA_EVENT_LEVELCHANGE, self)--主角等级改变事件
  86. SL:RegisterLUAEvent(LUA_EVENT_EXPCHANGE, self.OnExpUpdate, self)--主角经验改变事件
  87. SL:RegisterLUAEvent(LUA_EVENT_HPCHANGE, self.RefreshPlayerHp, self)--主角血量改变事件
  88. SL:RegisterLUAEvent(LUA_EVENT_SHIELDCHANGE, self.RefreshShield, self)--主角护盾值改变事件
  89. SL:RegisterLUAEvent(LUA_EVENT_MPCHANGE, self.RefreshPlayerMp, self)--主角蓝量改变事件
  90. SL:RegisterLUAEvent(LUA_EVENT_AGSTOCHANGE, self.RefreshAgsto, self)--主角技能值改变事件
  91. SL:RegisterLUAEvent(LUA_EVENT_BUFFCHANHE, self.RefreshBuff, self)--主角buff改变事件
  92. --SL:RegisterLUAEvent(LUA_EVENT_FREEBUFFCHANHE, self.RefreshFreeBuff, self)--主角免费buff改变事件
  93. SL:RegisterLUAEvent(LUA_EVENT_PKMODE_CHANGE, self.LUA_EVENT_PKMODE_CHANGE, self)
  94. SL:RegisterLUAEvent(LUA_EVENT_SWITCH_PKMODE, self.LUA_EVENT_SWITCH_PKMODE, self)
  95. SL:RegisterLUAEvent(LUA_EVENT_CROSS_SERVER_PK_MODE, self.LUA_EVENT_CROSS_SERVER_PK_MODE, self)
  96. SL:RegisterLUAEvent(LUA_EVENT_COMBOSKILL_PROGRESS, self.LUA_EVENT_COMBOSKILL_PROGRESS, self)
  97. SL:RegisterLUAEvent(LUA_EVENT_INIT_SHORT_CUT, self.InitShortcutAfter, self)
  98. SL:RegisterLUAEvent(LUA_EVENT_SELECT_ROLE, self.SelectAttackRole, self)
  99. SL:RegisterLUAEvent(LUA_EVENT_RESET_ATTACK_ROLE, self.ResetAttackRole, self)
  100. SL:RegisterLUAEvent(LUA_EVENT_PRIVILEGE_INFO_CHANGE, self.LUA_EVENT_PRIVILEGE_INFO_CHANGE, self)
  101. SL:RegisterLUAEvent(LUA_EVENT_EXPERIENCE_ADD_CHANGE, self.LUA_EVENT_EXPERIENCE_ADD_CHANGE, self)
  102. SL:RegisterLUAEvent(LUA_EVENT_MAIN_PLAYER_DIE, self.LUA_EVENT_MAIN_PLAYER_DIE, self)
  103. SL:RegisterLUAEvent(LUA_EVENT_FastUseItem, self.LUA_EVENT_FastUseItem, self)
  104. SL:RegisterLuaNetMsg(MessageDef.ResBagChangeMessage, self.ResBagChangeMessage,self)
  105. SL:RegisterLUAEvent(Event.BagInfo_Change, self.BagInfo_Change, self)
  106. SL:RegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.LUA_EVENT_CLOSEWIN, self)
  107. GUI:AddOnClickEvent(self.view.buffMenufoldBtn, self, self.OnClickBuffMenufoldBtn)
  108. GUI:AddOnClickEvent(self.view.buffMenuexpandBtn, self, self.OnClickBuffMenuexpandBtn)
  109. GUI:AddOnClickEvent(self.view.atkModelMenuBtn, self, self.OnClickAtkModelMenuToggle)
  110. GUI:AddOnClickEvent(self.view.experienceMenufoldBtn, self, self.OnClickexperienceMenufoldBtn)
  111. GUI:AddOnClickEvent(self.view.experienceMenuexpandBtn, self, self.OnClickexperienceMenuexpandBtn)
  112. GUI:AddOnClickEvent(self.view.sliderSd, self, self.OnClickSdBtn)
  113. GUI:AddOnClickEvent(self.view.sliderShield, self, self.OnClickShieldBtn)
  114. GUI:AddOnClickEvent(self.view.experienceList, self, self.OnClickexperienceMenufoldBtn)
  115. --GUI:AddOnClickEvent(self.view.MonthCardBtn, self, self.MonthCardBtn)
  116. end
  117. --[[function KLUIPlayerInfoPanel:MonthCardBtn()
  118. local desc = "您的月卡剩余时间小于24小时,交易行交易税将\n提升至20%,是否购买增加月卡时间?"
  119. GUI:UIPanel_Open("dev/ui/Common/Panel/KLUICommonTips/KLUICommonTipsPanel", nil, nil,
  120. { showTips = desc,
  121. callback = self.btnCall, callbackData = nil, ui = self })
  122. end]]
  123. function KLUIPlayerInfoPanel:btnCall(callbackData)
  124. GUI:UIPanel_Open("dev/outui/MonthCard/Panel/KLUIMonthCardMain/KLUIMonthCardMainPanel")
  125. end
  126. function KLUIPlayerInfoPanel:RefreshFastItem()
  127. local fastItemList = SL:GetMetaValue(EMetaVarGetKey.FAST_ITEM_ID_LIST)
  128. self.fastData = table.copyFrom({},fastItemList)
  129. if not SL:HasConfig("cfg_item",self.fastData[1]) then
  130. self.fastData[1] = 30010022
  131. end
  132. if not SL:HasConfig("cfg_item",self.fastData[2]) then
  133. self.fastData[2] = 30010011
  134. end
  135. self.fastData_all_item = {}
  136. GUI:DataListInitData(self.view.fast_data_list, function()
  137. return self:FastDataListItemCountFunc()
  138. end, function(realIndex)
  139. return self:FastDataListItemGetFunc(realIndex)
  140. end, function(realIndex, kmlcontrol)
  141. return self:FastDataListItemInitFunc(realIndex, kmlcontrol)
  142. end, function(realIndex, kmlcontrol)
  143. return self:FastDataListItemUpdateFunc(realIndex, kmlcontrol)
  144. end)
  145. GUI:DataListUpdateData(self.view.fast_data_list)
  146. end
  147. --经验值变化回调
  148. function KLUIPlayerInfoPanel:OnExpUpdate()
  149. self:RefreshPlayerLevel()
  150. if self.effectTimer then
  151. SL:UnSchedule(self.effectTimer)
  152. self.effectTimer = nil
  153. end
  154. self.effectTimer = SL:ScheduleOnce(0.5, function()
  155. --local pos = self.view.sliderExperience_ballEndPos.rectTransform.position
  156. local x,y,z = GUI:GetWorldPosition(self.view.sliderExperience_ballEndPos)
  157. local effect = self:GetExpBallEffect()
  158. SL:UIEffectDoMove(effect, Vector3.New(x,y,z), 0.8, function()
  159. if not IsNil(effect.modelParent) then
  160. effect.modelParent:SetActive(false)
  161. self.expEffects:Push(effect)
  162. end
  163. end)
  164. end)
  165. end
  166. function KLUIPlayerInfoPanel:LUA_EVENT_LEVELCHANGE()
  167. self:RefreshPlayerLevel()
  168. self:RefreshExperienceAdd()
  169. end
  170. --刷新等级
  171. ---@param data RoleChangeData
  172. function KLUIPlayerInfoPanel:RefreshPlayerLevel(data)
  173. local tbl = SL:GetConfig("cfg_global", 10000, "id")
  174. local level = SL:GetMetaValue("LEVEL")
  175. if tbl and self.level ~= level and level == tonumber(tbl.value) then
  176. GUI:DataListUpdateData(self.view.fast_data_list)
  177. end
  178. self:OnClickexperienceMenufoldBtn()
  179. self:RefreshPlayerExp()
  180. end
  181. --刷新经验加成
  182. function KLUIPlayerInfoPanel:RefreshExperienceAdd()
  183. local expriencePercent = 0
  184. local freeBuffList = InfoManager.mainUIInfo.experienceAddInfoList
  185. local t = table.copyFrom({},freeBuffList)
  186. table.sort(t,function(a, b)
  187. if a.type > b.type then
  188. return true
  189. end
  190. return false
  191. end)
  192. local level = SL:GetMetaValue("LEVEL")
  193. for i, v in pairs(t) do
  194. if v.needLevel <= level then
  195. ---@type KLUIExperienceItem
  196. local exprienceTmeplate = self.experienceTemplateList[v.type]
  197. if not exprienceTmeplate then
  198. exprienceTmeplate = GUI:UIPanel_Open("dev/ui/MainUI/Item/KLUIExperience/KLUIExperienceItem", self.view.experience_list, self, v, true)
  199. self.experienceTemplateList[v.type] = exprienceTmeplate
  200. else
  201. exprienceTmeplate.args = v
  202. exprienceTmeplate:Refresh()
  203. end
  204. if v.endTime > Time.GetServerTime() or v.endTime <=0 then
  205. expriencePercent = expriencePercent + v.exp
  206. end
  207. if v.endTime > Time.GetServerTime() then
  208. self:UpdateBuff(0,v)
  209. else
  210. self:UpdateBuff(1,v)
  211. end
  212. if v.lastCfgId ~= 0 and v.lastCfgId ~= v.cfgId then
  213. self:UpdateBuff(1,{cfgId =v.lastCfgId})
  214. if InfoManager.mainUIInfo.experienceAddInfoList[v.type] then
  215. InfoManager.mainUIInfo.experienceAddInfoList[v.type].lastCfgId = 0
  216. end
  217. end
  218. end
  219. end
  220. GUI:setVisible(self.view.arrow1, #self.experienceTemplateList > 0)
  221. GUI:Text_setString(self.view.allExperienceTxt, expriencePercent .. "%")
  222. end
  223. --刷新经验条
  224. function KLUIPlayerInfoPanel:RefreshPlayerExp()
  225. ---@type MeData
  226. local level = SL:GetMetaValue("LEVEL")
  227. local name = SL:GetServerName()
  228. local exp = SL:GetMetaValue("EXP")
  229. local expandExp = SL:GetMetaValue("EXPANDEXP")
  230. local lvTbl = SL:GetConfig("cfg_level", level, "id")
  231. local precent = (exp + expandExp) / lvTbl.exp
  232. local str = string.format("%.2f", precent * 100)
  233. local percent_ = precent
  234. if precent >= 1 then
  235. str = 100.0
  236. percent_ = 1
  237. end
  238. if SL:HasConfig("cfg_level", level + 1, "id") then
  239. str = " <color=#BCB9B9>" .. str .. "%</color> "
  240. else
  241. str = " "
  242. precent = 1
  243. end
  244. precent = math.floor(precent * 100)
  245. --GUI:Text_setString(self.view.level, "等级" .. level .. str .. "<color=#FFFFFF>[" .. name .. "]</color>")
  246. GUI:Text_setString(self.view.level, "等级" .. level )
  247. GUI:SetLoadingbar_startper(self.view.sliderExperience, precent)
  248. --设置经验球飞行的终点坐标
  249. local width = SL:GetMetaValue(EMetaVarGetKey.SCREEN_WIDTH)
  250. local endX = width * percent_
  251. --local pos = self.view.sliderExperience_ballEndPos.rectTransform.anchoredPosition
  252. local pos = GUI:GetAnchoredPosition(self.view.sliderExperience_ballEndPos)
  253. pos.x = endX
  254. --self.view.sliderExperience_ballEndPos.rectTransform.anchoredPosition = pos
  255. GUI:SetAnchoredPosition(self.view.sliderExperience_ballEndPos, pos)
  256. end
  257. --刷新血条
  258. ---@param data RoleChangeData
  259. function KLUIPlayerInfoPanel:RefreshPlayerHp(data)
  260. ---@type MeData
  261. local hp = SL:GetMetaValue("HP")
  262. local maxHp = SL:GetMetaValue("MAXHP")
  263. local precent = hp / maxHp
  264. precent = math.floor(precent * 100)
  265. GUI:Text_setString(self.view.hpTxt, tostring(hp))
  266. GUI:SetLoadingbar_startper(self.view.sliderHp, precent)
  267. end
  268. --刷新蓝条
  269. ---@param data RoleChangeData
  270. function KLUIPlayerInfoPanel:RefreshPlayerMp(data)
  271. ---@type MeData
  272. local mp = SL:GetMetaValue("MP")
  273. local maxMp = SL:GetMetaValue("MAXMP")
  274. local precent = mp / maxMp
  275. precent = math.floor(precent * 100)
  276. GUI:Text_setString(self.view.mpTxt, tostring(mp))
  277. GUI:SetLoadingbar_startper(self.view.sliderMp, precent)
  278. end
  279. --刷新护盾值
  280. ---@param data RoleChangeData
  281. function KLUIPlayerInfoPanel:RefreshShield(data)
  282. ---@type MeData
  283. local shield = SL:GetMetaValue("SHIELD")
  284. local maxShield = SL:GetMetaValue("MAXSHIELD")
  285. if maxShield ~= 0 then
  286. local precent = shield / maxShield
  287. precent = math.floor(precent * 100)
  288. GUI:Text_setString(self.view.sdTxt, tostring(shield))
  289. GUI:SetLoadingbar_startper(self.view.sliderSd, precent)
  290. end
  291. GUI:setVisible(self.view.sdContainer, maxShield ~= 0)
  292. end
  293. --刷新技能值
  294. ---@param data RoleChangeData
  295. function KLUIPlayerInfoPanel:RefreshAgsto(data)
  296. ---@type MeData
  297. local agsto = SL:GetMetaValue("AGSTO")
  298. local maxAgsto = SL:GetMetaValue("MAXAGSTO")
  299. if maxAgsto ~= 0 then
  300. local precent = agsto / maxAgsto
  301. precent = math.floor(precent * 100)
  302. GUI:Text_setString(self.view.shieldTxt, tostring(agsto))
  303. GUI:SetLoadingbar_startper(self.view.sliderShield, precent)
  304. end
  305. GUI:setVisible(self.view.shieldContainer, maxAgsto ~= 0)
  306. end
  307. --刷新buff
  308. ---@param eventId number
  309. ---@param eventData BuffChangeData
  310. function KLUIPlayerInfoPanel:RefreshBuff(eventId, eventData)
  311. if not eventData then
  312. return
  313. end
  314. local rid = SL:GetMetaValue("MAIN_ACTOR_ID")
  315. if eventData.roleId and rid ~= tostring(eventData.roleId) then
  316. return
  317. end
  318. --0:Add 1:Remove 2:Update
  319. if string.isNullOrEmpty(eventData.buff.buffTbl.showIcon) then
  320. -- 图标为空不显示
  321. return
  322. end
  323. self:UpdateBuff(eventData.updateType,{cfgId = eventData.buff.cfgId,endTime = eventData.buff.endTime,buffText=eventData.buff.buffText})
  324. end
  325. function KLUIPlayerInfoPanel:UpdateBuff(updateType,data)
  326. if updateType == 0 and table.count(self.buffInfoTemplateList) < 4 then
  327. --添加
  328. self:AddOrRemoveBuff(data,true)
  329. ---@type KLBuffInfoItem
  330. local buffInfoTemplateItem = self.buffInfoTemplateList[data.cfgId]
  331. if not buffInfoTemplateItem then
  332. buffInfoTemplateItem = GUI:UIPanel_Open("dev/ui/MainUI/Item/KLBuffInfo/KLBuffInfoItem", self.view.buffs_list, self, data, true)
  333. self.buffInfoTemplateList[data.cfgId] = buffInfoTemplateItem
  334. else
  335. buffInfoTemplateItem.args = data
  336. buffInfoTemplateItem:Refresh()
  337. end
  338. elseif updateType == 1 then
  339. --移除
  340. ---@type KLBuffInfoItem
  341. local buffInfoTemplateItem = self.buffInfoTemplateList[data.cfgId]
  342. if buffInfoTemplateItem then
  343. GUI:UIPanel_Close(nil, buffInfoTemplateItem)
  344. end
  345. self.buffInfoTemplateList[data.cfgId] = nil
  346. self:AddOrRemoveBuff(data,false)
  347. --有移除的后要把原来隐藏的buff显示出来
  348. for i, v in ipairs(self.buffInfoList) do
  349. if not self.buffInfoTemplateList[v.cfgId] and table.count(self.buffInfoTemplateList) < 4 then
  350. buffInfoTemplateItem = GUI:UIPanel_Open("dev/ui/MainUI/Item/KLBuffInfo/KLBuffInfoItem", self.view.buffs_list, self, v, true)
  351. self.buffInfoTemplateList[v.cfgId] = buffInfoTemplateItem
  352. end
  353. end
  354. elseif updateType == 2 then
  355. --更新
  356. ---@type KLBuffInfoItem
  357. local buffInfoTemplateItem = self.buffInfoTemplateList[data.cfgId]
  358. if buffInfoTemplateItem then
  359. buffInfoTemplateItem.args = data
  360. buffInfoTemplateItem:Refresh()
  361. end
  362. self:AddOrRemoveBuff(data,true)
  363. end
  364. if table.count(self.buffInfoTemplateList) >= 4 then
  365. GUI:setVisible(self.view.buffMenuBtn, true)
  366. if data.cfgId ~= 0 and updateType == 0 then
  367. self:AddOrRemoveBuff(data,true)
  368. end
  369. else
  370. GUI:setVisible(self.view.buffMenuBtn, false)
  371. GUI:UIPanel_Close("dev/ui/MainUI/Panel/KLUIBuffInfoList/KLUIBuffInfoListPanel")
  372. end
  373. local panel = GUI:GetUI("dev/ui/MainUI/Panel/KLUIBuffInfoList/KLUIBuffInfoListPanel")
  374. if panel then
  375. panel.args = self.buffInfoList
  376. panel:Refresh()
  377. end
  378. end
  379. function KLUIPlayerInfoPanel:InitPKMode()
  380. local pkInfo = { 0, 1, 4, 5 }
  381. for i, pkMode in pairs(pkInfo) do
  382. local pkTemplateItem = GUI:UIPanel_Open("dev/ui/MainUI/Item/KLPk/KLPkItem", self.view.atkModelMenu, self, { pkMode = pkMode, pkName = pkName[pkMode] or "" }, true)
  383. table.insert(self.pkModeTemplateList, pkTemplateItem)
  384. end
  385. local pkMode = SL:GetMetaValue(EMetaVarGetKey.PKMODE)
  386. GUI:Button_setTitleText(self.view.atkModelname, pkName[pkMode] or "")
  387. end
  388. function KLUIPlayerInfoPanel:LUA_EVENT_PKMODE_CHANGE(_, pkMode)
  389. GUI:Button_setTitleText(self.view.atkModelname, pkName[pkMode] or "")
  390. end
  391. function KLUIPlayerInfoPanel:LUA_EVENT_SWITCH_PKMODE(_, pkMode)
  392. self.expand = not self.expand
  393. GUI:setVisible(self.view.atkModelMenu, self.expand)
  394. if GlobalLuaEventManager.isCrossServer and GlobalLuaEventManager.isCrossServer == 1 then
  395. if not SL:MeData_GetUnionId() or SL:MeData_GetUnionId() == 0 then
  396. if pkMode ~= 0 then
  397. SL:TipMessage("当前地图无法切换pk模式", 1, NoticeType.NoticeMid)
  398. return
  399. end
  400. else
  401. if pkMode ~= 5 then
  402. SL:TipMessage("当前地图无法切换pk模式", 1, NoticeType.NoticeMid)
  403. return
  404. end
  405. end
  406. end
  407. local tip = SL:GetMetaValue(EMetaVarGetKey.PKMODE_CAN_USE, pkMode)
  408. if not string.isNullOrEmpty(tip) then
  409. SL:TipMessage(tip, 1, NoticeType.NoticeMid)
  410. return
  411. end
  412. SL:SetMetaValue(EMetaVarSetKey.SET_PKMODE, pkMode)
  413. end
  414. function KLUIPlayerInfoPanel:LUA_EVENT_CROSS_SERVER_PK_MODE(_, pkMode)
  415. self.expand = false
  416. GUI:setVisible(self.view.atkModelMenu, self.expand)
  417. --SL:SetMetaValue(EMetaVarSetKey.SET_PKMODE, pkMode)
  418. end
  419. function KLUIPlayerInfoPanel:RefreshComboSkillValue()
  420. local comboSkillId = SL:GetComboSkillId()
  421. if comboSkillId and comboSkillId > 0 then
  422. --RoleManager.me.skillEngine.skillCombo:SetSkillAutoReleaseSwitch(true)
  423. SL:Skill_SetSkillAutoReleaseSwitch(true)
  424. end
  425. self:LUA_EVENT_COMBOSKILL_PROGRESS(_, 0)
  426. end
  427. function KLUIPlayerInfoPanel:RefreshTotalExpGain()
  428. SL:SendLuaNetMsg(LuaMessageIdToSever.REQ_GET_MONTH_PRIVILEGE_DATA)
  429. SL:SendLuaNetMsg(LuaMessageIdToSever.TRIPLE_INCOME_PANEL)
  430. end
  431. ---@param comboValue number -2,隐藏 -1,显示0 其他,正常显示
  432. function KLUIPlayerInfoPanel:LUA_EVENT_COMBOSKILL_PROGRESS(_, comboValue)
  433. local value, _ = math.modf(comboValue)
  434. if value >= 100 then
  435. value = 100
  436. end
  437. GUI:Text_setString(self.view.shieldTxt, tostring(value) .. "%")
  438. GUI:SetLoadingbar_startper(self.view.sliderShield, value)
  439. self.comboValue = value
  440. SL:onLUAEvent(LUA_EVENT_COMBOVALUE_CHANGE, value)
  441. end
  442. function KLUIPlayerInfoPanel:OnClickBuffMenufoldBtn()
  443. GUI:setVisible(self.view.buffMenufoldBtn, false)
  444. GUI:setVisible(self.view.buffMenuexpandBtn, true)
  445. local panel = GUI:GetUI("dev/ui/MainUI/Panel/KLUIBuffInfoList/KLUIBuffInfoListPanel")
  446. if not panel then
  447. panel = GUI:UIPanel_Open("dev/ui/MainUI/Panel/KLUIBuffInfoList/KLUIBuffInfoListPanel", nil, nil, self.buffInfoList)
  448. else
  449. panel.args = self.buffInfoList
  450. panel:Refresh()
  451. end
  452. end
  453. function KLUIPlayerInfoPanel:OnClickBuffMenuexpandBtn()
  454. GUI:setVisible(self.view.buffMenufoldBtn, true)
  455. GUI:setVisible(self.view.buffMenuexpandBtn, false)
  456. GUI:UIPanel_Close("dev/ui/MainUI/Panel/KLUIBuffInfoList/KLUIBuffInfoListPanel")
  457. end
  458. function KLUIPlayerInfoPanel:OnClickAtkModelMenuToggle()
  459. self.expand = not self.expand
  460. GUI:setVisible(self.view.atkModelMenu, self.expand)
  461. end
  462. function KLUIPlayerInfoPanel:OnClickexperienceMenufoldBtn()
  463. GUI:setVisible(self.view.experienceList, false)
  464. GUI:setVisible(self.view.experienceMenuexpandBtn, true)
  465. GUI:setVisible(self.view.experienceMenufoldBtn, false)
  466. GUI:setRotation(self.view.arrow1, 0)
  467. end
  468. function KLUIPlayerInfoPanel:OnClickexperienceMenuexpandBtn()
  469. GUI:setVisible(self.view.experienceList, true)
  470. GUI:setVisible(self.view.experienceMenuexpandBtn, false)
  471. GUI:setVisible(self.view.experienceMenufoldBtn, true)
  472. GUI:setRotation(self.view.arrow1, 180)
  473. end
  474. function KLUIPlayerInfoPanel:OnClickSdBtn()
  475. local shield = SL:GetMetaValue("SHIELD")
  476. local maxShield = SL:GetMetaValue("MAXSHIELD")
  477. local des = "SD防护值 <color=#1ADD2FFF>" .. shield .. "/" .. maxShield .. "</color>\nPVP时受到的伤害,该伤害值以SD90%,血量10%的比例损耗\n若伤害值大于SD损耗,则剩余伤害仍从血量损耗\nSD最大值受人物等级和防御力影响"
  478. GUI:UIPanel_Open("dev/ui/MainUI/Panel/KLSDTip/KLSDTipPanel", nil, nil, { content = des, y = -237, width = 395, height = 90 })
  479. end
  480. function KLUIPlayerInfoPanel:OnClickShieldBtn()
  481. --local agsto = SL:GetMetaValue("AGSTO")
  482. --local maxAgsto = SL:GetMetaValue("MAXAGSTO")
  483. if not self.comboValue then
  484. self.comboValue = 0
  485. end
  486. local des = "连击技 <color=#1ADD2FFF>" .. self.comboValue .. "</color>%\n连击技会对周围目标造成伤害,且对主目标额外造成大量伤害\n连击能量达到100%后会自动施放连击技"
  487. GUI:UIPanel_Open("dev/ui/MainUI/Panel/KLSDTip/KLSDTipPanel", nil, nil, { content = des, x = 330, y = -258, width = 390, height = 70 })
  488. end
  489. function KLUIPlayerInfoPanel:Close()
  490. if self.timer then
  491. SL:UnSchedule(self.timer)
  492. self.timer = nil
  493. end
  494. if self.effectTimer then
  495. SL:UnSchedule(self.effectTimer)
  496. self.effectTimer = nil
  497. end
  498. --[[ if self.MonthTime then
  499. SL:UnSchedule(self.MonthTime)
  500. self.MonthTime = nil
  501. end
  502. if self.UIWeekTime then
  503. SL:UnSchedule(self.UIWeekTime)
  504. self.UIWeekTime = nil
  505. end]]
  506. --SL:SetImageAlpha(self.view.MonthCardBtn, 1, 1, 1, 1)
  507. end
  508. ---清除数据
  509. function KLUIPlayerInfoPanel:Clear()
  510. ---@param exprienceTmeplate KLUIExperienceItem
  511. for i, exprienceTmeplate in pairs(self.experienceTemplateList) do
  512. GUI:UIPanel_Close(nil, exprienceTmeplate)
  513. end
  514. self.experienceTemplateList = {}
  515. ---@param buffInfoTemplateItem KLBuffInfoItem
  516. for i, buffInfoTemplateItem in pairs(self.buffInfoTemplateList) do
  517. GUI:UIPanel_Close(nil, buffInfoTemplateItem)
  518. end
  519. self.buffInfoTemplateList = {}
  520. GUI:UIPanel_Close("dev/ui/MainUI/Panel/KLUIBuffInfoList/KLUIBuffInfoListPanel")
  521. table.clear(self.buffInfoList)
  522. ---@param pkModeTemplate KLPkItem
  523. for i, pkModeTemplate in pairs(self.pkModeTemplateList) do
  524. GUI:UIPanel_Close(nil, pkModeTemplate)
  525. end
  526. self.pkModeTemplateList = {}
  527. end
  528. function KLUIPlayerInfoPanel:FastDataListItemCountFunc()
  529. --local count = #self.fastData
  530. --local maxShield = SL:GetMetaValue("MAXSHIELD")
  531. --local maxAgsto = SL:GetMetaValue("MAXAGSTO")
  532. --if maxShield == 0 or maxAgsto == 0 then
  533. -- GUI:setPositionX(self.view.left,25)
  534. -- GUI:setPositionX(self.view.right,18)
  535. --else
  536. -- count = count - 1
  537. -- GUI:setPositionX(self.view.left,36)
  538. -- GUI:setPositionX(self.view.right,-22)
  539. --end
  540. --GUI:setContentSize(self.view.fast_grid, count * 70, 64)
  541. --return count
  542. return 4
  543. end
  544. function KLUIPlayerInfoPanel:FastDataListItemGetFunc(realIndex)
  545. local data = self.fastData[realIndex + 1]
  546. local message = { cfgId = data, itemIndex = realIndex + 1 }
  547. local item = GUI:UIPanel_Open("dev/ui/MainUI/Item/KLFast_PC/KLFastItem", self.view.fast_data_list, self, message, true)
  548. self.fastData_all_item[item.view.root] = item
  549. return item.view.root
  550. end
  551. function KLUIPlayerInfoPanel:FastDataListItemInitFunc(realIndex, kmlcontrol)
  552. end
  553. function KLUIPlayerInfoPanel:FastDataListItemUpdateFunc(realIndex, kmlcontrol)
  554. local data = self.fastData[realIndex + 1]
  555. local message = { cfgId = data, itemIndex = realIndex + 1 }
  556. self.fastData_all_item[kmlcontrol]:RefreshItem(message)
  557. end
  558. function KLUIPlayerInfoPanel:InitShortcutAfter()
  559. local fastItemList = SL:GetMetaValue(EMetaVarGetKey.FAST_ITEM_ID_LIST)
  560. self.fastData = table.copyFrom({},fastItemList)
  561. if not SL:HasConfig("cfg_item",self.fastData[1]) then
  562. self.fastData[1] = 30010022
  563. end
  564. if not SL:HasConfig("cfg_item",self.fastData[2]) then
  565. self.fastData[2] = 30010011
  566. end
  567. GUI:DataListUpdateData(self.view.fast_data_list)
  568. end
  569. function KLUIPlayerInfoPanel:SelectAttackRole(_id, select_id)
  570. local is_open = false
  571. local is_player = SL:GetMetaValue(EMetaVarGetKey.ACTOR_IS_PLAYER, select_id)
  572. if is_player then
  573. is_open = true
  574. else
  575. local is_monster = SL:GetMetaValue(EMetaVarGetKey.ACTOR_IS_MONSTER, select_id)
  576. if is_monster then
  577. local role = SL:GetRoleById(select_id)
  578. local cfgId = role.data.serverData.cfgId
  579. is_open = SL:MonsterIsShowHP(cfgId)
  580. end
  581. end
  582. if InfoManager.redFortInfo.isEnter then
  583. is_open = false
  584. end
  585. if is_open then
  586. SL:OpenBossHp(select_id)
  587. else
  588. SL:CloseBossHp()
  589. end
  590. end
  591. function KLUIPlayerInfoPanel:ResetAttackRole()
  592. SL:CloseBossHp()
  593. end
  594. function KLUIPlayerInfoPanel:LUA_EVENT_PRIVILEGE_INFO_CHANGE()
  595. -----特权收益
  596. --local exp = PrivilegeCardManager.GetExperienceUp()
  597. -----三倍收益
  598. --if PrivilegeCardManager.tripleEarningsInfo then
  599. -- if PrivilegeCardManager.tripleEarningsInfo.effectSec > 0 then
  600. -- exp = (100 + exp) * 3 - 100
  601. -- end
  602. --end
  603. --GUI:Text_setString(self.view.allExperienceTxt, exp .. "%")
  604. end
  605. function KLUIPlayerInfoPanel:LUA_EVENT_EXPERIENCE_ADD_CHANGE()
  606. self:RefreshExperienceAdd()
  607. end
  608. function KLUIPlayerInfoPanel:LUA_EVENT_MAIN_PLAYER_DIE()
  609. ---@param buffInfoTemplateItem KLBuffInfoItem
  610. for i, buffInfoTemplateItem in pairs(self.buffInfoTemplateList) do
  611. GUI:UIPanel_Close(nil, buffInfoTemplateItem)
  612. end
  613. self.buffInfoTemplateList = {}
  614. GUI:UIPanel_Close("dev/ui/MainUI/Panel/KLUIBuffInfoList/KLUIBuffInfoListPanel")
  615. table.clear(self.buffInfoList)
  616. end
  617. ---@return UIModel
  618. function KLUIPlayerInfoPanel:GetExpBallEffect()
  619. local effect = self.expEffects:Pop()
  620. if next(effect) == nil then
  621. local obj = GUI:GetGameObject(self.view.root)
  622. ---@type UIModelData
  623. local t = { id = 148, tableName = "cfg_model_effect", parent = obj,
  624. selfRotate = false, resetPosition = true, pos = { 0, 0, 0 }, scale = { 100, 100, 100 } }
  625. --t.diffuseFlowing = DataManager.gmInfo.diffuseFlowing
  626. t.diffuseFlowing = SL:GmInfo_GetDiffuseFlowing()
  627. effect = SL:AddModelEffect(t)
  628. end
  629. effect.modelParent:SetActive(true)
  630. local pos = effect.modelParent.transform.anchoredPosition
  631. pos.x = 0
  632. --pos.y = -self.view.root.rectTransform.localPosition.y
  633. local _,ly,_ = GUI:GetLocalPosition(self.view.root)
  634. pos.y = -ly
  635. effect.modelParent.transform.anchoredPosition = pos
  636. return effect
  637. end
  638. ---获得药品后快捷栏自动选择
  639. function KLUIPlayerInfoPanel:ResBagChangeMessage(id, message)
  640. if not message.itemList or #message.itemList <= 0 then
  641. return
  642. end
  643. ---@type number[]
  644. local fastItems = SL:GetMetaValue(EMetaVarGetKey.FAST_ITEM_ID_LIST)
  645. local fast_list = {}
  646. local hp_pill_itemId = 0
  647. local mp_pill_itemId = 0
  648. for i, v in ipairs(message.itemList) do
  649. if v.item and v.item.cfgId and v.item.count and v.item.count > 0 then
  650. ---@type cfg_item_column
  651. local tbl1 = SL:GetConfig("cfg_item",v.item.cfgId)
  652. if tbl1.isFast and tbl1.isFast == 1 then
  653. local isInsert = true
  654. --蓝药
  655. if tbl1.type==3 and tbl1.subType==1 and tbl1.id>=30010012 and tbl1.id<=30010022 then
  656. if not SL:HasConfig("cfg_item",fastItems[1]) then
  657. mp_pill_itemId = v.item.cfgId
  658. else
  659. --local tbl2 = ConfigManager.Get_cfg_item(fastItems[1])
  660. local tbl2 = SL:GetConfig("cfg_item", fastItems[1])
  661. if tbl1.rank > tbl2.rank then
  662. mp_pill_itemId = v.item.cfgId
  663. end
  664. end
  665. isInsert = false
  666. end
  667. --血药
  668. if tbl1.type==3 and tbl1.subType==1 and tbl1.id>=30010001 and tbl1.id<=30010011 then
  669. if not SL:HasConfig("cfg_item",fastItems[2]) then
  670. hp_pill_itemId = v.item.cfgId
  671. else
  672. --local tbl2 = ConfigManager.Get_cfg_item(fastItems[2])
  673. local tbl2 = SL:GetConfig("cfg_item", fastItems[2])
  674. if tbl1.rank > tbl2.rank then
  675. hp_pill_itemId = v.item.cfgId
  676. end
  677. end
  678. isInsert = false
  679. end
  680. if isInsert then
  681. table.insert(fast_list,{cfgId=v.item.cfgId,index=v.index,id=v.item.id,isJoin = 0})
  682. end
  683. end
  684. end
  685. end
  686. if #fast_list > 0 then
  687. local current_fast_list = {}
  688. for i=1,#self.fastData,1 do
  689. table.insert(current_fast_list,{cfgId=self.fastData[i],idx=i,is_new=false})
  690. end
  691. for i=1,#current_fast_list,1 do
  692. local current_cfgId = current_fast_list[i].cfgId
  693. if current_cfgId ~= 0 then
  694. --local tbl1 = ConfigManager.Get_cfg_item(current_cfgId)
  695. local tbl1 = SL:GetConfig("cfg_item", current_cfgId)
  696. current_fast_list[i].Group = tbl1.Group
  697. current_fast_list[i].rank = tbl1.rank
  698. else
  699. current_fast_list[i].Group = 0
  700. current_fast_list[i].rank = 0
  701. end
  702. end
  703. table.sort(current_fast_list, function(a, b)
  704. if a.Group ~= b.Group then
  705. return a.Group < b.Group
  706. else
  707. return a.rank < b.rank
  708. end
  709. end)
  710. for i=1,#fast_list,1 do
  711. local current_cfgId = fast_list[i].cfgId
  712. --local tbl1 = ConfigManager.Get_cfg_item(current_cfgId)
  713. local tbl1 = SL:GetConfig("cfg_item", current_cfgId)
  714. fast_list[i].Group = tbl1.Group
  715. fast_list[i].rank = tbl1.rank
  716. end
  717. table.sort(fast_list, function(a, b)
  718. if a.Group ~= b.Group then
  719. return a.Group < b.Group
  720. else
  721. return a.rank > b.rank
  722. end
  723. end)
  724. for i=1,#current_fast_list,1 do
  725. local current_cfgId = current_fast_list[i].cfgId
  726. if current_cfgId ~= 0 then
  727. for j=1,#fast_list,1 do
  728. local data = fast_list[j]
  729. if current_cfgId == data.cfgId then
  730. fast_list[j].isJoin = 2
  731. end
  732. end
  733. end
  734. end
  735. for i=1,#current_fast_list,1 do
  736. if not current_fast_list[i].is_new then
  737. local current_cfgId = current_fast_list[i].cfgId
  738. if current_cfgId ~= 0 then
  739. for j=1,#fast_list,1 do
  740. local data = fast_list[j]
  741. if data.isJoin == 0 and current_fast_list[i].Group == data.Group then
  742. if data.rank > current_fast_list[i].rank then
  743. current_fast_list[i].cfgId = data.cfgId
  744. current_fast_list[i].is_new = true
  745. fast_list[j].isJoin = 1
  746. break
  747. end
  748. end
  749. end
  750. end
  751. end
  752. end
  753. table.sort(current_fast_list, function(a, b)
  754. return a.idx < b.idx
  755. end)
  756. for i=1,#current_fast_list,1 do
  757. if not current_fast_list[i].is_new then
  758. local current_cfgId = current_fast_list[i].cfgId
  759. if current_cfgId == 0 then
  760. for j=1,#fast_list,1 do
  761. local data = fast_list[j]
  762. if data.isJoin == 0 then
  763. current_fast_list[i].cfgId = data.cfgId
  764. current_fast_list[i].is_new = true
  765. fast_list[j].isJoin = 1
  766. break
  767. end
  768. end
  769. end
  770. end
  771. end
  772. for i=1,#current_fast_list,1 do
  773. if current_fast_list[i].is_new and current_fast_list[i].idx >2 then
  774. SL:SetMetaValue(EMetaVarGetKey.FAST_ITEM_ID_LIST, current_fast_list[i].idx, current_fast_list[i].cfgId, 0)
  775. end
  776. end
  777. end
  778. if mp_pill_itemId ~= 0 then
  779. SL:SetMetaValue(EMetaVarGetKey.FAST_ITEM_ID_LIST, 1, mp_pill_itemId, 0)
  780. end
  781. if hp_pill_itemId ~= 0 then
  782. SL:SetMetaValue(EMetaVarGetKey.FAST_ITEM_ID_LIST, 2, hp_pill_itemId, 0)
  783. end
  784. end
  785. function KLUIPlayerInfoPanel:BagInfo_Change(id,message)
  786. local hp_pill_itemId = -1
  787. local mp_pill_itemId = -1
  788. local itemList_ = SL:GetIsFastItemList()
  789. ---@type number[]
  790. local fastItems = SL:GetMetaValue(EMetaVarGetKey.FAST_ITEM_ID_LIST)
  791. for i, item in pairs(itemList_) do
  792. ---@type cfg_item_column
  793. local tbl1 = SL:GetConfig("cfg_item",item.cfgId)
  794. --蓝药
  795. if tbl1.type==3 and tbl1.subType==1 and tbl1.id>=30010012 and tbl1.id<=30010022 then
  796. local cfgId = fastItems[1]
  797. if mp_pill_itemId ~= -1 then
  798. cfgId = mp_pill_itemId
  799. end
  800. local ownerCount = SL:GetBagItemCount(cfgId)
  801. if not SL:HasConfig("cfg_item",fastItems[1]) or ownerCount <=0 then
  802. mp_pill_itemId = item.cfgId
  803. else
  804. --local tbl2 = ConfigManager.Get_cfg_item(cfgId)
  805. local tbl2 = SL:GetConfig("cfg_item", cfgId)
  806. if tbl1.rank > tbl2.rank then
  807. mp_pill_itemId = item.cfgId
  808. end
  809. end
  810. end
  811. --血药
  812. if tbl1.type==3 and tbl1.subType==1 and tbl1.id>=30010001 and tbl1.id<=30010011 then
  813. local cfgId = fastItems[1]
  814. if hp_pill_itemId ~= -1 then
  815. cfgId = hp_pill_itemId
  816. end
  817. local ownerCount = SL:GetBagItemCount(cfgId)
  818. if not SL:HasConfig("cfg_item",cfgId) or ownerCount <=0 then
  819. hp_pill_itemId = item.cfgId
  820. else
  821. --local tbl2 = ConfigManager.Get_cfg_item(cfgId)
  822. local tbl2 = SL:GetConfig("cfg_item", cfgId)
  823. if tbl1.rank > tbl2.rank then
  824. hp_pill_itemId = item.cfgId
  825. end
  826. end
  827. end
  828. end
  829. local ownerCount = SL:GetBagItemCount(fastItems[1])
  830. mp_pill_itemId = (mp_pill_itemId == -1 and ownerCount <= 0) and 0 or mp_pill_itemId
  831. if mp_pill_itemId ~= -1 and fastItems[1] ~= mp_pill_itemId then
  832. SL:SetMetaValue(EMetaVarGetKey.FAST_ITEM_ID_LIST, 1, mp_pill_itemId, 0)
  833. end
  834. ownerCount = SL:GetBagItemCount(fastItems[2])
  835. hp_pill_itemId = (hp_pill_itemId == -1 and ownerCount <= 0) and 0 or hp_pill_itemId
  836. if hp_pill_itemId ~= -1 and fastItems[2] ~= hp_pill_itemId then
  837. SL:SetMetaValue(EMetaVarGetKey.FAST_ITEM_ID_LIST, 2, hp_pill_itemId, 0)
  838. end
  839. SL:onLUAEvent(LUA_EVENT_FASTITEM_CHANGE)
  840. end
  841. function KLUIPlayerInfoPanel:LUA_EVENT_CLOSEWIN(id,panelName)
  842. if panelName == "KLUIBuffInfoListPanel" then
  843. self:OnClickBuffMenuexpandBtn()
  844. end
  845. end
  846. function KLUIPlayerInfoPanel:AddOrRemoveBuff(data,isAdd)
  847. local isContains = false
  848. local pos
  849. for i, v in pairs(self.buffInfoList) do
  850. if v.cfgId == data.cfgId then
  851. isContains = true
  852. pos = i
  853. end
  854. end
  855. if isContains and pos and not isAdd then
  856. table.remove(self.buffInfoList,pos)
  857. end
  858. if isAdd then
  859. if isContains then
  860. self.buffInfoList[pos] = data
  861. else
  862. table.insert(self.buffInfoList,data)
  863. end
  864. end
  865. end
  866. ---快捷使用道具
  867. ---@param message {key:number}
  868. function KLUIPlayerInfoPanel:LUA_EVENT_FastUseItem(_,message)
  869. if not table.isNullOrEmpty(message) then
  870. for i, v in pairs(self.fastData_all_item) do
  871. if v.args and v.args.itemIndex==message.key then
  872. v:BtnUseClick()
  873. return
  874. end
  875. end
  876. end
  877. end
  878. return KLUIPlayerInfoPanel