KLUIEquipTipsComparsionPanel.lua 87 KB

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