KLUIEquipTipsPanel.lua 92 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285
  1. ---@class KLUIEquipTipsPanel:UIKmlLuaPanelBase
  2. ---@field view KLUIEquipTipsPanelView
  3. local KLUIEquipTipsPanel = class(UIKmlLuaPanelBase)
  4. local this = KLUIEquipTipsPanel
  5. ---创建时调用一次
  6. function this:Init()
  7. self.otherArchange = nil
  8. if self.args.info and self.args.info.hideMask then
  9. GUI:setVisible(self.view.background_close, false)
  10. else
  11. GUI:setVisible(self.view.background_close, true)
  12. end
  13. if self.args.info and self.args.info.isRight then
  14. GUI:setAnchorPoint(self.view.root, 2, 0)
  15. end
  16. if self.args.info and self.args.info.posX then
  17. GUI:setPositionX(self.view.root, self.args.info.posX)
  18. end
  19. GUI:DataListInitData(self.view.equipzhiyeNeedData, function()
  20. return self:NeedCareerDataListItemCountFunc()
  21. end, function(realIndex)
  22. return self:NeedCareerDataListItemGetFunc(realIndex)
  23. end, function(realIndex, kmlcontrol)
  24. return self:NeedCareerDataListItemInitFunc(realIndex, kmlcontrol)
  25. end, function(realIndex, kmlcontrol)
  26. return self:NeedCareerDataListItemUpdateFunc(realIndex, kmlcontrol)
  27. end)
  28. GUI:DataListInitData(self.view.equipNeedData, function()
  29. return self:NeedDataListItemCountFunc()
  30. end, function(realIndex)
  31. return self:NeedDataListItemGetFunc(realIndex)
  32. end, function(realIndex, kmlcontrol)
  33. return self:NeedDataListItemInitFunc(realIndex, kmlcontrol)
  34. end, function(realIndex, kmlcontrol)
  35. return self:NeedDataListItemUpdateFunc(realIndex, kmlcontrol)
  36. end)
  37. GUI:DataListInitData(self.view.all_info_data, function()
  38. return self:EquipAttrDataListItemCountFunc()
  39. end, function(realIndex)
  40. return self:EquipAttrDataListItemGetFunc(realIndex)
  41. end, function(realIndex, kmlcontrol)
  42. return self:EquipAttrDataListItemInitFunc(realIndex, kmlcontrol)
  43. end, function(realIndex, kmlcontrol)
  44. return self:EquipAttrDataListItemUpdateFunc(realIndex, kmlcontrol)
  45. end)
  46. self.firstCharge_list = { 28810531, 28820531, 28830531 }
  47. self.gemOtherPlayerId = nil
  48. end
  49. ---界面显示时调用一次
  50. function this:Show()
  51. if SL:GetConfig("cfg_item", self.args.cfgId, "id").wearBarID[1] == EEquipWearBarType.Archange and self.args.info and self.args.info.otherRid and self.args.id then
  52. --SL:SendLuaNetMsg(LuaMessageIdToSever.REQ_OTHER_ANGE_EQUIP_INFO, { rid = self.args.info.otherRid, itemId = self.args.id })
  53. ---@type KLUIRankListPanel
  54. local ui = GUI:GetUI("dev/outui/UIRankList/Panel/KLUIRankList/KLUIRankListPanel")
  55. if ui then
  56. self.otherArchange = ui:GetOtherAngelEquipInfo(self.args.id)
  57. self:Refresh()
  58. end
  59. end
  60. end
  61. ---创建或者刷新界面数据时调用
  62. function this:Refresh()
  63. self.archenge = {}
  64. local itemInfo = SL:GetPosItemInfo(self.args.equip_pos, self.args.cfgId, self.args.id)
  65. local name = SL:GetEquipValue(EMetaVarGetKey.EQUIP_NAME, self.args.equip_pos, self.args.cfgId, self.args.id)
  66. self.type = SL:GetMetaValue(EMetaVarGetKey.ITEMTYPE, self.args.cfgId)
  67. self.subType = SL:GetMetaValue(EMetaVarGetKey.ITEMSUBTYPE, self.args.cfgId)
  68. if self.type == 2 and self.subType == 16 then
  69. --坐骑
  70. GUI:UIPanel_Open('dev/outui/Mount/Panel/KLMountTip/KLMountTipPanel', nil, nil, self.args)
  71. return
  72. end
  73. local twoHanded = SL:GetEquipValue(EMetaVarGetKey.EQUIP_TWO_HANDED, self.args.equip_pos, self.args.cfgId, self.args.id)
  74. local two_handed = ""
  75. if self.subType and self.subType <= 3 then
  76. if twoHanded and twoHanded == 1 then
  77. two_handed = "双手武器"
  78. else
  79. two_handed = "单手武器"
  80. end
  81. end
  82. local equip_status = ""
  83. local isDeal = 0
  84. --local isDeal = SL:GetMetaValue(EMetaVarGetKey.ITEM_IS_DEAL, self.args.cfgId)
  85. if itemInfo then
  86. if itemInfo.bind then
  87. isDeal = 2
  88. else
  89. isDeal = 1
  90. end
  91. else
  92. local lockItem = SL:GetConfig("cfg_item", self.args.cfgId).lockItem
  93. if lockItem[1] then
  94. isDeal = lockItem[1]
  95. end
  96. end
  97. if itemInfo then
  98. if isDeal == 1 then
  99. local strengthen = EquipFunc.GetEquipStrengthLevel(itemInfo)
  100. if strengthen > 0 then
  101. isDeal = 2
  102. end
  103. end
  104. if isDeal == 1 then
  105. local appLevel = EquipFunc.GetEquipAppendLevel(itemInfo)
  106. if appLevel > 0 then
  107. isDeal = 2
  108. end
  109. end
  110. if isDeal == 1 then
  111. local regenerateToAttr = SL:GetEquipValue(EMetaVarGetKey.EQUIP_REGENERATE_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
  112. if regenerateToAttr and table.count(regenerateToAttr) > 0 then
  113. isDeal = 2
  114. end
  115. end
  116. end
  117. if isDeal == 1 then
  118. equip_status = "可交易"
  119. elseif isDeal == 2 then
  120. equip_status = "<color=#ff2323>不可交易</color>"
  121. end
  122. if self.args.equip_pos == "equip" then
  123. equip_status = equip_status .. "[已装备]"
  124. end
  125. ---描述设置空
  126. GUI:Text_setString(self.view.TipsText, "")
  127. GUI:SetActive(self.view.TipsText, false)
  128. --模型高度
  129. local modelHeight = 0
  130. --底部文字存在的情况下增加的高度
  131. local bottomDescHeight = 0
  132. --变身戒指or守护皮肤
  133. if self.type == 6 and (self.subType == 14 or self.subType == 13) then
  134. GUI:UIPanel_Close("dev/ui/Tips/Panel/KLIUItemTips/KLUIItemTipsPanel")
  135. modelHeight = 180
  136. end
  137. --生成一下模型
  138. if modelHeight > 0 then
  139. GUI:setVisible(self.view.model1, true)
  140. --模型路径
  141. local modelPath = ""
  142. ---@type cfg_item_column
  143. local itemTbl = SL:GetConfig("cfg_item", self.args.cfgId, "id")
  144. --设置底部文字
  145. if itemTbl.bottomdesc ~= "" then
  146. GUI:SetActive(self.view.TipsText, true)
  147. GUI:Text_setString(self.view.TipsText, itemTbl.bottomdesc)
  148. GUI:setPositionY(self.view.TipsTextScrollview, 70)
  149. bottomDescHeight = 50
  150. end
  151. local modelScale = 30
  152. if self.type == 6 then
  153. if self.subType == 14 then
  154. --变身戒指
  155. ---@type cfg_model_monster_column
  156. local model_tbl = SL:GetConfig("cfg_model_monster", tonumber(itemTbl.useParam), "id")
  157. modelPath = model_tbl.path
  158. --空的话说明已使用
  159. if equip_status == "" then
  160. equip_status = "<color=#ff2323>不可交易</color>"
  161. if itemTbl.bottomdesc ~= "" then
  162. --无按钮的情况下并且底部文字有的情况下增加一些高度
  163. bottomDescHeight = 100
  164. end
  165. modelHeight = (modelHeight + bottomDescHeight) / 2
  166. GUI:setPositionY(self.view.TipsTextScrollview, 15)
  167. end
  168. --幻化了的话说明已装备
  169. local CurMonsterId = InfoManager.appearInfo.GetCurMonsterId()
  170. if CurMonsterId == model_tbl.id then
  171. equip_status = equip_status .. "[已装备]"
  172. end
  173. elseif self.subType == 13 then
  174. --守护皮肤
  175. ---@type cfg_model_charactor_column
  176. local model_tbl = SL:GetConfig("cfg_model_charactor", tonumber(itemTbl.field[1]), "id")
  177. modelPath = model_tbl.path
  178. modelScale = 50
  179. if SL:HasConfig("cfg_fashion",self.args.cfgId) then
  180. modelScale = SL:GetConfig("cfg_fashion",self.args.cfgId).tipsScale
  181. end
  182. end
  183. end
  184. --模型数据
  185. local modelData = {
  186. mscale = modelScale..","..modelScale..","..modelScale,
  187. mrotate = "0,150,0",
  188. x = "0",
  189. y = "0",
  190. z = "-1000",
  191. a = "00",
  192. src = modelPath,
  193. }
  194. if not self.cur_model then
  195. --生成模型
  196. self.cur_model = GUI:Model_Create(self.view.model1, modelData)
  197. else
  198. GUI:Item_UpdataData(self.cur_model, modelData)
  199. end
  200. end
  201. local top_num = 0
  202. local grade = SL:GetEquipValue(EMetaVarGetKey.EQUIP_GRADE, self.args.equip_pos, self.args.cfgId, self.args.id)
  203. local name_color = SL:GetConfig("cfg_item", self.args.cfgId).color
  204. local rank = SL:GetEquipValue(EMetaVarGetKey.EQUIP_RANK, self.args.equip_pos, self.args.cfgId, self.args.id)
  205. local useLevelLimit = SL:GetEquipValue(EMetaVarGetKey.EQUIP_USE_LEVEL_LIMIT, self.args.equip_pos, self.args.cfgId, self.args.id)
  206. GUI:Text_setTextColor(self.view.equip_name, tostring(name_color))
  207. GUI:Item_setItemId(self.view.equip_tips_item, self.args.cfgId)
  208. self:SetLiuGuang(itemInfo)
  209. local shape = SL:GetConfig("cfg_item", self.args.cfgId).shape[1]
  210. local rotation = SL:GetConfig("cfg_model_charactor", shape).rotateAxis
  211. local rotation_str = rotation .. ",50,0"
  212. self.Schedule1 = SL:ScheduleOnce(0.2, function()
  213. if self.view then
  214. GUI:Item_Rotate(self.view.equip_tips_item, rotation_str)
  215. end
  216. end)
  217. GUI:Text_setString(self.view.equip_status, equip_status)
  218. if string.isNullOrEmpty(two_handed) then
  219. GUI:setVisible(self.view.equip_type_titlt, false)
  220. else
  221. GUI:setVisible(self.view.equip_type_titlt, true)
  222. GUI:Text_setString(self.view.equip_type, two_handed)
  223. end
  224. -- 大天使装备的阶数需要特殊处理
  225. if SL:GetConfig("cfg_item", self.args.cfgId, "id").wearBarID[1] == EEquipWearBarType.Archange then
  226. if not self.args.id or not InfoManager.archangeEquipInfo:IsHaveArchangeEquip(self.args.id) then
  227. if self.args.id and self.otherArchange then
  228. local rankStr = tostring(self.otherArchange.rank) .. "阶"
  229. GUI:Text_setString(self.view.equip_jie, rankStr)
  230. GUI:setVisible(self.view.equip_jie_root, true)
  231. top_num = top_num + 1
  232. else
  233. local rankStr = tostring(InfoManager.archangeEquipInfo:GetMaxRank(self.args.cfgId)) .. "阶"
  234. GUI:Text_setString(self.view.equip_jie, rankStr)
  235. GUI:setVisible(self.view.equip_jie_root, true)
  236. top_num = top_num + 1
  237. end
  238. else
  239. local archangeRank = InfoManager.archangeEquipInfo:GetEquipLevelInfo(self.args.id).rank
  240. local rankStr = tostring(archangeRank) .. "阶"
  241. GUI:Text_setString(self.view.equip_jie, rankStr)
  242. GUI:setVisible(self.view.equip_jie_root, true)
  243. top_num = top_num + 1
  244. end
  245. else
  246. if rank and rank ~= 0 then
  247. local rankStr = SL:NumberToChinese(rank)
  248. rankStr = rankStr .. "阶"
  249. GUI:Text_setString(self.view.equip_jie, rankStr)
  250. GUI:setVisible(self.view.equip_jie_root, true)
  251. top_num = top_num + 1
  252. else
  253. GUI:setVisible(self.view.equip_jie_root, false)
  254. end
  255. end
  256. if not string.isNullOrEmpty(useLevelLimit) then
  257. self.level_is_can_use = false
  258. local level = SL:GetMetaValue(EMetaVarGetKey.LEVEL)
  259. local level_color = "#A52822"
  260. local level_str = ""
  261. if string.contains(useLevelLimit, "#") then
  262. local levelLimit = SL:Split(useLevelLimit, "#")
  263. if tonumber(levelLimit[1]) <= level and tonumber(levelLimit[2]) >= level then
  264. self.level_is_can_use = true
  265. end
  266. level_str = levelLimit[1] .. "~" .. levelLimit[2]
  267. else
  268. if tonumber(useLevelLimit) <= level then
  269. self.level_is_can_use = true
  270. end
  271. level_str = useLevelLimit
  272. end
  273. if self.level_is_can_use then
  274. level_color = "#C9C9C9"
  275. end
  276. if level_str ~= "0" then
  277. GUI:setVisible(self.view.equip_need_level_titlt, true)
  278. GUI:Text_setString(self.view.equip_need_level, level_str)
  279. GUI:Text_setTextColor(self.view.equip_need_level, level_color)
  280. top_num = top_num + 1
  281. else
  282. GUI:setVisible(self.view.equip_need_level, false)
  283. end
  284. end
  285. local job = SL:GetEquipValue(EMetaVarGetKey.EQUIP_NEED_CAREER, self.args.equip_pos, self.args.cfgId, self.args.id)
  286. self.need_career = self:GetCareer(job)
  287. local useAttLimit = SL:GetEquipValue(EMetaVarGetKey.EQUIP_WEAR_LIMIT, self.args.equip_pos, self.args.cfgId, self.args.id)
  288. self.useAttLimit_list = self:GetUseAttLimit(useAttLimit)
  289. local useAttLv = SL:GetConfig("cfg_equip_entryLib", self.args.cfgId).useAttLv
  290. if not useAttLv or useAttLv == 0 then
  291. GUI:setVisible(self.view.att_level_titlt, false)
  292. else
  293. top_num = top_num + 1
  294. GUI:setVisible(self.view.att_level_titlt, true)
  295. GUI:setVisible(self.view.att_need_level, true)
  296. GUI:Text_setString(self.view.att_need_level, tostring(useAttLv))
  297. local level = SL:GetMetaValue(EMetaVarGetKey.LEVEL)
  298. if level >= useAttLv then
  299. GUI:Text_setTextColor(self.view.att_level_titlt, "#C9C9C9")
  300. GUI:Text_setTextColor(self.view.att_need_level, "#C9C9C9")
  301. else
  302. GUI:Text_setTextColor(self.view.att_level_titlt, "#A52822")
  303. GUI:Text_setTextColor(self.view.att_need_level, "#A52822")
  304. end
  305. end
  306. ----属性需要排序
  307. local baseAttr = SL:GetEquipValue(EMetaVarGetKey.EQUIP_BASE_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
  308. local baseAttr = self:GetBaseAttr(baseAttr)
  309. local strengthen = 0
  310. local strengthenAttrList = {}
  311. if itemInfo then
  312. strengthen = EquipFunc.GetEquipStrengthLevel(itemInfo)
  313. if strengthen > 0 then
  314. strengthenAttrList = EquipFunc.GetEquipStrengthAttr(itemInfo)
  315. end
  316. end
  317. local strengthenAttr = {}
  318. if table.count(strengthenAttrList) > 0 then
  319. for i, v in ipairs(strengthenAttrList) do
  320. table.insert(strengthenAttr, { type = v[1], num = v[2] })
  321. end
  322. end
  323. if strengthen and strengthen > 0 then
  324. name = name .. " +" .. strengthen
  325. end
  326. GUI:Text_setString(self.view.equip_name, name)
  327. --local appendAttr = SL:GetEquipValue(EMetaVarGetKey.EQUIP_APPEND_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
  328. local appendAttr = {}
  329. local appendAttrList = {}
  330. if itemInfo then
  331. local appLevel = EquipFunc.GetEquipAppendLevel(itemInfo)
  332. if appLevel > 0 then
  333. appendAttrList = EquipFunc.GetEquipAppendAttr(itemInfo)
  334. if appendAttrList and table.count(appendAttrList) > 0 then
  335. for i, v in ipairs(appendAttrList) do
  336. table.insert(appendAttr, { type = v[1], num = v[2] })
  337. end
  338. end
  339. end
  340. end
  341. local originMagicAttrs = SL:GetEquipValue(EMetaVarGetKey.EQUIP_MAGIC_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
  342. --local skillGemIds = SL:GetEquipValue(EMetaVarGetKey.EQUIP_SKILL_ATTR,self.args.equip_pos,self.args.cfgId,self.args.id)
  343. local gemSkills = SL:GetEquipSkills(itemInfo)
  344. local luckAttrs = SL:GetEquipValue(EMetaVarGetKey.EQUIP_LUCK_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
  345. self.all_info = {}
  346. self.IsHaveStrengthen = false ---是否有强化属性
  347. self.all_att_sort_list = {}
  348. if table.count(baseAttr) > 0 then
  349. table.insert(self.all_att_sort_list, { attr_type = 1, data = baseAttr })
  350. end
  351. if strengthenAttr and table.count(strengthenAttr) > 0 then
  352. local Attr = self:GetBaseAttr(strengthenAttr)
  353. for i, v in ipairs(Attr) do
  354. v.name = "强化" .. v.name
  355. self.IsHaveStrengthen = true
  356. end
  357. if #Attr > 0 then
  358. table.insert(self.all_att_sort_list, { attr_type = 2, data = Attr })
  359. end
  360. end
  361. if appendAttr and table.count(appendAttr) > 0 then
  362. local Attr = self:GetBaseAttr(appendAttr)
  363. for i, v in ipairs(Attr) do
  364. v.name = "追加" .. v.name
  365. end
  366. table.insert(self.all_att_sort_list, { attr_type = 3, data = Attr })
  367. end
  368. if originMagicAttrs and table.count(originMagicAttrs) > 0 then
  369. local magicAttr = self:GetBaseAttr(originMagicAttrs)
  370. for i, v in ipairs(magicAttr) do
  371. table.insert(self.all_info, v)
  372. end
  373. end
  374. if gemSkills and table.count(gemSkills) > 0 then
  375. table.insert(self.all_info, { name = "装备技能", value = "" })
  376. for i, v in ipairs(gemSkills) do
  377. local skill_id = v.skillId
  378. local skill_name = SL:GetConfig("cfg_skill", skill_id).name
  379. ---@type cfg_skill_info_column
  380. local skill_info_tbl = SL:GetConfig("cfg_skill_info", skill_id, "skillID")
  381. table.insert(self.all_info, { name = string.format("%s(魔力:%s)", skill_name, skill_info_tbl.costMp), value = "" })
  382. end
  383. end
  384. if luckAttrs and table.count(luckAttrs) > 0 then
  385. table.insert(self.all_info, { title = "tips_attribute12" })
  386. local Attr = self:GetBaseAttr(luckAttrs)
  387. for i, v in ipairs(Attr) do
  388. v.color = "#50C2FD"
  389. table.insert(self.all_info, v)
  390. end
  391. end
  392. local entryAttr = SL:GetEquipValue(EMetaVarGetKey.EQUIP_ENTRY_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
  393. if entryAttr and table.count(entryAttr) > 0 then
  394. local Attr = self:GetBaseAttr(entryAttr)
  395. for i, v in ipairs(Attr) do
  396. if v.value and not string.isNullOrEmpty(v.value) then
  397. v.name = v.name .. "+" .. v.value
  398. v.value = ""
  399. end
  400. end
  401. table.insert(self.all_att_sort_list, { attr_type = 4, data = Attr })
  402. else
  403. --首充装备特殊处理
  404. if self.args.info and self.args.info.firstCharge and table.contains(self.firstCharge_list, self.args.cfgId) then
  405. local zhuo_att = SL:GetConfig("cfg_equip_entryLib", self.args.cfgId).att1
  406. local zhuo_yue_group = zhuo_att[1][1]
  407. local zhuo_att_list = SL:FindConfigs("cfg_equip_att", "group", zhuo_yue_group)
  408. local first_entryAttr = {}
  409. for ii, one_data in ipairs(zhuo_att_list) do
  410. local att_list = one_data.att[1]
  411. table.insert(first_entryAttr, { type = att_list[1], num = att_list[2] })
  412. end
  413. if first_entryAttr and table.count(first_entryAttr) > 0 then
  414. table.insert(self.all_info, { title = "tips_attribute3" })
  415. local Attr = self:GetBaseAttr(first_entryAttr)
  416. for i, v in ipairs(Attr) do
  417. if v.value and not string.isNullOrEmpty(v.value) then
  418. v.name = v.name .. "+" .. v.value
  419. v.value = ""
  420. end
  421. end
  422. table.insert(self.all_att_sort_list, { attr_type = 4, data = Attr })
  423. end
  424. end
  425. end
  426. local regenerateToAttr = SL:GetEquipValue(EMetaVarGetKey.EQUIP_REGENERATE_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
  427. if regenerateToAttr and table.count(regenerateToAttr) > 0 then
  428. local Attr = self:GetBaseAttr(regenerateToAttr)
  429. table.insert(self.all_att_sort_list, { attr_type = 7, data = Attr })
  430. end
  431. -- 大天使装备处理
  432. if SL:GetConfig("cfg_item", self.args.cfgId, "id").wearBarID[1] == EEquipWearBarType.Archange then
  433. local datianshi_att_list = {}
  434. table.insert(datianshi_att_list, { name = "攻击野外怪物即可获得经验值", value = "", color = "#e6e600", color_not_change = true })
  435. local levelInfo
  436. if self.args.id then
  437. levelInfo = InfoManager.archangeEquipInfo:GetEquipLevelInfo(self.args.id)
  438. if not levelInfo then
  439. levelInfo = self.otherArchange
  440. end
  441. end
  442. if levelInfo then
  443. -- 有信息的装备
  444. --local levelInfo = InfoManager.archangeEquipInfo:GetEquipLevelInfo(self.args.id)
  445. local arcLevel = levelInfo.level
  446. local exp = levelInfo.exp
  447. local _, maxLevel = InfoManager.archangeEquipInfo:GetMaxAtt(self.args.cfgId)
  448. local curRank = levelInfo.rank
  449. local curMaxLevel = InfoManager.archangeEquipInfo:GetMaxLevel(curRank, self.args.cfgId)
  450. ---该装备所在的组
  451. local group = SL:GetConfig("cfg_equip_angelGroup", self.args.cfgId, "id").angelEquipGroup
  452. ---@type cfg_equip_angelAtt_column
  453. local attTbl = SL:GetConfigTwoKeys("cfg_equip_angelAtt", group, arcLevel, "ornamentsGroup", "lv")
  454. local basicAtt = attTbl.basicAtt
  455. local levelinfo = tostring(exp) .. "/" .. tostring(attTbl.lvDeplete)
  456. self.archenge["maxExp"] = attTbl.lvDeplete
  457. self.archenge["isMaxLv"] = false
  458. table.insert(datianshi_att_list, { name = "当前阶数等级上限", value = tostring(curMaxLevel), color = "#e6e600", color_not_change = true })
  459. -- archenge类型仅为大天使装备的特殊处理,若使用进度条,请使用loadingbar类型,如:{loadingbar = { name = "lv." .. tostring(arcLevel), value = (exp / attTbl.lvDeplete) * 100, valueInfo = levelinfo }}
  460. if arcLevel == maxLevel then
  461. self.archenge["isMaxLv"] = true
  462. --该装备是否满级
  463. table.insert(datianshi_att_list, { name = "装备已成长至满级", value = "", color = "#1add1f", color_not_change = true })
  464. levelinfo = "已满级"
  465. table.insert(datianshi_att_list, { archenge = { name = "<color='#1add1f'>Lv." .. tostring(arcLevel) .. "</color>", value = 100, valueInfo = levelinfo, color_not_change = true } })
  466. else
  467. table.insert(datianshi_att_list, { archenge = { name = "<color='#1add1f'>Lv." .. tostring(arcLevel) .. "</color>", value = (exp / attTbl.lvDeplete) * 100, valueInfo = levelinfo, color_not_change = true } })
  468. end
  469. local maxAtt = nil
  470. local minAtt = nil
  471. for i, v in pairs(basicAtt) do
  472. if v[1] == 200011 then
  473. minAtt = v[2]
  474. elseif v[1] == 200021 then
  475. maxAtt = v[2]
  476. else
  477. table.insert(datianshi_att_list, { name = SL:GetConfig("cfg_att_info", v[1], "id").name, value = "+" .. tostring(v[2]), color = "#dce1e5" })
  478. end
  479. end
  480. if minAtt and maxAtt then
  481. table.insert(datianshi_att_list, { name = "攻击力", value = tostring(minAtt) .. "~" .. tostring(maxAtt), color = "#dce1e5" })
  482. end
  483. if arcLevel ~= maxLevel then
  484. table.insert(datianshi_att_list, { name = "<size=18>Lv." .. tostring(arcLevel + 1) .. "</size>", value = "<size=18>下一级效果</size>", color = "#ff2323", color_not_change = true })
  485. --不满级展示下一级
  486. arcLevel = arcLevel + 1
  487. ---该装备所在的组
  488. group = SL:GetConfig("cfg_equip_angelGroup", self.args.cfgId, "id").angelEquipGroup
  489. basicAtt = SL:GetConfigTwoKeys("cfg_equip_angelAtt", group, arcLevel, "ornamentsGroup", "lv").basicAtt
  490. maxAtt = nil
  491. minAtt = nil
  492. for i, v in pairs(basicAtt) do
  493. if v[1] == 200011 then
  494. minAtt = v[2]
  495. elseif v[1] == 200021 then
  496. maxAtt = v[2]
  497. else
  498. table.insert(datianshi_att_list, { name = SL:GetConfig("cfg_att_info", v[1], "id").name, value = "+" .. tostring(v[2]),color_not_change=true, color = "#999999" })
  499. end
  500. end
  501. if minAtt and maxAtt then
  502. table.insert(datianshi_att_list, { name = "攻击力", value = tostring(minAtt) .. "~" .. tostring(maxAtt), color = "#999999",color_not_change=true })
  503. end
  504. end
  505. else
  506. -- 无任何信息
  507. table.insert(datianshi_att_list, { name = "满级属性", value = "", color = "#1add1f", color_not_change = true })
  508. local attList, _ = InfoManager.archangeEquipInfo:GetMaxAtt(self.args.cfgId)
  509. local maxAtt = nil
  510. local minAtt = nil
  511. for i, v in pairs(attList) do
  512. if v[1] == 200011 then
  513. minAtt = v[2]
  514. elseif v[1] == 200021 then
  515. maxAtt = v[2]
  516. else
  517. table.insert(datianshi_att_list, { name = SL:GetConfig("cfg_att_info", v[1], "id").name, value = "+" .. tostring(v[2]), color = "#dce1e5" })
  518. end
  519. end
  520. if minAtt and maxAtt then
  521. table.insert(datianshi_att_list, { name = "攻击力", value = tostring(minAtt) .. "~" .. tostring(maxAtt), color = "#dce1e5" })
  522. end
  523. end
  524. if table.count(datianshi_att_list) > 0 then
  525. table.insert(self.all_att_sort_list, { attr_type = 8, data = datianshi_att_list })
  526. end
  527. end
  528. local equipInfoList, suitEffect = SL:GetSuitEquipInfoList(self.args.cfgId)
  529. local color1 = "#e6e600"
  530. local color2 = "#999999"
  531. if equipInfoList and suitEffect then
  532. local all_suit = {}
  533. local suitIdList = SL:GetMetaValue(EMetaVarGetKey.GET_EQUIPSUIT_BY_ID, self.args.cfgId)
  534. local suitId = suitIdList[1]
  535. local suitName = SL:GetConfig("cfg_equip_suit", suitId).name
  536. local activeNUm = SL:GetSuitActiveCount(suitId)
  537. local allNUm = #equipInfoList
  538. suitName = suitName .. "(" .. activeNUm .. "/" .. allNUm .. ")"
  539. table.insert(all_suit, { name = suitName, value = "", color = "#D5811E", color_not_change = true })
  540. for i, v in ipairs(equipInfoList) do
  541. local _name = SL:GetConfig("cfg_item", v.cfgId).name
  542. local oneInfo = { name = _name, value = "" }
  543. if v.isActive then
  544. oneInfo.color = color1
  545. else
  546. oneInfo.color = color2
  547. oneInfo.color_not_change = true
  548. end
  549. table.insert(all_suit, oneInfo)
  550. end
  551. table.insert(all_suit, { name = "套装效果", value = "", color = "#D5811E", color_not_change = true })
  552. local Attr = self:GetAttr(suitEffect)
  553. for i, v in ipairs(Attr) do
  554. if v.isActive then
  555. v.color = color1
  556. else
  557. v.color = color2
  558. v.color_not_change = true
  559. end
  560. table.insert(all_suit, v)
  561. end
  562. table.insert(self.all_att_sort_list, { attr_type = 6, data = all_suit })
  563. end
  564. if itemInfo then
  565. local regenerateLevel = EquipFunc.GetEquipRegenerateLevel(itemInfo)
  566. if regenerateLevel > 0 then
  567. local regenerateAttr = EquipFunc.GetEquipRegenerateAttr(itemInfo)
  568. if regenerateAttr and table.count(regenerateAttr) > 0 then
  569. local Attr = self:GetBaseAttr(regenerateAttr)
  570. table.insert(self.all_att_sort_list, { attr_type = 7, data = Attr })
  571. end
  572. end
  573. end
  574. ---如果是首饰 特殊处理(能升级的首饰
  575. if SL:HasConfig('cfg_equip_ornamentsMain', self.args.cfgId) then
  576. local ornament_tbl = SL:GetConfig('cfg_equip_ornamentsMain', self.args.cfgId)
  577. if ornament_tbl then
  578. self:SetJewelryTips()
  579. end
  580. end
  581. ---大天使装备镶嵌的圣杯处理
  582. local archangeGrailInfo = InfoManager.archangeEquipInfo:GetEquipGrail(self.args.id)
  583. if self.otherArchange then
  584. archangeGrailInfo = self.otherArchange.grails
  585. end
  586. local shengbei = {}
  587. if self.args.id and not table.isNullOrEmpty(archangeGrailInfo) then
  588. local archangeGrailInfoSort = {}
  589. for i, v in pairs(archangeGrailInfo) do
  590. table.insert(archangeGrailInfoSort, { id = i, info = v })
  591. end
  592. table.sort(archangeGrailInfoSort, function(grailA, grailB)
  593. return grailA.info.grailPosition < grailB.info.grailPosition
  594. end)
  595. for i, v in pairs(archangeGrailInfoSort) do
  596. name = SL:GetConfig("cfg_item", v.info.itemConfigId, "id").name
  597. local strengthLv = 0
  598. if self.otherArchange then
  599. strengthLv = v.info.level
  600. else
  601. strengthLv = InfoManager.archangeEquipInfo:GetGrailStrengthLv(tonumber(v.id))
  602. end
  603. if strengthLv > 0 then
  604. name = name .. "+" .. tostring(strengthLv)
  605. end
  606. local color = E_ArchangelGrailQualityColor[SL:GetConfig("cfg_equip_angelGrail", v.info.itemConfigId, "id").grailQuality]
  607. table.insert(shengbei, { itemInfo = { itemId = v.info.itemConfigId, name = name, color = color } })
  608. end
  609. end
  610. if #shengbei > 0 then
  611. table.insert(self.all_att_sort_list, { attr_type = 9, data = shengbei })
  612. end
  613. self:GetGemAtt()
  614. --SL:LogTable(self.all_gem_att,true)
  615. if self.all_gem_att and #self.all_gem_att > 0 then
  616. local gem_att = self:GetBaseAttr(self.all_gem_att)
  617. table.insert(self.all_att_sort_list, { attr_type = 5, data = gem_att })
  618. end
  619. ----注意-----新加属性放到这里,然后在下面排序----------------------cfg_equip_tips----------------------------------
  620. ----拿到所有属性后进行排序
  621. table.sort(self.all_att_sort_list, function(a, b)
  622. local sort_a = SL:GetConfig("cfg_equip_tips", a.attr_type).sort
  623. local sort_b = SL:GetConfig("cfg_equip_tips", b.attr_type).sort
  624. return sort_a < sort_b
  625. end)
  626. ----排序后添加标题和设置颜色
  627. for i, one_data in ipairs(self.all_att_sort_list) do
  628. if table.count(one_data.data) > 0 then
  629. local one_tab = SL:GetConfig("cfg_equip_tips", one_data.attr_type)
  630. if one_tab.show and one_tab.show == 1 then
  631. local bg_str
  632. if not string.isNullOrEmpty(one_tab.bg) then
  633. bg_str = one_tab.bg
  634. end
  635. if not string.isNullOrEmpty(one_tab.picture) then
  636. table.insert(self.all_info, { is_title = true, title = one_tab.picture, bg = bg_str })
  637. elseif not string.isNullOrEmpty(one_tab.text) then
  638. local text_color = tostring(one_tab.textColor)
  639. table.insert(self.all_info, { is_title = true, name = one_tab.text, value = "", color = text_color, bg = bg_str })
  640. end
  641. for j, v in ipairs(one_data.data) do
  642. --设置属性颜色
  643. if not v.color_not_change then
  644. v.color = tostring(one_tab.attColor)
  645. if one_tab.attNameColor and not string.isNullOrEmpty(v.name) then
  646. local color_1 = SL:GetConfig("cfg_color",one_tab.attNameColor).color
  647. v.name = "<color=" .. color_1 .. ">" .. v.name .. "</color>"
  648. end
  649. end
  650. v.bg = one_tab.attBg
  651. table.insert(self.all_info, v)
  652. end
  653. end
  654. end
  655. end
  656. local bottomDesc = SL:GetMetaValue(EMetaVarGetKey.ITEM_BOTTOM_DESC, self.args.cfgId)
  657. if not string.isNullOrEmpty(bottomDesc) and modelHeight == 0 then
  658. table.insert(self.all_info, { name = "", value = "" })
  659. GUI:Text_setString(self.view.tem_info, bottomDesc)
  660. local x_1, y_1 = GUI:getSizeDelta(self.view.tem_info)
  661. table.insert(self.all_info, { info = bottomDesc, value = "", height = y_1 })
  662. end
  663. local tab_item = SL:GetConfig("cfg_item", self.args.cfgId, "id")
  664. local recoveryGroup = tab_item.recoveryGroup
  665. if recoveryGroup ~= 0 then
  666. local recoveryUp = tab_item.recoveryUp / 100
  667. local material = SL:GetConfig("cfg_recovery", recoveryGroup, "id").material
  668. if material then
  669. local materialList = material[1]
  670. local name1 = SL:GetConfig("cfg_item", materialList[1], "id").name
  671. local value1 = materialList[2] * (1 + recoveryUp)
  672. value1 = Mathf.Floor(value1)
  673. table.insert(self.all_info, { name = "回收价格:", value = value1 .. name1, color = "#756952" })
  674. end
  675. end
  676. top_num = top_num + #self.need_career + #self.useAttLimit_list
  677. if top_num < 4 then
  678. top_num = 4
  679. end
  680. local top_add = (top_num - 4) * 23
  681. --local middle_height = #self.all_info * 25
  682. local middle_height = 0
  683. for i, v in ipairs(self.all_info) do
  684. if v.is_title then
  685. middle_height = middle_height + 31
  686. elseif v.height then
  687. middle_height = middle_height + v.height
  688. else
  689. middle_height = middle_height + 22
  690. end
  691. end
  692. if middle_height < 100 then
  693. middle_height = 100
  694. end
  695. if middle_height > 205 then
  696. middle_height = 205
  697. end
  698. local all_add_height = top_add + middle_height
  699. local max_h = 355
  700. if all_add_height > max_h then
  701. middle_height = middle_height - (all_add_height - max_h)
  702. end
  703. local change_y = (max_h - middle_height) / 2
  704. change_y = Mathf.Floor(change_y)
  705. local top_y = 227 - change_y + top_add + (modelHeight / 2)
  706. local bottomDescHeightEnd = bottomDescHeight
  707. if bottomDescHeightEnd > 0 then
  708. bottomDescHeightEnd = bottomDescHeightEnd - 10--底部有文字情况下调整一下按钮和文字的间隙
  709. end
  710. local bottom_y = change_y - 275 - (modelHeight / 2) - (bottomDescHeightEnd / 2)
  711. local bg_height = middle_height + 295 + top_add + modelHeight
  712. local bg_y = Mathf.Floor(top_add / 2)
  713. GUI:setContentSize(self.view.info_view, 360, middle_height)
  714. GUI:setPositionY(self.view.equippaneltop, top_y)
  715. GUI:setPositionY(self.view.equippaneltop_bottom, bottom_y)
  716. GUI:setContentSize(self.view.panel_bg, 370, bg_height)
  717. GUI:setPositionY(self.view.panel_bg, bg_y)
  718. if modelHeight > 0 then
  719. --有模型的情况下调整一下属性栏位置
  720. local info_view_Y = GUI:getPositionY(self.view.info_view)
  721. GUI:setPositionY(self.view.info_view, info_view_Y + (modelHeight / 2))
  722. end
  723. --模型初始位置
  724. GUI:setPositionY(self.view.model1, -190)
  725. --守护处理
  726. if self.type == E_ItemType.Equip and self.subType == E_ItemSubType_Equip.ShouHu then
  727. local specialShowData = InfoManager.guardPetInfo:GetGuardSpecialShowData(self.args.cfgId)
  728. table.concatTable(self.all_info, specialShowData)
  729. local maxHp = SL:GetConfig("cfg_equip_guard", self.args.cfgId).hp
  730. local hp = InfoManager.guardPetInfo:GetGuardHp(self.args.id)
  731. GUI:Text_setTextColor(self.view.guardHp, "#ff8a00")
  732. hp = (hp == 0 and maxHp or hp)
  733. if maxHp == 0 then
  734. GUI:Text_setString(self.view.guardHp, "生命值:无限")
  735. else
  736. if hp then
  737. GUI:Text_setString(self.view.guardHp, string.format("生命值:%d/%d", hp, maxHp))
  738. end
  739. end
  740. GUI:setVisible(self.view.guardHp, true)
  741. GUI:setVisible(self.view.duanzaobtn, false)
  742. else
  743. GUI:setVisible(self.view.duanzaobtn, true)
  744. GUI:setVisible(self.view.guardHp, false)
  745. end
  746. if self.args.info and self.args.info.hideBtn then
  747. GUI:setVisible(self.view.bag_root, false)
  748. GUI:setVisible(self.view.equip_root, false)
  749. elseif self.args.equip_pos == "bag" or GUI:GetUI("dev/outui/Equip/Panel/KLEquipOverlay/KLEquipOverlayPanel") then
  750. GUI:setVisible(self.view.bag_root, true)
  751. GUI:setVisible(self.view.equip_root, false)
  752. self:bagBtnUpdate()
  753. elseif self.args.equip_pos == "depots" then
  754. GUI:setVisible(self.view.bag_root, true)
  755. GUI:setVisible(self.view.equip_root, false)
  756. self:depotsBtnUpdate()
  757. elseif self.args.equip_pos == "equip" then
  758. GUI:setVisible(self.view.equip_root, true)
  759. GUI:setVisible(self.view.bag_root, false)
  760. local wearBarId = SL:GetEquipValue(EMetaVarGetKey.EQUIP_WEAR_BAR_ID, nil, self.args.cfgId)
  761. if wearBarId[1] and wearBarId[1] > 2 then
  762. GUI:setVisible(self.view.duanzaobtn, false)
  763. elseif self.subType == 14 then
  764. GUI:setVisible(self.view.duanzaobtn, false)
  765. else
  766. GUI:setVisible(self.view.duanzaobtn, true)
  767. end
  768. if self.subType == 10 or self.subType == 11 or self.subType == 12 then
  769. GUI:setVisible(self.view.tuoxiabtn, false)
  770. GUI:setVisible(self.view.shengjibtn, true)
  771. else
  772. GUI:setVisible(self.view.tuoxiabtn, true)
  773. GUI:setVisible(self.view.shengjibtn, false)
  774. end
  775. if SL:GetConfig("cfg_item", self.args.cfgId, "id").wearBarID[1] == EEquipWearBarType.Archange then
  776. GUI:setVisible(self.view.breakbtn, true)
  777. else
  778. GUI:setVisible(self.view.breakbtn, false)
  779. end
  780. elseif self.args.equip_pos == "synthesis" then
  781. GUI:setVisible(self.view.left_btn, true)
  782. GUI:setVisible(self.view.right_btn, true)
  783. GUI:setVisible(self.view.equip_root, false)
  784. GUI:Button_setTitleText(self.view.left_btn, "取消")
  785. GUI:Button_setTitleText(self.view.right_btn, "替换")
  786. else
  787. GUI:setVisible(self.view.equip_root, false)
  788. GUI:setVisible(self.view.bag_root, false)
  789. --没有下方二个按钮的模型位置(equip_pos不是bag)
  790. GUI:setPositionY(self.view.model1, -220)
  791. end
  792. GUI:DataListUpdateData(self.view.equipzhiyeNeedData)
  793. GUI:DataListUpdateData(self.view.equipNeedData)
  794. GUI:DataListUpdateData(self.view.all_info_data)
  795. --if #self.left_all >0 then
  796. --GUI:DataListUpdateData(self.view.left_data_list)
  797. --end
  798. --if #self.right_all >0 then
  799. -- GUI:DataListUpdateData(self.view.right_data_list)
  800. --end
  801. if self.args.equip_pos ~= "equip" and not (self.args.info and self.args.info.hideComparsion) then
  802. local Comparsion_data = SL:GetCompareEquip(self.args.cfgId)
  803. if Comparsion_data and Comparsion_data.cfgId and Comparsion_data.id then
  804. --SL:OpenEquipTipsComparsion(Comparsion_data.cfgId, Comparsion_data.id)
  805. GUI:UIPanel_Open("dev/ui/Tips/Panel/KLUIEquipTipsComparsion/KLUIEquipTipsComparsionPanel", nil, nil, { equip_pos = "equip", cfgId = Comparsion_data.cfgId, id = Comparsion_data.id, last_height = bg_height })
  806. end
  807. end
  808. EquipFunc.tipsHeight = bg_height
  809. local bg_str = ""
  810. local item_bg_str = ""
  811. local bg_effect_id = 0
  812. local item_effect_id = 0
  813. if tab_item.itemTips and tab_item.itemTips ~= 0 then
  814. local style_tab = SL:GetConfig("cfg_tips_style",tab_item.itemTips)
  815. if not string.isNullOrEmpty(style_tab.background) then
  816. bg_str = style_tab.background
  817. end
  818. if not string.isNullOrEmpty(style_tab.itemBg) then
  819. item_bg_str = style_tab.itemBg
  820. end
  821. bg_effect_id = style_tab.borderEffect
  822. item_effect_id = style_tab.itemBorderEffect
  823. end
  824. if string.isNullOrEmpty(bg_str) then
  825. GUI:Image_loadTexture(self.view.panel_bg, "img_interface_main122", "Atlas/Common.spriteatlas")
  826. else
  827. GUI:Image_loadTexture(self.view.panel_bg, bg_str, "Atlas/UITips.spriteatlas")
  828. end
  829. --GUI:Image_loadTexture(self.view.panel_bg, bg_str, "Atlas/Common.spriteatlas")
  830. if string.isNullOrEmpty(item_bg_str) then
  831. GUI:setVisible(self.view.item_bg, false)
  832. else
  833. GUI:setVisible(self.view.item_bg, true)
  834. GUI:Image_loadTexture(self.view.item_bg, item_bg_str, "Atlas/UITips.spriteatlas")
  835. end
  836. if bg_effect_id and bg_effect_id ~= 0 then
  837. local effect_tbl = SL:GetConfig("cfg_model_effect",bg_effect_id)
  838. local m_y = 370/523 * bg_height
  839. m_y = math.floor( m_y )
  840. local mscale = "240,"..m_y..",1"
  841. GUI:Model_setSrc(self.view.bg_effect_model,effect_tbl.path,mscale)
  842. GUI:setVisible(self.view.bg_effect_model, true)
  843. else
  844. GUI:setVisible(self.view.bg_effect_model, false)
  845. end
  846. if item_effect_id and item_effect_id ~= 0 then
  847. local effect_tbl = SL:GetConfig("cfg_model_effect",bg_effect_id)
  848. GUI:Model_setSrc(self.view.item_effect_model,effect_tbl.path)
  849. GUI:setVisible(self.view.item_effect_model, true)
  850. else
  851. GUI:setVisible(self.view.item_effect_model, false)
  852. end
  853. end
  854. ---注册UI事件和服务器消息
  855. function this:RegistEvents()
  856. GUI:AddOnClickEvent(self.view.background_close, self, self.CloseEquipTips)
  857. GUI:AddOnClickEvent(self.view.left_btn, self, self.BtnLeftOnClick)
  858. GUI:AddOnClickEvent(self.view.right_btn, self, self.BtnRightOnClick)
  859. GUI:AddOnClickEvent(self.view.tuoxiabtn, self, self.TakeOffEquip)
  860. GUI:AddOnClickEvent(self.view.shengjibtn, self, self.ShengJi)
  861. GUI:AddOnClickEvent(self.view.duanzaobtn, self, self.ForgeOnClick)
  862. GUI:AddOnClickEvent(self.view.breakbtn, self, self.BreakOnClick)
  863. SL:RegisterLuaNetMsg(LuaMessageIdToClient.RES_ANGEL_EQUIPMENT_ATTR_INFO, self.RES_ANGEL_EQUIPMENT_ATTR_INFO, self) -- 大天使装备需要等一个回调
  864. SL:RegisterLUAEvent(LUA_EVENT_REFRESH_GEM_SLATE_INFO, self.LUA_EVENT_REFRESH_GEM_SLATE_INFO, self)
  865. end
  866. function this:CloseEquipTips()
  867. GUI:UIPanel_Close("dev/ui/Tips/Panel/KLUIEquipTips/KLUIEquipTipsPanel")
  868. GUI:UIPanel_Close("dev/ui/Tips/Panel/KLUIEquipTipsComparsion/KLUIEquipTipsComparsionPanel")
  869. local itemGetPathPanel = GUI:GetUI("dev/ui/Common/Panel/KLItemGetPath/KLItemGetPathPanel")
  870. if itemGetPathPanel then
  871. GUI:UIPanel_Close("dev/ui/Common/Panel/KLItemGetPath/KLItemGetPathPanel")
  872. end
  873. end
  874. function this:Close()
  875. if self.Schedule1 then
  876. SL:UnSchedule(self.Schedule1)
  877. end
  878. end
  879. function this:SetLiuGuang(equipInfo)
  880. local liuGuangId = nil
  881. if equipInfo then
  882. liuGuangId = EquipFunc.GetEquipLiuGuangId(equipInfo)
  883. end
  884. if liuGuangId then
  885. GUI:SetStreamAttr(self.view.equip_tips_item, liuGuangId)
  886. else
  887. GUI:ResetStreamAttr(self.view.equip_tips_item)
  888. end
  889. end
  890. function this:GetCareer(job)
  891. local all_career = {}
  892. if job and table.count(job) > 0 then
  893. local i = 1
  894. while i <= table.count(job) do
  895. local str = ""
  896. local t_str = ""
  897. if i == 1 then
  898. t_str = "需要职业:"
  899. end
  900. local baseCareer = job[i][1]
  901. local careerLevel = job[i][2]
  902. local tbl = SL:GetConfigMultiKeys('cfg_career',
  903. baseCareer,
  904. careerLevel,
  905. 'baseCareer',
  906. 'careerRank'
  907. )
  908. if baseCareer == SL:MeData_GetCareer().baseCareer and SL:MeData_GetCareer().careerRank >= careerLevel then
  909. str = str .. "<color=#C9C9C9>" .. tbl.name .. "</color>"
  910. else
  911. str = str .. "<color=#A52822>" .. tbl.name .. "</color>"
  912. end
  913. if string.len(tbl.name) >= 15 then
  914. table.insert(all_career, { title = t_str, name = str })
  915. i = i + 1
  916. else
  917. if job[i + 1] then
  918. local baseCareer2 = job[i + 1][1]
  919. local careerLevel2 = job[i + 1][2]
  920. local tbl2 = SL:GetConfigMultiKeys('cfg_career',
  921. baseCareer2,
  922. careerLevel2,
  923. 'baseCareer',
  924. 'careerRank'
  925. )
  926. if baseCareer2 == SL:MeData_GetCareer().baseCareer and SL:MeData_GetCareer().careerRank >= careerLevel2 then
  927. str = str .. "<color=#C9C9C9> " .. tbl2.name .. "</color>"
  928. else
  929. str = str .. "<color=#A52822> " .. tbl2.name .. "</color>"
  930. end
  931. end
  932. table.insert(all_career, { title = t_str, name = str })
  933. i = i + 2
  934. end
  935. end
  936. end
  937. return all_career
  938. end
  939. function this:NeedCareerDataListItemCountFunc()
  940. return #self.need_career
  941. end
  942. function this:NeedCareerDataListItemGetFunc(realIndex)
  943. end
  944. function this:NeedCareerDataListItemInitFunc(realIndex, kmlcontrol)
  945. end
  946. function this:NeedCareerDataListItemUpdateFunc(realIndex, kmlcontrol)
  947. local career = self.need_career[realIndex + 1]
  948. local title = GUI:GetChildControl(self.view.equipzhiyeNeedData, realIndex, "title")
  949. GUI:Text_setString(title, career.title)
  950. local name = GUI:GetChildControl(self.view.equipzhiyeNeedData, realIndex, "name")
  951. GUI:Text_setString(name, career.name)
  952. end
  953. function this:GetUseAttLimit(useAttLimit)
  954. local useAttLimit_list = {}
  955. self.useAttLimit = {}
  956. if useAttLimit and table.count(useAttLimit) > 0 then
  957. for i, v in ipairs(useAttLimit) do
  958. local attId = v[1]
  959. local attValue = v[2]
  960. local my_attValue = SL:MeData_GetSpecialAttrValue(attId)
  961. local name = SL:GetConfig("cfg_att_info", attId).name
  962. local name_str = "所需" .. name .. ":"
  963. local value_str = ""
  964. local entryAttr = SL:GetEquipValue(EMetaVarGetKey.EQUIP_ENTRY_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
  965. local offsetValue = self:GetAttrValueOffset(attId, attValue, entryAttr)
  966. self.useAttLimit[attId] = -offsetValue
  967. attValue = attValue - offsetValue
  968. if my_attValue >= attValue then
  969. value_str = tostring(attValue)
  970. else
  971. local add_value = attValue - my_attValue
  972. name_str = "<color=#A52822>" .. name_str .. "</color>"
  973. value_str = "<color=#A52822>" .. attValue .. "(还需" .. add_value .. ")" .. "</color>"
  974. end
  975. if attValue ~= 0 then
  976. table.insert(useAttLimit_list, { name = name_str, value = value_str })
  977. end
  978. end
  979. end
  980. return useAttLimit_list
  981. end
  982. function this:NeedDataListItemCountFunc()
  983. return #self.useAttLimit_list
  984. end
  985. function this:NeedDataListItemGetFunc(realIndex)
  986. end
  987. function this:NeedDataListItemInitFunc(realIndex, kmlcontrol)
  988. end
  989. function this:NeedDataListItemUpdateFunc(realIndex, kmlcontrol)
  990. local data = self.useAttLimit_list[realIndex + 1]
  991. local name = GUI:GetChildControl(self.view.equipNeedData, realIndex, "name")
  992. GUI:Text_setString(name, data.name)
  993. local value = GUI:GetChildControl(self.view.equipNeedData, realIndex, "value")
  994. GUI:Text_setString(value, data.value)
  995. end
  996. function this:GetBaseAttr(baseAttr)
  997. local baseAttrList = {}
  998. if not baseAttr then
  999. return baseAttrList
  1000. end
  1001. local max1
  1002. local min1
  1003. local max2
  1004. local min2
  1005. local max3
  1006. local min3
  1007. local max4
  1008. local min4
  1009. local max5
  1010. local min5
  1011. for i, v in ipairs(baseAttr) do
  1012. if v.type == 201011 then
  1013. max1 = v
  1014. elseif v.type == 201021 then
  1015. min1 = v
  1016. elseif v.type == 202011 then
  1017. max2 = v
  1018. elseif v.type == 202021 then
  1019. min2 = v
  1020. elseif v.type == 205021 then
  1021. max3 = v
  1022. elseif v.type == 205011 then
  1023. min3 = v
  1024. elseif v.type == 203021 then
  1025. max4 = v
  1026. elseif v.type == 203011 then
  1027. min4 = v
  1028. elseif v.type == 200011 then
  1029. min5 = v
  1030. elseif v.type == 200021 then
  1031. max5 = v
  1032. end
  1033. end
  1034. if max1 and min1 then
  1035. local _value = min1.num .. "~" .. max1.num
  1036. table.insert(baseAttrList, { name = "攻击力", value = _value })
  1037. end
  1038. if max2 and min2 then
  1039. local _value = min2.num .. "~" .. max2.num
  1040. table.insert(baseAttrList, { name = "魔法攻击力", value = _value })
  1041. end
  1042. if max3 and min3 then
  1043. local _value = min3.num .. "~" .. max3.num
  1044. table.insert(baseAttrList, { name = "诅咒攻击力", value = _value })
  1045. end
  1046. if max4 and min4 then
  1047. local _value = min4.num .. "~" .. max4.num
  1048. table.insert(baseAttrList, { name = "天鹰攻击力", value = _value })
  1049. end
  1050. if max5 and min5 then
  1051. local _value = min5.num .. "~" .. max5.num
  1052. table.insert(baseAttrList, { name = "攻击力", value = _value })
  1053. end
  1054. for i, v in ipairs(baseAttr) do
  1055. if v.type == 201011 or v.type == 201021 or v.type == 202011 or v.type == 202021 or v.type == 205021 or v.type == 205011 or v.type == 203021 or v.type == 203011 or v.type == 200011 or v.type == 200021 then
  1056. else
  1057. local _name = SL:GetConfig("cfg_att_info", v.type).name
  1058. local _value = self:GetAttrValue(v.type, v.num)
  1059. if self:chenckAttrShow(v.type) then
  1060. if not self:chenckAttrValue(v.type) then
  1061. _value = ""
  1062. end
  1063. table.insert(baseAttrList, { name = _name, value = _value, type = v.type })
  1064. end
  1065. end
  1066. end
  1067. return baseAttrList
  1068. end
  1069. function this:GetAttr(baseAttr)
  1070. local baseAttrList = {}
  1071. if not baseAttr then
  1072. return baseAttrList
  1073. end
  1074. for i, one in pairs(baseAttr) do
  1075. for j, v in ipairs(one) do
  1076. local nameAttr = SL:GetConfig("cfg_att_info", v.attId).name
  1077. local _value = self:GetAttrValue(v.attId, v.attNum)
  1078. if self:chenckAttrShow(v.attId) then
  1079. _value = nameAttr .. "+" .. _value
  1080. if not self:chenckAttrValue(v.attId) then
  1081. _value = nameAttr
  1082. end
  1083. local _name = i .. "件套效果"
  1084. table.insert(baseAttrList, { name = _name, value = _value, isActive = v.isActive })
  1085. end
  1086. end
  1087. end
  1088. return baseAttrList
  1089. end
  1090. function this:chenckAttrShow(attId)
  1091. return true
  1092. end
  1093. function this:chenckAttrValue(attId)
  1094. local attShow = SL:GetConfig("cfg_att_info", attId).attShow
  1095. if attShow == 1 then
  1096. return true
  1097. end
  1098. return false
  1099. end
  1100. function this:GetAttrValue(attId, attValue)
  1101. local remarks = SL:GetConfig("cfg_att_info", attId).remarks
  1102. if remarks == 1 then
  1103. return tostring(attValue)
  1104. else
  1105. local value = attValue / 100
  1106. local value_str = value .. "%"
  1107. return value_str
  1108. end
  1109. end
  1110. function this:EquipAttrDataListItemCountFunc()
  1111. return #self.all_info
  1112. end
  1113. function this:EquipAttrDataListItemGetFunc(realIndex)
  1114. end
  1115. function this:EquipAttrDataListItemInitFunc(realIndex, kmlcontrol)
  1116. end
  1117. function this:EquipAttrDataListItemUpdateFunc(realIndex, kmlcontrol)
  1118. local data = self.all_info[realIndex + 1]
  1119. local root = GUI:GetChildControl(self.view.all_info_data, realIndex, "root")
  1120. local title = GUI:GetChildControl(self.view.all_info_data, realIndex, "title")
  1121. local di = GUI:GetChildControl(self.view.all_info_data, realIndex, "di")
  1122. local value = GUI:GetChildControl(self.view.all_info_data, realIndex, "value")
  1123. local desc = GUI:GetChildControl(self.view.all_info_data, realIndex, "desc")
  1124. local more_info = GUI:GetChildControl(self.view.all_info_data, realIndex, "more_info")
  1125. local loading_name = GUI:GetChildControl(self.view.all_info_data, realIndex, "loading_name")
  1126. local info_loadingbar = GUI:GetChildControl(self.view.all_info_data, realIndex, "info_loadingbar")
  1127. local loadingbar_text = GUI:GetChildControl(self.view.all_info_data, realIndex, "loadingbar_text")
  1128. local item = GUI:GetChildControl(self.view.all_info_data, realIndex, "item")
  1129. local itemname = GUI:GetChildControl(self.view.all_info_data, realIndex, "itemname")
  1130. if data.bg and not string.isNullOrEmpty(data.bg) then
  1131. GUI:Image_loadTexture(di, data.bg, "Atlas/UIEquipInfoPanel.spriteatlas")
  1132. else
  1133. GUI:Image_loadTexture(di, "img_tips_shuxing_di", "Atlas/UIEquipInfoPanel.spriteatlas")
  1134. end
  1135. if data.is_title then
  1136. GUI:setContentSize(root, 350, 25)
  1137. GUI:setVisible(item, false)
  1138. GUI:setVisible(itemname, false)
  1139. GUI:setVisible(di, true)
  1140. GUI:setVisible(desc, false)
  1141. GUI:setVisible(more_info, false)
  1142. GUI:setVisible(info_loadingbar, false)
  1143. GUI:setVisible(loading_name, false)
  1144. if not string.isNullOrEmpty(data.title) then
  1145. GUI:setVisible(title, true)
  1146. GUI:Image_loadTexture(title, data.title, "Atlas/TipsAttTitle.spriteatlas")
  1147. GUI:setVisible(value, false)
  1148. else
  1149. GUI:setVisible(title, false)
  1150. GUI:setVisible(value, true)
  1151. local _name = nil
  1152. if not string.isNullOrEmpty(data.name) then
  1153. _name = data.name
  1154. else
  1155. _name = ""
  1156. end
  1157. local _value = nil
  1158. if not string.isNullOrEmpty(data.value) then
  1159. _value = data.value
  1160. else
  1161. _value = ""
  1162. end
  1163. local value_str = _name .. " " .. _value
  1164. GUI:Text_setString(value, value_str)
  1165. if data.color then
  1166. GUI:Text_setTextColor(value, data.color)
  1167. end
  1168. end
  1169. elseif data.info then
  1170. GUI:setContentSize(root, 350, data.height)
  1171. GUI:setVisible(title, false)
  1172. GUI:setVisible(item, false)
  1173. GUI:setVisible(itemname, false)
  1174. GUI:setVisible(di, false)
  1175. GUI:setVisible(value, false)
  1176. GUI:setVisible(more_info, true)
  1177. GUI:setVisible(info_loadingbar, false)
  1178. GUI:setVisible(loading_name, false)
  1179. GUI:Text_setString(more_info, data.info)
  1180. elseif data.loadingbar then
  1181. GUI:setContentSize(root, 350, 25)
  1182. GUI:setVisible(title, false)
  1183. GUI:setVisible(item, false)
  1184. GUI:setVisible(itemname, false)
  1185. GUI:setVisible(di, false)
  1186. GUI:setVisible(value, false)
  1187. GUI:setVisible(more_info, false)
  1188. GUI:setVisible(info_loadingbar, true)
  1189. GUI:setVisible(loading_name, true)
  1190. GUI:Text_setString(loading_name, data.loadingbar.name) -- 进度条前方文字
  1191. GUI:Text_setString(loadingbar_text, data.loadingbar.valueInfo) -- 进度条上方文字
  1192. GUI:SetLoadingbar_startper(info_loadingbar, data.loadingbar.value) -- 百分制
  1193. elseif data.archenge then
  1194. -- 大天使装备的特殊处理,已保证只执行一次!!!
  1195. GUI:setContentSize(root, 350, 25)
  1196. GUI:setVisible(title, false)
  1197. GUI:setVisible(item, false)
  1198. GUI:setVisible(itemname, false)
  1199. GUI:setVisible(di, false)
  1200. GUI:setVisible(value, false)
  1201. GUI:setVisible(more_info, false)
  1202. GUI:setVisible(info_loadingbar, true)
  1203. GUI:setVisible(loading_name, true)
  1204. self.archenge.loadingbar = info_loadingbar
  1205. self.archenge.valueInfo = loadingbar_text
  1206. self.archenge.loading_name = loading_name
  1207. GUI:Text_setString(loading_name, data.archenge.name) -- 进度条前方文字
  1208. GUI:Text_setString(loadingbar_text, data.archenge.valueInfo) -- 进度条上方文字
  1209. GUI:SetLoadingbar_startper(info_loadingbar, data.archenge.value) -- 百分制
  1210. --此协议为大天使装备的特殊处理,已保证只发送一次
  1211. if (not self.args.info or not self.args.info.otherRid) and not self.archenge.isMaxLv then
  1212. SL:SendLuaNetMsg(LuaMessageIdToSever.REQ_ANGEL_EQUIP_ATTR, { itemId = self.args.id, itemConfigId = self.args.cfgId })
  1213. end
  1214. elseif data.itemInfo then
  1215. GUI:setVisible(title, false)
  1216. GUI:setVisible(item, true)
  1217. GUI:setVisible(itemname, true)
  1218. GUI:setVisible(di, false)
  1219. GUI:setVisible(value, false)
  1220. GUI:setVisible(more_info, false)
  1221. GUI:setVisible(info_loadingbar, false)
  1222. GUI:setVisible(loading_name, false)
  1223. GUI:Item_setItemId(item, data.itemInfo.itemId)
  1224. GUI:Text_setTextColor(itemname, data.itemInfo.color)
  1225. GUI:Text_setString(itemname, data.itemInfo.name)
  1226. else
  1227. GUI:setContentSize(root, 350, 16)
  1228. GUI:setVisible(title, false)
  1229. GUI:setVisible(value, true)
  1230. GUI:setVisible(item, false)
  1231. GUI:setVisible(itemname, false)
  1232. GUI:setVisible(more_info, false)
  1233. GUI:setVisible(info_loadingbar, false)
  1234. GUI:setVisible(loading_name, false)
  1235. if string.isNullOrEmpty(data.bg) then
  1236. GUI:setVisible(di, false)
  1237. else
  1238. GUI:setVisible(di, true)
  1239. end
  1240. local _name = nil
  1241. if not string.isNullOrEmpty(data.name) then
  1242. _name = data.name
  1243. else
  1244. _name = ""
  1245. end
  1246. local _value = nil
  1247. if not string.isNullOrEmpty(data.value) then
  1248. _value = data.value
  1249. else
  1250. _value = ""
  1251. end
  1252. local value_str = _name .. " " .. _value
  1253. GUI:Text_setString(value, value_str)
  1254. if data.color then
  1255. GUI:Text_setTextColor(value, data.color)
  1256. end
  1257. if data.desc then
  1258. GUI:setVisible(desc, true)
  1259. GUI:Text_setString(desc, data.desc)
  1260. end
  1261. if data.descColor then
  1262. GUI:Text_setTextColor(desc, data.descColor)
  1263. end
  1264. end
  1265. end
  1266. function this:depotsBtnUpdate()
  1267. GUI:setVisible(self.view.left_btn, true)
  1268. GUI:Button_setTitleText(self.view.left_btn, "丢弃")
  1269. GUI:setVisible(self.view.right_btn, true)
  1270. GUI:Button_setTitleText(self.view.right_btn, "取出")
  1271. end
  1272. function this:bagBtnUpdate()
  1273. local leftButton = SL:GetEquipValue(EMetaVarGetKey.EQUIP_TIPS_LEFT_BUTTON, self.args.equip_pos, self.args.cfgId, self.args.id)
  1274. local rightButton = SL:GetEquipValue(EMetaVarGetKey.EQUIP_TIPS_RIGHT_BUTTON, self.args.equip_pos, self.args.cfgId, self.args.id)
  1275. local isDelete = SL:GetConfig("cfg_item", self.args.cfgId).isDelete
  1276. self.left_all = {}
  1277. self.left_all_item = {}
  1278. for i, v in ipairs(leftButton) do
  1279. -- for j, btn_type in ipairs(v) do
  1280. -- if btn_type == "9" and isDelete == 0 then
  1281. -- else
  1282. -- table.insert(self.left_all, btn_type)
  1283. -- end
  1284. -- end
  1285. local btn_type = v[1]
  1286. if btn_type == "9" and isDelete == 0 then
  1287. else
  1288. table.insert(self.left_all, v)
  1289. end
  1290. end
  1291. self.right_all = {}
  1292. self.right_all_item = {}
  1293. for i, v in ipairs(rightButton) do
  1294. -- for j, btn_type in ipairs(v) do
  1295. -- if btn_type == "9" and isDelete == 0 then
  1296. -- else
  1297. -- table.insert(self.right_all, btn_type)
  1298. -- end
  1299. -- end
  1300. local btn_type = v[1]
  1301. if btn_type == "9" and isDelete == 0 then
  1302. else
  1303. table.insert(self.right_all, v)
  1304. end
  1305. end
  1306. self.left_is_open = false
  1307. if #self.left_all < 1 then
  1308. GUI:setVisible(self.view.left_btn, false)
  1309. elseif #self.left_all == 1 then
  1310. GUI:setVisible(self.view.left_btn, true)
  1311. local str = self:getBtnName(self.left_all[1])
  1312. GUI:Button_setTitleText(self.view.left_btn, str)
  1313. else
  1314. GUI:setVisible(self.view.left_btn, true)
  1315. GUI:Button_setTitleText(self.view.left_btn, "更多")
  1316. GUI:DataListInitData(self.view.left_data_list, function()
  1317. return self:LeftDataListItemCountFunc()
  1318. end, function(realIndex)
  1319. return self:LeftDataListItemGetFunc(realIndex)
  1320. end, function(realIndex, kmlcontrol)
  1321. return self:LeftDataListItemInitFunc(realIndex, kmlcontrol)
  1322. end, function(realIndex, kmlcontrol)
  1323. return self:LeftDataListItemUpdateFunc(realIndex, kmlcontrol)
  1324. end)
  1325. end
  1326. self.right_is_open = false
  1327. if GUI:GetUI("dev/ui/Bag/Panel/KLDepots/KLDepotsPanel") then
  1328. GUI:setVisible(self.view.right_btn, true)
  1329. GUI:Button_setTitleText(self.view.right_btn, "放入")
  1330. return
  1331. end
  1332. if GUI:GetUI("dev/outui/Equip/Panel/KLEquipOverlay/KLEquipOverlayPanel") then
  1333. GUI:setVisible(self.view.left_btn, false)
  1334. GUI:setVisible(self.view.right_btn, true)
  1335. GUI:Button_setTitleText(self.view.right_btn, "放置")
  1336. return
  1337. end
  1338. if #self.right_all < 1 then
  1339. GUI:setVisible(self.view.right_btn, false)
  1340. elseif #self.right_all == 1 then
  1341. GUI:setVisible(self.view.right_btn, true)
  1342. local str = self:getBtnName(self.right_all[1])
  1343. GUI:Button_setTitleText(self.view.right_btn, str)
  1344. else
  1345. GUI:setVisible(self.view.right_btn, true)
  1346. GUI:Button_setTitleText(self.view.right_btn, "更多")
  1347. GUI:DataListInitData(self.view.right_data_list, function()
  1348. return self:RightDataListItemCountFunc()
  1349. end, function(realIndex)
  1350. return self:RightDataListItemGetFunc(realIndex)
  1351. end, function(realIndex, kmlcontrol)
  1352. return self:RightDataListItemInitFunc(realIndex, kmlcontrol)
  1353. end, function(realIndex, kmlcontrol)
  1354. return self:RightDataListItemUpdateFunc(realIndex, kmlcontrol)
  1355. end)
  1356. end
  1357. end
  1358. function this:BtnLeftOnClick()
  1359. if self.args.equip_pos == "depots" then
  1360. local storeIndex = SL:GetDepotsIndex(self.args.id)
  1361. SL:ReqStoreGiveUpItemMessage(storeIndex)
  1362. self:CloseEquipTips()
  1363. return
  1364. end
  1365. --合成
  1366. if self.args.equip_pos == "synthesis" then
  1367. self:CloseEquipTips()
  1368. return
  1369. end
  1370. if #self.left_all < 1 then
  1371. elseif #self.left_all == 1 then
  1372. local btnType = self.left_all[1][1]
  1373. if not InfoManager.equipOrItemTipsInfo:IsCanOnClickButton(self.left_all[1]) then
  1374. return
  1375. end
  1376. if btnType == "0" then
  1377. self:CloseEquipTips()
  1378. elseif btnType == "2" then
  1379. self:CloseEquipTips()
  1380. elseif btnType == "3" then
  1381. self:PutOneEquip()
  1382. elseif btnType == "9" then
  1383. local name = SL:GetEquipValue(EMetaVarGetKey.EQUIP_NAME, self.args.equip_pos, self.args.cfgId, self.args.id)
  1384. SL:CommonTipsMessage({ showTips = "是否摧毁" .. name,
  1385. ui = self,
  1386. sureBtnText = "确定",
  1387. cancelBtnText = "取消",
  1388. callback = self.DestroyItem
  1389. })
  1390. elseif btnType == "10" then
  1391. self:JieFeng()
  1392. elseif btnType == "11" then
  1393. self:DiuQi()
  1394. elseif btnType == "13" then
  1395. self:Decompose()
  1396. elseif btnType == "99" then
  1397. self:OpenPanel(self.left_all[1])
  1398. end
  1399. else
  1400. if not self.left_is_open then
  1401. GUI:setVisible(self.view.left_btn_content, true)
  1402. self.left_is_open = true
  1403. GUI:DataListUpdateData(self.view.left_data_list)
  1404. else
  1405. GUI:setVisible(self.view.left_btn_content, false)
  1406. self.left_is_open = false
  1407. end
  1408. end
  1409. end
  1410. function this:PutOneEquip()
  1411. local ItemInfo = SL:GetPosItemInfo(self.args.equip_pos, self.args.cfgId, self.args.id)
  1412. SL:SetMetaValue(EMetaVarSetKey.SET_ROLE_ATTR_VALUE_OFFSET, self.useAttLimit)
  1413. if SL:CheckEquipWear(ItemInfo) == 1 then
  1414. SL:PutOnEquip(ItemInfo)
  1415. else
  1416. SL:SetMetaValue(EMetaVarSetKey.SET_ROLE_ATTR_VALUE_OFFSET, self.useAttLimit)
  1417. SL.Equip:ShowCantEquipTip(ItemInfo)
  1418. end
  1419. self:CloseEquipTips()
  1420. end
  1421. function this.DestroyItem(returnData)
  1422. local ui = returnData.ui
  1423. local index = SL:GetBagIndex(ui.args.id)
  1424. SL:ReqDestroyItemMessage(index)
  1425. ui:CloseEquipTips()
  1426. end
  1427. function this:JieFeng()
  1428. self:CloseEquipTips()
  1429. end
  1430. function this:DiuQi()
  1431. if self.args.equip_pos == "depots" then
  1432. local storeIndex = SL:GetDepotsIndex(self.args.id)
  1433. SL:ReqStoreGiveUpItemMessage(storeIndex)
  1434. else
  1435. local index = SL:GetBagIndex(self.args.id)
  1436. SL:ReqGiveUpItemMessage(index)
  1437. end
  1438. self:CloseEquipTips()
  1439. end
  1440. function this:Decompose()
  1441. self:CloseEquipTips()
  1442. GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
  1443. GUI:UIPanel_Close("dev/ui/Equip/Panel/KLEquipUI/KLEquipUIPanel")
  1444. SL:OpenForgeGroupUI(EForgeGroupType.Decompose)
  1445. end
  1446. function this:TakeOffEquip()
  1447. if not self.args.id then
  1448. return
  1449. end
  1450. local panel = GUI:GetUI("dev/outui/Mount/Panel/KLMountEquip/KLMountEquipPanel")
  1451. if panel then
  1452. ---@type cfg_item_column
  1453. local tbl = SL:GetConfig("cfg_item", self.args.cfgId, "id")
  1454. SL:SendLuaNetMsg(LuaMessageIdToSever.REQ_MOUNT_TAKE_OFF_ITEM, { self.args.mountId, tbl.subType })
  1455. else
  1456. local wearBarId, pos = SL:GetEquipWearBarIdPos(self.args.id)
  1457. SL:TakeOffEquip(wearBarId, pos)
  1458. end
  1459. self:CloseEquipTips()
  1460. end
  1461. function this:ShengJi()
  1462. if not InfoManager.equipOrItemTipsInfo:IsCanOnClickButton("", 10407) then
  1463. return
  1464. end
  1465. self:CloseEquipTips()
  1466. GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
  1467. GUI:UIPanel_Close("dev/ui/Equip/Panel/KLEquipUI/KLEquipUIPanel")
  1468. SL:OpenForgeGroupUI(EForgeGroupType.Jewelry)
  1469. end
  1470. function this:ForgeOnClick()
  1471. if not InfoManager.equipOrItemTipsInfo:IsCanOnClickButton("", 10401) then
  1472. return
  1473. end
  1474. self:CloseEquipTips()
  1475. GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
  1476. GUI:UIPanel_Close("dev/ui/Equip/Panel/KLEquipUI/KLEquipUIPanel")
  1477. local wearBarId, pos = SL:GetEquipWearBarIdPos(self.args.id)
  1478. SL:OpenForgeGroupUI(EForgeGroupType.Strength, pos)
  1479. end
  1480. function this:BreakOnClick()
  1481. self:CloseEquipTips()
  1482. GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
  1483. GUI:UIPanel_Close("dev/ui/Equip/Panel/KLEquipUI/KLEquipUIPanel")
  1484. GUI:UIPanel_Open("dev/outui/Archangel/Panel/KLArchangelGroup/KLArchangelGroupPanel", nil, nil, { selectId = self.args.cfgId })
  1485. end
  1486. function this:getBtnName(data)
  1487. local btn_type = data[1]
  1488. if btn_type == "0" then
  1489. return "取消"
  1490. elseif btn_type == "1" then
  1491. return "使用"
  1492. elseif btn_type == "2" then
  1493. return "回收"
  1494. elseif btn_type == "3" then
  1495. return "穿戴"
  1496. elseif btn_type == "4" then
  1497. return "强化"
  1498. elseif btn_type == "5" then
  1499. return "上架"
  1500. elseif btn_type == "6" then
  1501. return "合并"
  1502. elseif btn_type == "7" then
  1503. return "拆分"
  1504. elseif btn_type == "8" then
  1505. return "批量使用"
  1506. elseif btn_type == "9" then
  1507. return "摧毁"
  1508. elseif btn_type == "10" then
  1509. return "解封"
  1510. elseif btn_type == "11" then
  1511. return "丢弃"
  1512. elseif btn_type == "13" then
  1513. return "分解"
  1514. elseif btn_type == "14" then
  1515. return "装备"
  1516. elseif btn_type == "99" then
  1517. return data[2]
  1518. end
  1519. return ""
  1520. end
  1521. function this:LeftDataListItemCountFunc()
  1522. return #self.left_all
  1523. end
  1524. function this:LeftDataListItemGetFunc(realIndex)
  1525. local data = self.left_all[realIndex + 1]
  1526. local str = self:getBtnName(data)
  1527. local message = { equip_pos = self.args.equip_pos, cfgId = self.args.cfgId, id = self.args.id, btnType = data, nameStr = str }
  1528. local item = GUI:UIPanel_Open("dev/ui/Tips/Item/KLUITips/KLTipBtntem", self.view.left_data_list, self, message, true)
  1529. self.left_all_item[item.view.root] = item
  1530. return item.view.root
  1531. end
  1532. function this:LeftDataListItemInitFunc(realIndex, kmlcontrol)
  1533. end
  1534. function this:LeftDataListItemUpdateFunc(realIndex, kmlcontrol)
  1535. end
  1536. function this:BtnRightOnClick()
  1537. if self.args.equip_pos == "depots" then
  1538. local storeIndex = SL:GetDepotsIndex(self.args.id)
  1539. SL.Equip:ReqStoreTakeButtonMessage(storeIndex)
  1540. self:CloseEquipTips()
  1541. return
  1542. end
  1543. local depotPanel = GUI:GetUI("dev/ui/Bag/Panel/KLDepots/KLDepotsPanel")
  1544. if depotPanel then
  1545. local BagIndex = SL:GetBagIndex(self.args.id)
  1546. if depotPanel.bagType == "privilege" then
  1547. SL.Equip:ReqBagPutStoreButtonMessage(BagIndex, SL:GetDepotsCurPage() + depotPanel.maxDepotsPages)
  1548. else
  1549. SL.Equip:ReqBagPutStoreButtonMessage(BagIndex, SL:GetDepotsCurPage())
  1550. end
  1551. self:CloseEquipTips()
  1552. return
  1553. end
  1554. --叠加
  1555. local overlay = GUI:GetUI("dev/outui/Equip/Panel/KLEquipOverlay/KLEquipOverlayPanel")
  1556. if overlay then
  1557. overlay:SelectItem(self.args.equip_pos, self.args.cfgId, self.args.id)
  1558. self:CloseEquipTips()
  1559. return
  1560. end
  1561. --合成
  1562. if self.args.equip_pos == "synthesis" then
  1563. SL:onLUAEvent(LUA_EVENT_TIPS_ONCLICK_REPLACE)
  1564. self:CloseEquipTips()
  1565. return
  1566. end
  1567. if #self.right_all < 1 then
  1568. elseif #self.right_all == 1 then
  1569. local btnType = self.right_all[1][1]
  1570. if not InfoManager.equipOrItemTipsInfo:IsCanOnClickButton(self.right_all[1]) then
  1571. return
  1572. end
  1573. if btnType == "0" then
  1574. self:CloseEquipTips()
  1575. elseif btnType == "1" then
  1576. self:UseItem()
  1577. elseif btnType == "2" then
  1578. self:CloseEquipTips()
  1579. elseif btnType == "3" then
  1580. self:PutOneEquip()
  1581. elseif btnType == "9" then
  1582. SL:CommonTipsMessage({ showTips = "是否摧毁" .. name,
  1583. ui = self,
  1584. sureBtnText = "确定",
  1585. cancelBtnText = "取消",
  1586. callback = self.DestroyItem
  1587. })
  1588. elseif btnType == "10" then
  1589. self:JieFeng()
  1590. elseif btnType == "11" then
  1591. self:DiuQi()
  1592. elseif btnType == "13" then
  1593. self:Decompose()
  1594. elseif btnType == "14" then
  1595. --准备坐骑道具
  1596. local panel = GUI:GetUI("dev/outui/Mount/Panel/KLMountEquip/KLMountEquipPanel")
  1597. if panel then
  1598. local BagIndex = SL:GetBagIndex(self.args.id)
  1599. ---@type cfg_item_column
  1600. local tbl = SL:GetConfig("cfg_item", self.args.cfgId, "id")
  1601. SL:SendLuaNetMsg(LuaMessageIdToSever.REQ_MOUNT_PUT_ON_ITEM, { self.args.mountId, BagIndex, tbl.subType, self.args.cfgId, self.args.id })
  1602. else
  1603. GUI:UIPanel_Open("dev/outui/Mount/Panel/KLMountStore/KLMountStorePanel", nil, nil)
  1604. GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
  1605. end
  1606. self:CloseEquipTips()
  1607. elseif btnType == "99" then
  1608. self:OpenPanel(self.right_all[1])
  1609. end
  1610. else
  1611. if not self.right_is_open then
  1612. GUI:setVisible(self.view.right_btn_content, true)
  1613. self.right_is_open = true
  1614. GUI:DataListUpdateData(self.view.right_data_list)
  1615. else
  1616. GUI:setVisible(self.view.right_btn_content, false)
  1617. self.right_is_open = false
  1618. end
  1619. end
  1620. end
  1621. function this:UseItem()
  1622. ---@type cfg_item_column
  1623. local itemTbl = SL:GetConfig("cfg_item", self.args.cfgId)
  1624. SL:UseItem(self.args.cfgId, self.args.id, self.args.count)
  1625. self:CloseEquipTips()
  1626. if itemTbl.type == E_ItemType.TriggerItem and itemTbl.subType == E_OutTriggerItemType.TransferRing then
  1627. GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
  1628. SL.HideMainPanel()
  1629. --守护处理,跳转到外观守护界面
  1630. GUI:UIPanel_Open("dev/outui/AppearGroup/Panel/KLAppearGroup/KLAppearGroupPanel", nil, nil, E_FashionType.TransferRing)
  1631. SL:ScheduleOnce(0.3, function()
  1632. SL:onLUAEvent(TRANSFER_RING_SELECT_ITEM, self.args.cfgId)
  1633. end)
  1634. elseif itemTbl.type == E_ItemType.TriggerItem and itemTbl.subType == E_OutTriggerItemType.GuardSkin then
  1635. GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
  1636. SL.HideMainPanel()
  1637. --守护处理,跳转到外观守护界面
  1638. GUI:UIPanel_Open("dev/outui/AppearGroup/Panel/KLAppearGroup/KLAppearGroupPanel", nil, nil, E_FashionType.Appear)
  1639. SL:ScheduleOnce(0.3, function()
  1640. SL:onLUAEvent(APPEAR_SELECT_ITEM, self.args.cfgId)
  1641. end)
  1642. end
  1643. end
  1644. function this:OpenPanel(btnType)
  1645. if #btnType < 3 then
  1646. return
  1647. end
  1648. self:CloseEquipTips()
  1649. GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
  1650. GUI:UIPanel_Close("dev/ui/Equip/Panel/KLEquipUI/KLEquipUIPanel")
  1651. local panel = btnType[4]
  1652. if #btnType == 4 then
  1653. GUI:UIPanel_Open(panel)
  1654. elseif #btnType == 5 then
  1655. local num = btnType[5]
  1656. if tonumber(num) then
  1657. num = tonumber(num)
  1658. end
  1659. GUI:UIPanel_Open(panel, nil, nil, num)
  1660. elseif #btnType >= 7 then
  1661. local message = {}
  1662. for i = 5, #btnType - 2, 3 do
  1663. if btnType[i] and btnType[i + 1] and btnType[i + 2] then
  1664. if btnType[i + 1] == "string" then
  1665. message[btnType[i]] = btnType[i + 2]
  1666. else
  1667. message[btnType[i]] = tonumber(btnType[i + 2])
  1668. end
  1669. end
  1670. end
  1671. GUI:UIPanel_Open(panel, nil, nil, message)
  1672. end
  1673. SL.HideMainPanel()
  1674. end
  1675. function this:RightDataListItemCountFunc()
  1676. return #self.right_all
  1677. end
  1678. function this:RightDataListItemGetFunc(realIndex)
  1679. local data = self.right_all[realIndex + 1]
  1680. local str = self:getBtnName(data)
  1681. local message = { equip_pos = self.args.equip_pos, cfgId = self.args.cfgId, id = self.args.id, btnType = data, nameStr = str }
  1682. local item = GUI:UIPanel_Open("dev/ui/Tips/Item/KLUITips/KLTipBtntem", self.view.right_data_list, self, message, true)
  1683. self.right_all_item[item.view.root] = item
  1684. return item.view.root
  1685. end
  1686. function this:RightDataListItemInitFunc(realIndex, kmlcontrol)
  1687. end
  1688. function this:RightDataListItemUpdateFunc(realIndex, kmlcontrol)
  1689. end
  1690. ---获取被属性衰减过的实际生效属性
  1691. ---@param attrList CommonProtos.EquipEntryAttrVo[] 幸运属性
  1692. function this:GetAttrValueOffset(attrId, attrValue, attrList)
  1693. if not attrList then
  1694. return 0
  1695. end
  1696. local specialValue = 0
  1697. ---@type cfg_att_special_column
  1698. local specialTbl = SL:GetConfig("cfg_att_special", tostring(attrId), "param")
  1699. if specialTbl and specialTbl.type[1] == 21 then
  1700. for _, v in pairs(attrList) do
  1701. if v.type == specialTbl.id then
  1702. specialValue = v.num
  1703. break
  1704. end
  1705. end
  1706. ---@type cfg_att_info_column
  1707. local tbl = SL:GetConfig("cfg_att_info", specialTbl.id)
  1708. if tbl then
  1709. if tbl.remarks == 2 then
  1710. specialValue = attrValue * specialValue * 100
  1711. end
  1712. end
  1713. end
  1714. return specialValue
  1715. end
  1716. ----------首饰特殊处理显示----------------------------------------------------------
  1717. ---@return cfg_equip_ornaments_column
  1718. function this:GetJewelryTblInfoByLevel(cfgId, Level)
  1719. local ornament_tbl = SL:GetConfig('cfg_equip_ornamentsMain', cfgId)
  1720. local ornamentsTbl = SL:GetConfigTable('cfg_equip_ornaments')
  1721. for _, v in pairs(ornamentsTbl) do
  1722. if v.ornamentsGroup == ornament_tbl.ornamentsGroup and v.lv == Level then
  1723. return v
  1724. end
  1725. end
  1726. return nil
  1727. end
  1728. -- function this:SetJewelryTips()
  1729. -- local jewelryEquip = SL:GetPosItemInfo(self.args.equip_pos, self.args.cfgId, self.args.id)
  1730. -- if not jewelryEquip then
  1731. -- jewelryEquip = {}
  1732. -- jewelryEquip.luaExtData = "null"
  1733. -- end
  1734. -- ---@type RES_UPDATE_EQUIP_ORNAMENTS
  1735. -- local OutEquipData = SL:JsonDecode(jewelryEquip.luaExtData)
  1736. -- local preLevel = 0
  1737. -- if OutEquipData == nil or (OutEquipData and not OutEquipData.ssuplv) then
  1738. -- preLevel = 0
  1739. -- else
  1740. -- preLevel = OutEquipData.ssuplv
  1741. -- end
  1742. -- local PreOrnament_Tbl = self:GetJewelryTblInfoByLevel(self.args.cfgId, preLevel)
  1743. -- local NextOrnament_Tbl = self:GetJewelryTblInfoByLevel(self.args.cfgId, preLevel + 1)
  1744. -- if PreOrnament_Tbl then
  1745. -- local nextLevel = ""
  1746. -- ----基础属性标题
  1747. -- if not self.IsHaveStrengthen then
  1748. -- table.insert(self.all_info, { title = "tips_attribute21" })
  1749. -- end
  1750. -- ----等级
  1751. -- table.insert(self.all_info, { name = "LV." .. preLevel, value = "" })
  1752. -- self:JewelSpecialAttr(PreOrnament_Tbl, "#FFFFFF")
  1753. -- for _, attrValue in pairs(PreOrnament_Tbl.basicAtt) do
  1754. -- if not self:IsJewelSpecialAttr(attrValue[1]) then
  1755. -- local preValue = 0
  1756. -- local attrName = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).name
  1757. -- local att_remark = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).remarks
  1758. -- if att_remark == 1 then
  1759. -- preValue = attrValue[2]
  1760. -- else
  1761. -- preValue = tonumber(attrValue[2]) / 100 .. '%'
  1762. -- end
  1763. -- table.insert(self.all_info, { name = attrName .. ":", value = preValue, color = "#FFFFFF" })
  1764. -- end
  1765. -- end
  1766. -- if NextOrnament_Tbl then
  1767. -- nextLevel = preLevel + 1
  1768. -- ----下一等级
  1769. -- table.insert(self.all_info, { name = "下一级LV." .. nextLevel, value = "" })
  1770. -- self:JewelSpecialAttr(NextOrnament_Tbl, "#B0B0B0")
  1771. -- for _, attrValue in pairs(NextOrnament_Tbl.basicAtt) do
  1772. -- if not self:IsJewelSpecialAttr(attrValue[1]) then
  1773. -- local NextValue = 0
  1774. -- local attrName = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).name
  1775. -- local att_remark = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).remarks
  1776. -- if att_remark == 1 then
  1777. -- NextValue = attrValue[2]
  1778. -- else
  1779. -- NextValue = tonumber(attrValue[2]) / 100 .. '%'
  1780. -- end
  1781. -- table.insert(self.all_info, { name = attrName .. ":", value = NextValue, color = "#B0B0B0" })
  1782. -- end
  1783. -- end
  1784. -- end
  1785. -- end
  1786. -- ----------卓越属性
  1787. -- ----卓越属性标题
  1788. -- table.insert(self.all_info, { title = "tips_attribute3" })
  1789. -- local ornament_tbl = SL:GetConfig('cfg_equip_ornamentsMain', self.args.cfgId)
  1790. -- local ornamentsTbl = SL:GetConfigTable('cfg_equip_ornaments')
  1791. -- for _, v in pairs(ornamentsTbl) do
  1792. -- if v.ornamentsGroup == ornament_tbl.ornamentsGroup then
  1793. -- if next(v.excellenceAtt) then
  1794. -- for _, attrValue in pairs(v.excellenceAtt) do
  1795. -- local preValue = 0
  1796. -- local attrName = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).name
  1797. -- local att_remark = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).remarks
  1798. -- local desc = ""
  1799. -- local descColor = "#FFFFFF"
  1800. -- local color = "#B0B0B0"
  1801. -- if preLevel < v.lv then
  1802. -- desc = v.lv .. "级可激活"
  1803. -- descColor = "#ff2323"
  1804. -- color = "#B0B0B0"
  1805. -- else
  1806. -- desc = v.lv .. "级可激活"
  1807. -- descColor = "#1ADD1F"
  1808. -- color = "#B0B0B0"
  1809. -- end
  1810. -- if OutEquipData and OutEquipData.ssactlv then
  1811. -- for _, data in pairs(OutEquipData.ssactlv) do
  1812. -- if tonumber(data) == v.lv then
  1813. -- desc = "已激活"
  1814. -- descColor = "#4BA7E8"
  1815. -- color = "#4BA7E8"
  1816. -- end
  1817. -- end
  1818. -- end
  1819. -- if att_remark == 1 then
  1820. -- preValue = attrValue[2]
  1821. -- else
  1822. -- preValue = tonumber(attrValue[2]) / 100 .. '%'
  1823. -- end
  1824. -- if self:chenckAttrShow(tonumber(attrValue[1])) then
  1825. -- local nameStr = nil
  1826. -- if not self:chenckAttrValue(tonumber(attrValue[1])) then
  1827. -- preValue = ""
  1828. -- nameStr = attrName
  1829. -- else
  1830. -- nameStr = attrName .. " +"
  1831. -- end
  1832. -- table.insert(self.all_info, { name = nameStr, value = preValue, color = color, desc = desc, descColor = descColor })
  1833. -- end
  1834. -- end
  1835. -- end
  1836. -- end
  1837. -- end
  1838. -- end
  1839. function this:SetJewelryTips()
  1840. local jichu_list
  1841. local jichu_index
  1842. for i, v in ipairs(self.all_att_sort_list) do
  1843. if v.attr_type == 1 then
  1844. jichu_index = i
  1845. jichu_list = v.data
  1846. break
  1847. end
  1848. end
  1849. if not jichu_list then
  1850. jichu_list = {}
  1851. end
  1852. local jewelryEquip = SL:GetPosItemInfo(self.args.equip_pos, self.args.cfgId, self.args.id)
  1853. if not jewelryEquip then
  1854. jewelryEquip = {}
  1855. jewelryEquip.luaExtData = "null"
  1856. end
  1857. ---@type RES_UPDATE_EQUIP_ORNAMENTS
  1858. local OutEquipData = SL:JsonDecode(jewelryEquip.luaExtData,false)
  1859. local preLevel = 0
  1860. if OutEquipData == nil or (OutEquipData and not OutEquipData.ssuplv) then
  1861. preLevel = 0
  1862. else
  1863. preLevel = OutEquipData.ssuplv
  1864. end
  1865. local PreOrnament_Tbl = self:GetJewelryTblInfoByLevel(self.args.cfgId, preLevel)
  1866. local NextOrnament_Tbl = self:GetJewelryTblInfoByLevel(self.args.cfgId, preLevel + 1)
  1867. local shoushi_att = {}
  1868. if PreOrnament_Tbl then
  1869. local nextLevel = ""
  1870. ----基础属性标题
  1871. if not self.IsHaveStrengthen then
  1872. --table.insert(self.all_info, { title = "tips_attribute21" })
  1873. end
  1874. ----等级
  1875. --table.insert(self.all_info, { name = "LV." .. preLevel, value = "" })
  1876. table.insert(shoushi_att, { name = "LV." .. preLevel, value = "" })
  1877. local one_att = self:JewelSpecialAttr(PreOrnament_Tbl, "#FFFFFF")
  1878. if one_att then
  1879. table.insert(shoushi_att, one_att)
  1880. end
  1881. for _, attrValue in pairs(PreOrnament_Tbl.basicAtt) do
  1882. if not self:IsJewelSpecialAttr(attrValue[1]) then
  1883. local preValue = 0
  1884. local attrName = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).name
  1885. local att_remark = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).remarks
  1886. if att_remark == 1 then
  1887. preValue = attrValue[2]
  1888. else
  1889. preValue = tonumber(attrValue[2]) / 100 .. '%'
  1890. end
  1891. --table.insert(self.all_info, { name = attrName .. ":", value = preValue, color = "#FFFFFF" })
  1892. table.insert(shoushi_att, { name = attrName .. ":", value = preValue, color = "#FFFFFF" })
  1893. end
  1894. end
  1895. if NextOrnament_Tbl then
  1896. nextLevel = preLevel + 1
  1897. ----下一等级
  1898. --table.insert(self.all_info, { name = "下一级LV." .. nextLevel, value = "" })
  1899. table.insert(shoushi_att, { name = "下一级LV." .. nextLevel, value = "" ,color="#999999",color_not_change =true})
  1900. local o_att = self:JewelSpecialAttr(NextOrnament_Tbl, "#B0B0B0")
  1901. if o_att then
  1902. o_att.color="#999999"
  1903. o_att.color_not_change =true
  1904. table.insert(shoushi_att, o_att)
  1905. end
  1906. for _, attrValue in pairs(NextOrnament_Tbl.basicAtt) do
  1907. if not self:IsJewelSpecialAttr(attrValue[1]) then
  1908. local NextValue = 0
  1909. local attrName = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).name
  1910. local att_remark = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).remarks
  1911. if att_remark == 1 then
  1912. NextValue = attrValue[2]
  1913. else
  1914. NextValue = tonumber(attrValue[2]) / 100 .. '%'
  1915. end
  1916. --table.insert(self.all_info, { name = attrName .. ":", value = NextValue, color = "#B0B0B0" })
  1917. table.insert(shoushi_att, { name = attrName .. ":", value = NextValue ,color="#999999",color_not_change =true})
  1918. end
  1919. end
  1920. end
  1921. end
  1922. if jichu_index then
  1923. self.all_att_sort_list[jichu_index].data = jichu_list
  1924. else
  1925. table.insert(self.all_att_sort_list, { attr_type = 1, data = jichu_list })
  1926. end
  1927. if shoushi_att and #shoushi_att > 0 then
  1928. table.insert(self.all_att_sort_list, { attr_type = 10, data = shoushi_att })
  1929. end
  1930. ----------卓越属性
  1931. ----卓越属性标题
  1932. --table.insert(self.all_info, { title = "tips_attribute3" })
  1933. local zhuoyue_list
  1934. local zhuoyue_index
  1935. for i, v in ipairs(self.all_att_sort_list) do
  1936. if v.attr_type == 4 then
  1937. zhuoyue_index = i
  1938. zhuoyue_list = v.data
  1939. break
  1940. end
  1941. end
  1942. if not zhuoyue_list then
  1943. zhuoyue_list = {}
  1944. end
  1945. local ornament_tbl = SL:GetConfig('cfg_equip_ornamentsMain', self.args.cfgId)
  1946. local ornamentsTbl = SL:GetConfigTable('cfg_equip_ornaments')
  1947. for _, v in pairs(ornamentsTbl) do
  1948. if v.ornamentsGroup == ornament_tbl.ornamentsGroup then
  1949. if next(v.excellenceAtt) then
  1950. for _, attrValue in pairs(v.excellenceAtt) do
  1951. local preValue = 0
  1952. local attrName = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).name
  1953. local att_remark = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).remarks
  1954. local desc = ""
  1955. local descColor = "#FFFFFF"
  1956. local color = "#B0B0B0"
  1957. if preLevel < v.lv then
  1958. desc = v.lv .. "级可激活"
  1959. descColor = "#ff2323"
  1960. color = "#B0B0B0"
  1961. else
  1962. desc = v.lv .. "级可激活"
  1963. descColor = "#1ADD1F"
  1964. color = "#B0B0B0"
  1965. end
  1966. if OutEquipData and OutEquipData.ssactlv then
  1967. for _, data in pairs(OutEquipData.ssactlv) do
  1968. if tonumber(data) == v.lv then
  1969. desc = "已激活"
  1970. descColor = "#4BA7E8"
  1971. color = "#4BA7E8"
  1972. end
  1973. end
  1974. end
  1975. if att_remark == 1 then
  1976. preValue = attrValue[2]
  1977. else
  1978. preValue = tonumber(attrValue[2]) / 100 .. '%'
  1979. end
  1980. if self:chenckAttrShow(tonumber(attrValue[1])) then
  1981. local nameStr = nil
  1982. if not self:chenckAttrValue(tonumber(attrValue[1])) then
  1983. preValue = ""
  1984. nameStr = attrName
  1985. else
  1986. nameStr = attrName .. " +"
  1987. end
  1988. --table.insert(self.all_info, { name = nameStr, value = preValue, color = color, desc = desc, descColor = descColor })
  1989. table.insert(zhuoyue_list, { name = nameStr, value = preValue, color = color, desc = desc, descColor = descColor })
  1990. end
  1991. end
  1992. end
  1993. end
  1994. end
  1995. if #zhuoyue_list > 0 then
  1996. if zhuoyue_index then
  1997. self.all_att_sort_list[zhuoyue_index].data = zhuoyue_list
  1998. else
  1999. table.insert(self.all_att_sort_list, { attr_type = 4, data = zhuoyue_list })
  2000. end
  2001. end
  2002. end
  2003. function this:JewelSpecialAttr(PreOrnament_Tbl, _Color)
  2004. local max1
  2005. local min1
  2006. local max2
  2007. local min2
  2008. local max3
  2009. local min3
  2010. local max4
  2011. local min4
  2012. for i, v in ipairs(PreOrnament_Tbl.basicAtt) do
  2013. if v[1] == 200021 then
  2014. max1 = v
  2015. elseif v[1] == 200011 then
  2016. min1 = v
  2017. elseif v[1] == 202011 then
  2018. max2 = v
  2019. elseif v[1] == 202021 then
  2020. min2 = v
  2021. elseif v[1] == 205021 then
  2022. max3 = v
  2023. elseif v[1] == 205011 then
  2024. min3 = v
  2025. elseif v[1] == 203021 then
  2026. max4 = v
  2027. elseif v[1] == 203011 then
  2028. min4 = v
  2029. end
  2030. end
  2031. if max1 and min1 then
  2032. local _value = min1[2] .. "~" .. max1[2]
  2033. return { name = "攻击力", value = _value, color = _Color }
  2034. end
  2035. if max2 and min2 then
  2036. local _value = min2[1] .. "~" .. max2[2]
  2037. return { name = "魔法攻击力", value = _value, color = _Color }
  2038. end
  2039. if max3 and min3 then
  2040. local _value = min3[1] .. "~" .. max3[2]
  2041. return { name = "诅咒攻击力", value = _value, color = _Color }
  2042. end
  2043. if max4 and min4 then
  2044. local _value = min4[1] .. "~" .. max4[2]
  2045. return { name = "天鹰攻击力", value = _value, color = _Color }
  2046. end
  2047. return
  2048. end
  2049. function this:IsJewelSpecialAttr(attrId)
  2050. if attrId == 200021 or attrId == 200011 or attrId == 202011 or attrId == 202021 or attrId == 205021 or attrId == 205011 or attrId == 203021 or attrId == 203011 then
  2051. return true
  2052. end
  2053. return false
  2054. end
  2055. ----------首饰特殊处理显示end----------------------------------------------------------
  2056. ----------大天使装备对进度条的特殊处理------------------------------------------
  2057. function this:RES_ANGEL_EQUIPMENT_ATTR_INFO(_, message)
  2058. if message[tostring(self.args.id)] then
  2059. GUI:SetLoadingbar_startper(self.archenge.loadingbar, (message[tostring(self.args.id)].exp / self.archenge.maxExp) * 100)
  2060. GUI:Text_setString(self.archenge.valueInfo, tostring(message[tostring(self.args.id)].exp) .. "/" .. tostring(self.archenge.maxExp))
  2061. GUI:Text_setString(self.archenge.loading_name, "<color='#1add1f'>Lv." .. tostring(message[tostring(self.args.id)].level) .. "</color>")
  2062. end
  2063. end
  2064. ----------萤石属性-----------start----------------------------------------------------------------
  2065. function this:GetGemAtt()
  2066. self.all_gem_att = {}
  2067. local rid = SL:GetMetaValue(EMetaVarGetKey.USER_ID)
  2068. local target_id = nil
  2069. if self.args.info and self.args.info.otherRid then
  2070. if tostring(self.args.info.otherRid) ~= rid then
  2071. target_id = self.args.info.otherRid
  2072. end
  2073. end
  2074. if not self.args.id then
  2075. return
  2076. end
  2077. --显示的是自己装备的萤石属性
  2078. if not target_id then
  2079. if self.args.equip_pos ~= "equip" and self.args.equip_pos ~= "chat" then
  2080. return
  2081. end
  2082. local index = SL.Equip:GetIndexBaseOnItemId(self.args.id)
  2083. if not index then
  2084. return
  2085. end
  2086. local wearBarId, pos = SL:GetEquipWearBarIdPos(self.args.id)
  2087. local gem_data = InfoManager.gemSlateInfo:GetTargetEquipGem(pos)
  2088. if gem_data then
  2089. for k, gem_id in pairs(gem_data.gems) do
  2090. local tab=SL:GetConfig("cfg_equip_gem", gem_id)
  2091. for i, att in ipairs(tab.gemAtt) do
  2092. local target_index = nil
  2093. for j=1,#self.all_gem_att,1 do
  2094. if self.all_gem_att[j].type == att[1] then
  2095. target_index = j
  2096. end
  2097. end
  2098. if target_index then
  2099. local tar_value = self.all_gem_att[target_index].num
  2100. tar_value = tar_value + att[2]
  2101. self.all_gem_att[target_index].num = tar_value
  2102. else
  2103. table.insert(self.all_gem_att,{type=att[1],num=att[2]})
  2104. end
  2105. end
  2106. end
  2107. end
  2108. else
  2109. --显示别人装备的萤石属性
  2110. if not self.gemOtherPlayerId then
  2111. SL:SendLuaNetMsg(LuaMessageIdToSever.REQ_OTHER_GEM_EQUIP_INFO, { rid = target_id })--请求一下别的玩家的萤石信息
  2112. else
  2113. if not EquipFunc.checkOtherEquips() then
  2114. return
  2115. end
  2116. local wearBarId, pos = EquipFunc.OtherGetEquipWearBarIdPos(self.args.id)
  2117. local gem_data = InfoManager.gemSlateInfo:GetOtherPlayerTargetEquipGem(pos)
  2118. if gem_data then
  2119. for k, gem_id in pairs(gem_data.gems) do
  2120. local tab=SL:GetConfig("cfg_equip_gem", gem_id)
  2121. for i, att in ipairs(tab.gemAtt) do
  2122. local target_index = nil
  2123. for j=1,#self.all_gem_att,1 do
  2124. if self.all_gem_att[j].type == att[1] then
  2125. target_index = j
  2126. end
  2127. end
  2128. if target_index then
  2129. local tar_value = self.all_gem_att[target_index].num
  2130. tar_value = tar_value + att[2]
  2131. self.all_gem_att[target_index].num = tar_value
  2132. else
  2133. table.insert(self.all_gem_att,{type=att[1],num=att[2]})
  2134. end
  2135. end
  2136. end
  2137. end
  2138. end
  2139. end
  2140. end
  2141. function this:LUA_EVENT_REFRESH_GEM_SLATE_INFO(_id,message)
  2142. if not self.args.info or not self.args.info.otherRid then
  2143. return
  2144. end
  2145. if tostring(self.args.info.otherRid) ~= tostring(message) then
  2146. return
  2147. end
  2148. self.gemOtherPlayerId= message
  2149. self:Refresh()
  2150. end
  2151. ----------萤石属性-----------end----------------------------------------------------------------
  2152. return this