12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285 |
- ---@class KLUIEquipTipsPanel:UIKmlLuaPanelBase
- ---@field view KLUIEquipTipsPanelView
- local KLUIEquipTipsPanel = class(UIKmlLuaPanelBase)
- local this = KLUIEquipTipsPanel
- ---创建时调用一次
- function this:Init()
- self.otherArchange = nil
- if self.args.info and self.args.info.hideMask then
- GUI:setVisible(self.view.background_close, false)
- else
- GUI:setVisible(self.view.background_close, true)
- end
- if self.args.info and self.args.info.isRight then
- GUI:setAnchorPoint(self.view.root, 2, 0)
- end
- if self.args.info and self.args.info.posX then
- GUI:setPositionX(self.view.root, self.args.info.posX)
- end
- GUI:DataListInitData(self.view.equipzhiyeNeedData, function()
- return self:NeedCareerDataListItemCountFunc()
- end, function(realIndex)
- return self:NeedCareerDataListItemGetFunc(realIndex)
- end, function(realIndex, kmlcontrol)
- return self:NeedCareerDataListItemInitFunc(realIndex, kmlcontrol)
- end, function(realIndex, kmlcontrol)
- return self:NeedCareerDataListItemUpdateFunc(realIndex, kmlcontrol)
- end)
- GUI:DataListInitData(self.view.equipNeedData, function()
- return self:NeedDataListItemCountFunc()
- end, function(realIndex)
- return self:NeedDataListItemGetFunc(realIndex)
- end, function(realIndex, kmlcontrol)
- return self:NeedDataListItemInitFunc(realIndex, kmlcontrol)
- end, function(realIndex, kmlcontrol)
- return self:NeedDataListItemUpdateFunc(realIndex, kmlcontrol)
- end)
- GUI:DataListInitData(self.view.all_info_data, function()
- return self:EquipAttrDataListItemCountFunc()
- end, function(realIndex)
- return self:EquipAttrDataListItemGetFunc(realIndex)
- end, function(realIndex, kmlcontrol)
- return self:EquipAttrDataListItemInitFunc(realIndex, kmlcontrol)
- end, function(realIndex, kmlcontrol)
- return self:EquipAttrDataListItemUpdateFunc(realIndex, kmlcontrol)
- end)
- self.firstCharge_list = { 28810531, 28820531, 28830531 }
- self.gemOtherPlayerId = nil
- end
- ---界面显示时调用一次
- function this:Show()
- 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
- --SL:SendLuaNetMsg(LuaMessageIdToSever.REQ_OTHER_ANGE_EQUIP_INFO, { rid = self.args.info.otherRid, itemId = self.args.id })
- ---@type KLUIRankListPanel
- local ui = GUI:GetUI("dev/outui/UIRankList/Panel/KLUIRankList/KLUIRankListPanel")
- if ui then
- self.otherArchange = ui:GetOtherAngelEquipInfo(self.args.id)
- self:Refresh()
- end
- end
- end
- ---创建或者刷新界面数据时调用
- function this:Refresh()
- self.archenge = {}
- local itemInfo = SL:GetPosItemInfo(self.args.equip_pos, self.args.cfgId, self.args.id)
- local name = SL:GetEquipValue(EMetaVarGetKey.EQUIP_NAME, self.args.equip_pos, self.args.cfgId, self.args.id)
- self.type = SL:GetMetaValue(EMetaVarGetKey.ITEMTYPE, self.args.cfgId)
- self.subType = SL:GetMetaValue(EMetaVarGetKey.ITEMSUBTYPE, self.args.cfgId)
- if self.type == 2 and self.subType == 16 then
- --坐骑
- GUI:UIPanel_Open('dev/outui/Mount/Panel/KLMountTip/KLMountTipPanel', nil, nil, self.args)
- return
- end
- local twoHanded = SL:GetEquipValue(EMetaVarGetKey.EQUIP_TWO_HANDED, self.args.equip_pos, self.args.cfgId, self.args.id)
- local two_handed = ""
- if self.subType and self.subType <= 3 then
- if twoHanded and twoHanded == 1 then
- two_handed = "双手武器"
- else
- two_handed = "单手武器"
- end
- end
- local equip_status = ""
- local isDeal = 0
- --local isDeal = SL:GetMetaValue(EMetaVarGetKey.ITEM_IS_DEAL, self.args.cfgId)
- if itemInfo then
- if itemInfo.bind then
- isDeal = 2
- else
- isDeal = 1
- end
- else
- local lockItem = SL:GetConfig("cfg_item", self.args.cfgId).lockItem
- if lockItem[1] then
- isDeal = lockItem[1]
- end
- end
- if itemInfo then
- if isDeal == 1 then
- local strengthen = EquipFunc.GetEquipStrengthLevel(itemInfo)
- if strengthen > 0 then
- isDeal = 2
- end
- end
- if isDeal == 1 then
- local appLevel = EquipFunc.GetEquipAppendLevel(itemInfo)
- if appLevel > 0 then
- isDeal = 2
- end
- end
- if isDeal == 1 then
- local regenerateToAttr = SL:GetEquipValue(EMetaVarGetKey.EQUIP_REGENERATE_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
- if regenerateToAttr and table.count(regenerateToAttr) > 0 then
- isDeal = 2
- end
- end
- end
- if isDeal == 1 then
- equip_status = "可交易"
- elseif isDeal == 2 then
- equip_status = "<color=#ff2323>不可交易</color>"
- end
- if self.args.equip_pos == "equip" then
- equip_status = equip_status .. "[已装备]"
- end
- ---描述设置空
- GUI:Text_setString(self.view.TipsText, "")
- GUI:SetActive(self.view.TipsText, false)
- --模型高度
- local modelHeight = 0
- --底部文字存在的情况下增加的高度
- local bottomDescHeight = 0
- --变身戒指or守护皮肤
- if self.type == 6 and (self.subType == 14 or self.subType == 13) then
- GUI:UIPanel_Close("dev/ui/Tips/Panel/KLIUItemTips/KLUIItemTipsPanel")
- modelHeight = 180
- end
- --生成一下模型
- if modelHeight > 0 then
- GUI:setVisible(self.view.model1, true)
- --模型路径
- local modelPath = ""
- ---@type cfg_item_column
- local itemTbl = SL:GetConfig("cfg_item", self.args.cfgId, "id")
- --设置底部文字
- if itemTbl.bottomdesc ~= "" then
- GUI:SetActive(self.view.TipsText, true)
- GUI:Text_setString(self.view.TipsText, itemTbl.bottomdesc)
- GUI:setPositionY(self.view.TipsTextScrollview, 70)
- bottomDescHeight = 50
- end
- local modelScale = 30
- if self.type == 6 then
- if self.subType == 14 then
- --变身戒指
- ---@type cfg_model_monster_column
- local model_tbl = SL:GetConfig("cfg_model_monster", tonumber(itemTbl.useParam), "id")
- modelPath = model_tbl.path
- --空的话说明已使用
- if equip_status == "" then
- equip_status = "<color=#ff2323>不可交易</color>"
- if itemTbl.bottomdesc ~= "" then
- --无按钮的情况下并且底部文字有的情况下增加一些高度
- bottomDescHeight = 100
- end
- modelHeight = (modelHeight + bottomDescHeight) / 2
- GUI:setPositionY(self.view.TipsTextScrollview, 15)
- end
- --幻化了的话说明已装备
- local CurMonsterId = InfoManager.appearInfo.GetCurMonsterId()
- if CurMonsterId == model_tbl.id then
- equip_status = equip_status .. "[已装备]"
- end
- elseif self.subType == 13 then
- --守护皮肤
- ---@type cfg_model_charactor_column
- local model_tbl = SL:GetConfig("cfg_model_charactor", tonumber(itemTbl.field[1]), "id")
- modelPath = model_tbl.path
- modelScale = 50
- if SL:HasConfig("cfg_fashion",self.args.cfgId) then
- modelScale = SL:GetConfig("cfg_fashion",self.args.cfgId).tipsScale
- end
- end
- end
-
- --模型数据
- local modelData = {
- mscale = modelScale..","..modelScale..","..modelScale,
- mrotate = "0,150,0",
- x = "0",
- y = "0",
- z = "-1000",
- a = "00",
- src = modelPath,
- }
- if not self.cur_model then
- --生成模型
- self.cur_model = GUI:Model_Create(self.view.model1, modelData)
- else
- GUI:Item_UpdataData(self.cur_model, modelData)
- end
- end
- local top_num = 0
- local grade = SL:GetEquipValue(EMetaVarGetKey.EQUIP_GRADE, self.args.equip_pos, self.args.cfgId, self.args.id)
- local name_color = SL:GetConfig("cfg_item", self.args.cfgId).color
- local rank = SL:GetEquipValue(EMetaVarGetKey.EQUIP_RANK, self.args.equip_pos, self.args.cfgId, self.args.id)
- local useLevelLimit = SL:GetEquipValue(EMetaVarGetKey.EQUIP_USE_LEVEL_LIMIT, self.args.equip_pos, self.args.cfgId, self.args.id)
- GUI:Text_setTextColor(self.view.equip_name, tostring(name_color))
- GUI:Item_setItemId(self.view.equip_tips_item, self.args.cfgId)
- self:SetLiuGuang(itemInfo)
- local shape = SL:GetConfig("cfg_item", self.args.cfgId).shape[1]
- local rotation = SL:GetConfig("cfg_model_charactor", shape).rotateAxis
- local rotation_str = rotation .. ",50,0"
- self.Schedule1 = SL:ScheduleOnce(0.2, function()
- if self.view then
- GUI:Item_Rotate(self.view.equip_tips_item, rotation_str)
- end
- end)
- GUI:Text_setString(self.view.equip_status, equip_status)
- if string.isNullOrEmpty(two_handed) then
- GUI:setVisible(self.view.equip_type_titlt, false)
- else
- GUI:setVisible(self.view.equip_type_titlt, true)
- GUI:Text_setString(self.view.equip_type, two_handed)
- end
- -- 大天使装备的阶数需要特殊处理
- if SL:GetConfig("cfg_item", self.args.cfgId, "id").wearBarID[1] == EEquipWearBarType.Archange then
- if not self.args.id or not InfoManager.archangeEquipInfo:IsHaveArchangeEquip(self.args.id) then
- if self.args.id and self.otherArchange then
- local rankStr = tostring(self.otherArchange.rank) .. "阶"
- GUI:Text_setString(self.view.equip_jie, rankStr)
- GUI:setVisible(self.view.equip_jie_root, true)
- top_num = top_num + 1
- else
- local rankStr = tostring(InfoManager.archangeEquipInfo:GetMaxRank(self.args.cfgId)) .. "阶"
- GUI:Text_setString(self.view.equip_jie, rankStr)
- GUI:setVisible(self.view.equip_jie_root, true)
- top_num = top_num + 1
- end
- else
- local archangeRank = InfoManager.archangeEquipInfo:GetEquipLevelInfo(self.args.id).rank
- local rankStr = tostring(archangeRank) .. "阶"
- GUI:Text_setString(self.view.equip_jie, rankStr)
- GUI:setVisible(self.view.equip_jie_root, true)
- top_num = top_num + 1
- end
- else
- if rank and rank ~= 0 then
- local rankStr = SL:NumberToChinese(rank)
- rankStr = rankStr .. "阶"
- GUI:Text_setString(self.view.equip_jie, rankStr)
- GUI:setVisible(self.view.equip_jie_root, true)
- top_num = top_num + 1
- else
- GUI:setVisible(self.view.equip_jie_root, false)
- end
- end
- if not string.isNullOrEmpty(useLevelLimit) then
- self.level_is_can_use = false
- local level = SL:GetMetaValue(EMetaVarGetKey.LEVEL)
- local level_color = "#A52822"
- local level_str = ""
- if string.contains(useLevelLimit, "#") then
- local levelLimit = SL:Split(useLevelLimit, "#")
- if tonumber(levelLimit[1]) <= level and tonumber(levelLimit[2]) >= level then
- self.level_is_can_use = true
- end
- level_str = levelLimit[1] .. "~" .. levelLimit[2]
- else
- if tonumber(useLevelLimit) <= level then
- self.level_is_can_use = true
- end
- level_str = useLevelLimit
- end
- if self.level_is_can_use then
- level_color = "#C9C9C9"
- end
- if level_str ~= "0" then
- GUI:setVisible(self.view.equip_need_level_titlt, true)
- GUI:Text_setString(self.view.equip_need_level, level_str)
- GUI:Text_setTextColor(self.view.equip_need_level, level_color)
- top_num = top_num + 1
- else
- GUI:setVisible(self.view.equip_need_level, false)
- end
- end
- local job = SL:GetEquipValue(EMetaVarGetKey.EQUIP_NEED_CAREER, self.args.equip_pos, self.args.cfgId, self.args.id)
- self.need_career = self:GetCareer(job)
- local useAttLimit = SL:GetEquipValue(EMetaVarGetKey.EQUIP_WEAR_LIMIT, self.args.equip_pos, self.args.cfgId, self.args.id)
- self.useAttLimit_list = self:GetUseAttLimit(useAttLimit)
- local useAttLv = SL:GetConfig("cfg_equip_entryLib", self.args.cfgId).useAttLv
- if not useAttLv or useAttLv == 0 then
- GUI:setVisible(self.view.att_level_titlt, false)
- else
- top_num = top_num + 1
- GUI:setVisible(self.view.att_level_titlt, true)
- GUI:setVisible(self.view.att_need_level, true)
- GUI:Text_setString(self.view.att_need_level, tostring(useAttLv))
- local level = SL:GetMetaValue(EMetaVarGetKey.LEVEL)
- if level >= useAttLv then
- GUI:Text_setTextColor(self.view.att_level_titlt, "#C9C9C9")
- GUI:Text_setTextColor(self.view.att_need_level, "#C9C9C9")
- else
- GUI:Text_setTextColor(self.view.att_level_titlt, "#A52822")
- GUI:Text_setTextColor(self.view.att_need_level, "#A52822")
- end
- end
- ----属性需要排序
- local baseAttr = SL:GetEquipValue(EMetaVarGetKey.EQUIP_BASE_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
- local baseAttr = self:GetBaseAttr(baseAttr)
- local strengthen = 0
- local strengthenAttrList = {}
- if itemInfo then
- strengthen = EquipFunc.GetEquipStrengthLevel(itemInfo)
- if strengthen > 0 then
- strengthenAttrList = EquipFunc.GetEquipStrengthAttr(itemInfo)
- end
- end
- local strengthenAttr = {}
- if table.count(strengthenAttrList) > 0 then
- for i, v in ipairs(strengthenAttrList) do
- table.insert(strengthenAttr, { type = v[1], num = v[2] })
- end
- end
- if strengthen and strengthen > 0 then
- name = name .. " +" .. strengthen
- end
- GUI:Text_setString(self.view.equip_name, name)
- --local appendAttr = SL:GetEquipValue(EMetaVarGetKey.EQUIP_APPEND_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
- local appendAttr = {}
- local appendAttrList = {}
- if itemInfo then
- local appLevel = EquipFunc.GetEquipAppendLevel(itemInfo)
- if appLevel > 0 then
- appendAttrList = EquipFunc.GetEquipAppendAttr(itemInfo)
- if appendAttrList and table.count(appendAttrList) > 0 then
- for i, v in ipairs(appendAttrList) do
- table.insert(appendAttr, { type = v[1], num = v[2] })
- end
- end
- end
- end
- local originMagicAttrs = SL:GetEquipValue(EMetaVarGetKey.EQUIP_MAGIC_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
- --local skillGemIds = SL:GetEquipValue(EMetaVarGetKey.EQUIP_SKILL_ATTR,self.args.equip_pos,self.args.cfgId,self.args.id)
- local gemSkills = SL:GetEquipSkills(itemInfo)
- local luckAttrs = SL:GetEquipValue(EMetaVarGetKey.EQUIP_LUCK_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
- self.all_info = {}
- self.IsHaveStrengthen = false ---是否有强化属性
- self.all_att_sort_list = {}
- if table.count(baseAttr) > 0 then
- table.insert(self.all_att_sort_list, { attr_type = 1, data = baseAttr })
- end
- if strengthenAttr and table.count(strengthenAttr) > 0 then
- local Attr = self:GetBaseAttr(strengthenAttr)
- for i, v in ipairs(Attr) do
- v.name = "强化" .. v.name
- self.IsHaveStrengthen = true
- end
- if #Attr > 0 then
- table.insert(self.all_att_sort_list, { attr_type = 2, data = Attr })
- end
- end
- if appendAttr and table.count(appendAttr) > 0 then
- local Attr = self:GetBaseAttr(appendAttr)
- for i, v in ipairs(Attr) do
- v.name = "追加" .. v.name
- end
- table.insert(self.all_att_sort_list, { attr_type = 3, data = Attr })
- end
- if originMagicAttrs and table.count(originMagicAttrs) > 0 then
- local magicAttr = self:GetBaseAttr(originMagicAttrs)
- for i, v in ipairs(magicAttr) do
- table.insert(self.all_info, v)
- end
- end
- if gemSkills and table.count(gemSkills) > 0 then
- table.insert(self.all_info, { name = "装备技能", value = "" })
- for i, v in ipairs(gemSkills) do
- local skill_id = v.skillId
- local skill_name = SL:GetConfig("cfg_skill", skill_id).name
- ---@type cfg_skill_info_column
- local skill_info_tbl = SL:GetConfig("cfg_skill_info", skill_id, "skillID")
- table.insert(self.all_info, { name = string.format("%s(魔力:%s)", skill_name, skill_info_tbl.costMp), value = "" })
- end
- end
- if luckAttrs and table.count(luckAttrs) > 0 then
- table.insert(self.all_info, { title = "tips_attribute12" })
- local Attr = self:GetBaseAttr(luckAttrs)
- for i, v in ipairs(Attr) do
- v.color = "#50C2FD"
- table.insert(self.all_info, v)
- end
- end
- local entryAttr = SL:GetEquipValue(EMetaVarGetKey.EQUIP_ENTRY_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
- if entryAttr and table.count(entryAttr) > 0 then
- local Attr = self:GetBaseAttr(entryAttr)
- for i, v in ipairs(Attr) do
- if v.value and not string.isNullOrEmpty(v.value) then
- v.name = v.name .. "+" .. v.value
- v.value = ""
- end
- end
- table.insert(self.all_att_sort_list, { attr_type = 4, data = Attr })
- else
- --首充装备特殊处理
- if self.args.info and self.args.info.firstCharge and table.contains(self.firstCharge_list, self.args.cfgId) then
- local zhuo_att = SL:GetConfig("cfg_equip_entryLib", self.args.cfgId).att1
- local zhuo_yue_group = zhuo_att[1][1]
- local zhuo_att_list = SL:FindConfigs("cfg_equip_att", "group", zhuo_yue_group)
- local first_entryAttr = {}
- for ii, one_data in ipairs(zhuo_att_list) do
- local att_list = one_data.att[1]
- table.insert(first_entryAttr, { type = att_list[1], num = att_list[2] })
- end
- if first_entryAttr and table.count(first_entryAttr) > 0 then
- table.insert(self.all_info, { title = "tips_attribute3" })
- local Attr = self:GetBaseAttr(first_entryAttr)
- for i, v in ipairs(Attr) do
- if v.value and not string.isNullOrEmpty(v.value) then
- v.name = v.name .. "+" .. v.value
- v.value = ""
- end
- end
- table.insert(self.all_att_sort_list, { attr_type = 4, data = Attr })
- end
- end
- end
- local regenerateToAttr = SL:GetEquipValue(EMetaVarGetKey.EQUIP_REGENERATE_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
- if regenerateToAttr and table.count(regenerateToAttr) > 0 then
- local Attr = self:GetBaseAttr(regenerateToAttr)
- table.insert(self.all_att_sort_list, { attr_type = 7, data = Attr })
- end
- -- 大天使装备处理
- if SL:GetConfig("cfg_item", self.args.cfgId, "id").wearBarID[1] == EEquipWearBarType.Archange then
- local datianshi_att_list = {}
- table.insert(datianshi_att_list, { name = "攻击野外怪物即可获得经验值", value = "", color = "#e6e600", color_not_change = true })
- local levelInfo
- if self.args.id then
- levelInfo = InfoManager.archangeEquipInfo:GetEquipLevelInfo(self.args.id)
- if not levelInfo then
- levelInfo = self.otherArchange
- end
- end
- if levelInfo then
- -- 有信息的装备
- --local levelInfo = InfoManager.archangeEquipInfo:GetEquipLevelInfo(self.args.id)
- local arcLevel = levelInfo.level
- local exp = levelInfo.exp
- local _, maxLevel = InfoManager.archangeEquipInfo:GetMaxAtt(self.args.cfgId)
- local curRank = levelInfo.rank
- local curMaxLevel = InfoManager.archangeEquipInfo:GetMaxLevel(curRank, self.args.cfgId)
- ---该装备所在的组
- local group = SL:GetConfig("cfg_equip_angelGroup", self.args.cfgId, "id").angelEquipGroup
- ---@type cfg_equip_angelAtt_column
- local attTbl = SL:GetConfigTwoKeys("cfg_equip_angelAtt", group, arcLevel, "ornamentsGroup", "lv")
- local basicAtt = attTbl.basicAtt
- local levelinfo = tostring(exp) .. "/" .. tostring(attTbl.lvDeplete)
- self.archenge["maxExp"] = attTbl.lvDeplete
- self.archenge["isMaxLv"] = false
- table.insert(datianshi_att_list, { name = "当前阶数等级上限", value = tostring(curMaxLevel), color = "#e6e600", color_not_change = true })
- -- archenge类型仅为大天使装备的特殊处理,若使用进度条,请使用loadingbar类型,如:{loadingbar = { name = "lv." .. tostring(arcLevel), value = (exp / attTbl.lvDeplete) * 100, valueInfo = levelinfo }}
- if arcLevel == maxLevel then
- self.archenge["isMaxLv"] = true
- --该装备是否满级
- table.insert(datianshi_att_list, { name = "装备已成长至满级", value = "", color = "#1add1f", color_not_change = true })
- levelinfo = "已满级"
- table.insert(datianshi_att_list, { archenge = { name = "<color='#1add1f'>Lv." .. tostring(arcLevel) .. "</color>", value = 100, valueInfo = levelinfo, color_not_change = true } })
- else
- table.insert(datianshi_att_list, { archenge = { name = "<color='#1add1f'>Lv." .. tostring(arcLevel) .. "</color>", value = (exp / attTbl.lvDeplete) * 100, valueInfo = levelinfo, color_not_change = true } })
- end
- local maxAtt = nil
- local minAtt = nil
- for i, v in pairs(basicAtt) do
- if v[1] == 200011 then
- minAtt = v[2]
- elseif v[1] == 200021 then
- maxAtt = v[2]
- else
- table.insert(datianshi_att_list, { name = SL:GetConfig("cfg_att_info", v[1], "id").name, value = "+" .. tostring(v[2]), color = "#dce1e5" })
- end
- end
- if minAtt and maxAtt then
- table.insert(datianshi_att_list, { name = "攻击力", value = tostring(minAtt) .. "~" .. tostring(maxAtt), color = "#dce1e5" })
- end
- if arcLevel ~= maxLevel then
- table.insert(datianshi_att_list, { name = "<size=18>Lv." .. tostring(arcLevel + 1) .. "</size>", value = "<size=18>下一级效果</size>", color = "#ff2323", color_not_change = true })
- --不满级展示下一级
- arcLevel = arcLevel + 1
- ---该装备所在的组
- group = SL:GetConfig("cfg_equip_angelGroup", self.args.cfgId, "id").angelEquipGroup
- basicAtt = SL:GetConfigTwoKeys("cfg_equip_angelAtt", group, arcLevel, "ornamentsGroup", "lv").basicAtt
- maxAtt = nil
- minAtt = nil
- for i, v in pairs(basicAtt) do
- if v[1] == 200011 then
- minAtt = v[2]
- elseif v[1] == 200021 then
- maxAtt = v[2]
- else
- 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" })
- end
- end
- if minAtt and maxAtt then
- table.insert(datianshi_att_list, { name = "攻击力", value = tostring(minAtt) .. "~" .. tostring(maxAtt), color = "#999999",color_not_change=true })
- end
- end
- else
- -- 无任何信息
- table.insert(datianshi_att_list, { name = "满级属性", value = "", color = "#1add1f", color_not_change = true })
- local attList, _ = InfoManager.archangeEquipInfo:GetMaxAtt(self.args.cfgId)
- local maxAtt = nil
- local minAtt = nil
- for i, v in pairs(attList) do
- if v[1] == 200011 then
- minAtt = v[2]
- elseif v[1] == 200021 then
- maxAtt = v[2]
- else
- table.insert(datianshi_att_list, { name = SL:GetConfig("cfg_att_info", v[1], "id").name, value = "+" .. tostring(v[2]), color = "#dce1e5" })
- end
- end
- if minAtt and maxAtt then
- table.insert(datianshi_att_list, { name = "攻击力", value = tostring(minAtt) .. "~" .. tostring(maxAtt), color = "#dce1e5" })
- end
- end
- if table.count(datianshi_att_list) > 0 then
- table.insert(self.all_att_sort_list, { attr_type = 8, data = datianshi_att_list })
- end
- end
- local equipInfoList, suitEffect = SL:GetSuitEquipInfoList(self.args.cfgId)
- local color1 = "#e6e600"
- local color2 = "#999999"
- if equipInfoList and suitEffect then
- local all_suit = {}
- local suitIdList = SL:GetMetaValue(EMetaVarGetKey.GET_EQUIPSUIT_BY_ID, self.args.cfgId)
- local suitId = suitIdList[1]
- local suitName = SL:GetConfig("cfg_equip_suit", suitId).name
- local activeNUm = SL:GetSuitActiveCount(suitId)
- local allNUm = #equipInfoList
- suitName = suitName .. "(" .. activeNUm .. "/" .. allNUm .. ")"
- table.insert(all_suit, { name = suitName, value = "", color = "#D5811E", color_not_change = true })
- for i, v in ipairs(equipInfoList) do
- local _name = SL:GetConfig("cfg_item", v.cfgId).name
- local oneInfo = { name = _name, value = "" }
- if v.isActive then
- oneInfo.color = color1
- else
- oneInfo.color = color2
- oneInfo.color_not_change = true
- end
- table.insert(all_suit, oneInfo)
- end
- table.insert(all_suit, { name = "套装效果", value = "", color = "#D5811E", color_not_change = true })
- local Attr = self:GetAttr(suitEffect)
- for i, v in ipairs(Attr) do
- if v.isActive then
- v.color = color1
- else
- v.color = color2
- v.color_not_change = true
- end
- table.insert(all_suit, v)
- end
- table.insert(self.all_att_sort_list, { attr_type = 6, data = all_suit })
- end
- if itemInfo then
- local regenerateLevel = EquipFunc.GetEquipRegenerateLevel(itemInfo)
- if regenerateLevel > 0 then
- local regenerateAttr = EquipFunc.GetEquipRegenerateAttr(itemInfo)
- if regenerateAttr and table.count(regenerateAttr) > 0 then
- local Attr = self:GetBaseAttr(regenerateAttr)
- table.insert(self.all_att_sort_list, { attr_type = 7, data = Attr })
- end
- end
- end
- ---如果是首饰 特殊处理(能升级的首饰
- if SL:HasConfig('cfg_equip_ornamentsMain', self.args.cfgId) then
- local ornament_tbl = SL:GetConfig('cfg_equip_ornamentsMain', self.args.cfgId)
- if ornament_tbl then
- self:SetJewelryTips()
- end
- end
- ---大天使装备镶嵌的圣杯处理
- local archangeGrailInfo = InfoManager.archangeEquipInfo:GetEquipGrail(self.args.id)
- if self.otherArchange then
- archangeGrailInfo = self.otherArchange.grails
- end
- local shengbei = {}
- if self.args.id and not table.isNullOrEmpty(archangeGrailInfo) then
- local archangeGrailInfoSort = {}
- for i, v in pairs(archangeGrailInfo) do
- table.insert(archangeGrailInfoSort, { id = i, info = v })
- end
- table.sort(archangeGrailInfoSort, function(grailA, grailB)
- return grailA.info.grailPosition < grailB.info.grailPosition
- end)
- for i, v in pairs(archangeGrailInfoSort) do
- name = SL:GetConfig("cfg_item", v.info.itemConfigId, "id").name
- local strengthLv = 0
- if self.otherArchange then
- strengthLv = v.info.level
- else
- strengthLv = InfoManager.archangeEquipInfo:GetGrailStrengthLv(tonumber(v.id))
- end
- if strengthLv > 0 then
- name = name .. "+" .. tostring(strengthLv)
- end
- local color = E_ArchangelGrailQualityColor[SL:GetConfig("cfg_equip_angelGrail", v.info.itemConfigId, "id").grailQuality]
- table.insert(shengbei, { itemInfo = { itemId = v.info.itemConfigId, name = name, color = color } })
- end
- end
- if #shengbei > 0 then
- table.insert(self.all_att_sort_list, { attr_type = 9, data = shengbei })
- end
- self:GetGemAtt()
- --SL:LogTable(self.all_gem_att,true)
- if self.all_gem_att and #self.all_gem_att > 0 then
- local gem_att = self:GetBaseAttr(self.all_gem_att)
- table.insert(self.all_att_sort_list, { attr_type = 5, data = gem_att })
- end
- ----注意-----新加属性放到这里,然后在下面排序----------------------cfg_equip_tips----------------------------------
- ----拿到所有属性后进行排序
- table.sort(self.all_att_sort_list, function(a, b)
- local sort_a = SL:GetConfig("cfg_equip_tips", a.attr_type).sort
- local sort_b = SL:GetConfig("cfg_equip_tips", b.attr_type).sort
- return sort_a < sort_b
- end)
- ----排序后添加标题和设置颜色
- for i, one_data in ipairs(self.all_att_sort_list) do
- if table.count(one_data.data) > 0 then
- local one_tab = SL:GetConfig("cfg_equip_tips", one_data.attr_type)
- if one_tab.show and one_tab.show == 1 then
- local bg_str
- if not string.isNullOrEmpty(one_tab.bg) then
- bg_str = one_tab.bg
- end
- if not string.isNullOrEmpty(one_tab.picture) then
- table.insert(self.all_info, { is_title = true, title = one_tab.picture, bg = bg_str })
- elseif not string.isNullOrEmpty(one_tab.text) then
- local text_color = tostring(one_tab.textColor)
- table.insert(self.all_info, { is_title = true, name = one_tab.text, value = "", color = text_color, bg = bg_str })
- end
- for j, v in ipairs(one_data.data) do
- --设置属性颜色
- if not v.color_not_change then
- v.color = tostring(one_tab.attColor)
- if one_tab.attNameColor and not string.isNullOrEmpty(v.name) then
- local color_1 = SL:GetConfig("cfg_color",one_tab.attNameColor).color
- v.name = "<color=" .. color_1 .. ">" .. v.name .. "</color>"
- end
- end
- v.bg = one_tab.attBg
- table.insert(self.all_info, v)
- end
- end
- end
- end
- local bottomDesc = SL:GetMetaValue(EMetaVarGetKey.ITEM_BOTTOM_DESC, self.args.cfgId)
- if not string.isNullOrEmpty(bottomDesc) and modelHeight == 0 then
- table.insert(self.all_info, { name = "", value = "" })
- GUI:Text_setString(self.view.tem_info, bottomDesc)
- local x_1, y_1 = GUI:getSizeDelta(self.view.tem_info)
- table.insert(self.all_info, { info = bottomDesc, value = "", height = y_1 })
- end
- local tab_item = SL:GetConfig("cfg_item", self.args.cfgId, "id")
- local recoveryGroup = tab_item.recoveryGroup
- if recoveryGroup ~= 0 then
- local recoveryUp = tab_item.recoveryUp / 100
- local material = SL:GetConfig("cfg_recovery", recoveryGroup, "id").material
- if material then
- local materialList = material[1]
- local name1 = SL:GetConfig("cfg_item", materialList[1], "id").name
- local value1 = materialList[2] * (1 + recoveryUp)
- value1 = Mathf.Floor(value1)
- table.insert(self.all_info, { name = "回收价格:", value = value1 .. name1, color = "#756952" })
- end
- end
- top_num = top_num + #self.need_career + #self.useAttLimit_list
- if top_num < 4 then
- top_num = 4
- end
- local top_add = (top_num - 4) * 23
- --local middle_height = #self.all_info * 25
- local middle_height = 0
- for i, v in ipairs(self.all_info) do
- if v.is_title then
- middle_height = middle_height + 31
- elseif v.height then
- middle_height = middle_height + v.height
- else
- middle_height = middle_height + 22
- end
- end
- if middle_height < 100 then
- middle_height = 100
- end
- if middle_height > 205 then
- middle_height = 205
- end
- local all_add_height = top_add + middle_height
- local max_h = 355
- if all_add_height > max_h then
- middle_height = middle_height - (all_add_height - max_h)
- end
- local change_y = (max_h - middle_height) / 2
- change_y = Mathf.Floor(change_y)
- local top_y = 227 - change_y + top_add + (modelHeight / 2)
- local bottomDescHeightEnd = bottomDescHeight
- if bottomDescHeightEnd > 0 then
- bottomDescHeightEnd = bottomDescHeightEnd - 10--底部有文字情况下调整一下按钮和文字的间隙
- end
- local bottom_y = change_y - 275 - (modelHeight / 2) - (bottomDescHeightEnd / 2)
- local bg_height = middle_height + 295 + top_add + modelHeight
- local bg_y = Mathf.Floor(top_add / 2)
- GUI:setContentSize(self.view.info_view, 360, middle_height)
- GUI:setPositionY(self.view.equippaneltop, top_y)
- GUI:setPositionY(self.view.equippaneltop_bottom, bottom_y)
- GUI:setContentSize(self.view.panel_bg, 370, bg_height)
- GUI:setPositionY(self.view.panel_bg, bg_y)
- if modelHeight > 0 then
- --有模型的情况下调整一下属性栏位置
- local info_view_Y = GUI:getPositionY(self.view.info_view)
- GUI:setPositionY(self.view.info_view, info_view_Y + (modelHeight / 2))
- end
- --模型初始位置
- GUI:setPositionY(self.view.model1, -190)
- --守护处理
- if self.type == E_ItemType.Equip and self.subType == E_ItemSubType_Equip.ShouHu then
- local specialShowData = InfoManager.guardPetInfo:GetGuardSpecialShowData(self.args.cfgId)
- table.concatTable(self.all_info, specialShowData)
- local maxHp = SL:GetConfig("cfg_equip_guard", self.args.cfgId).hp
- local hp = InfoManager.guardPetInfo:GetGuardHp(self.args.id)
- GUI:Text_setTextColor(self.view.guardHp, "#ff8a00")
- hp = (hp == 0 and maxHp or hp)
- if maxHp == 0 then
- GUI:Text_setString(self.view.guardHp, "生命值:无限")
- else
- if hp then
- GUI:Text_setString(self.view.guardHp, string.format("生命值:%d/%d", hp, maxHp))
- end
- end
- GUI:setVisible(self.view.guardHp, true)
- GUI:setVisible(self.view.duanzaobtn, false)
- else
- GUI:setVisible(self.view.duanzaobtn, true)
- GUI:setVisible(self.view.guardHp, false)
- end
- if self.args.info and self.args.info.hideBtn then
- GUI:setVisible(self.view.bag_root, false)
- GUI:setVisible(self.view.equip_root, false)
- elseif self.args.equip_pos == "bag" or GUI:GetUI("dev/outui/Equip/Panel/KLEquipOverlay/KLEquipOverlayPanel") then
- GUI:setVisible(self.view.bag_root, true)
- GUI:setVisible(self.view.equip_root, false)
- self:bagBtnUpdate()
- elseif self.args.equip_pos == "depots" then
- GUI:setVisible(self.view.bag_root, true)
- GUI:setVisible(self.view.equip_root, false)
- self:depotsBtnUpdate()
- elseif self.args.equip_pos == "equip" then
- GUI:setVisible(self.view.equip_root, true)
- GUI:setVisible(self.view.bag_root, false)
- local wearBarId = SL:GetEquipValue(EMetaVarGetKey.EQUIP_WEAR_BAR_ID, nil, self.args.cfgId)
- if wearBarId[1] and wearBarId[1] > 2 then
- GUI:setVisible(self.view.duanzaobtn, false)
- elseif self.subType == 14 then
- GUI:setVisible(self.view.duanzaobtn, false)
- else
- GUI:setVisible(self.view.duanzaobtn, true)
- end
- if self.subType == 10 or self.subType == 11 or self.subType == 12 then
- GUI:setVisible(self.view.tuoxiabtn, false)
- GUI:setVisible(self.view.shengjibtn, true)
- else
- GUI:setVisible(self.view.tuoxiabtn, true)
- GUI:setVisible(self.view.shengjibtn, false)
- end
- if SL:GetConfig("cfg_item", self.args.cfgId, "id").wearBarID[1] == EEquipWearBarType.Archange then
- GUI:setVisible(self.view.breakbtn, true)
- else
- GUI:setVisible(self.view.breakbtn, false)
- end
- elseif self.args.equip_pos == "synthesis" then
- GUI:setVisible(self.view.left_btn, true)
- GUI:setVisible(self.view.right_btn, true)
- GUI:setVisible(self.view.equip_root, false)
- GUI:Button_setTitleText(self.view.left_btn, "取消")
- GUI:Button_setTitleText(self.view.right_btn, "替换")
- else
- GUI:setVisible(self.view.equip_root, false)
- GUI:setVisible(self.view.bag_root, false)
- --没有下方二个按钮的模型位置(equip_pos不是bag)
- GUI:setPositionY(self.view.model1, -220)
- end
- GUI:DataListUpdateData(self.view.equipzhiyeNeedData)
- GUI:DataListUpdateData(self.view.equipNeedData)
- GUI:DataListUpdateData(self.view.all_info_data)
- --if #self.left_all >0 then
- --GUI:DataListUpdateData(self.view.left_data_list)
- --end
- --if #self.right_all >0 then
- -- GUI:DataListUpdateData(self.view.right_data_list)
- --end
- if self.args.equip_pos ~= "equip" and not (self.args.info and self.args.info.hideComparsion) then
- local Comparsion_data = SL:GetCompareEquip(self.args.cfgId)
- if Comparsion_data and Comparsion_data.cfgId and Comparsion_data.id then
- --SL:OpenEquipTipsComparsion(Comparsion_data.cfgId, Comparsion_data.id)
- 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 })
- end
- end
- EquipFunc.tipsHeight = bg_height
- local bg_str = ""
- local item_bg_str = ""
- local bg_effect_id = 0
- local item_effect_id = 0
- if tab_item.itemTips and tab_item.itemTips ~= 0 then
- local style_tab = SL:GetConfig("cfg_tips_style",tab_item.itemTips)
- if not string.isNullOrEmpty(style_tab.background) then
- bg_str = style_tab.background
- end
- if not string.isNullOrEmpty(style_tab.itemBg) then
- item_bg_str = style_tab.itemBg
- end
- bg_effect_id = style_tab.borderEffect
- item_effect_id = style_tab.itemBorderEffect
- end
- if string.isNullOrEmpty(bg_str) then
- GUI:Image_loadTexture(self.view.panel_bg, "img_interface_main122", "Atlas/Common.spriteatlas")
- else
- GUI:Image_loadTexture(self.view.panel_bg, bg_str, "Atlas/UITips.spriteatlas")
- end
- --GUI:Image_loadTexture(self.view.panel_bg, bg_str, "Atlas/Common.spriteatlas")
- if string.isNullOrEmpty(item_bg_str) then
- GUI:setVisible(self.view.item_bg, false)
- else
- GUI:setVisible(self.view.item_bg, true)
- GUI:Image_loadTexture(self.view.item_bg, item_bg_str, "Atlas/UITips.spriteatlas")
- end
- if bg_effect_id and bg_effect_id ~= 0 then
- local effect_tbl = SL:GetConfig("cfg_model_effect",bg_effect_id)
- local m_y = 370/523 * bg_height
- m_y = math.floor( m_y )
- local mscale = "240,"..m_y..",1"
- GUI:Model_setSrc(self.view.bg_effect_model,effect_tbl.path,mscale)
- GUI:setVisible(self.view.bg_effect_model, true)
- else
- GUI:setVisible(self.view.bg_effect_model, false)
- end
- if item_effect_id and item_effect_id ~= 0 then
- local effect_tbl = SL:GetConfig("cfg_model_effect",bg_effect_id)
- GUI:Model_setSrc(self.view.item_effect_model,effect_tbl.path)
- GUI:setVisible(self.view.item_effect_model, true)
- else
- GUI:setVisible(self.view.item_effect_model, false)
- end
- end
- ---注册UI事件和服务器消息
- function this:RegistEvents()
- GUI:AddOnClickEvent(self.view.background_close, self, self.CloseEquipTips)
- GUI:AddOnClickEvent(self.view.left_btn, self, self.BtnLeftOnClick)
- GUI:AddOnClickEvent(self.view.right_btn, self, self.BtnRightOnClick)
- GUI:AddOnClickEvent(self.view.tuoxiabtn, self, self.TakeOffEquip)
- GUI:AddOnClickEvent(self.view.shengjibtn, self, self.ShengJi)
- GUI:AddOnClickEvent(self.view.duanzaobtn, self, self.ForgeOnClick)
- GUI:AddOnClickEvent(self.view.breakbtn, self, self.BreakOnClick)
- SL:RegisterLuaNetMsg(LuaMessageIdToClient.RES_ANGEL_EQUIPMENT_ATTR_INFO, self.RES_ANGEL_EQUIPMENT_ATTR_INFO, self) -- 大天使装备需要等一个回调
- SL:RegisterLUAEvent(LUA_EVENT_REFRESH_GEM_SLATE_INFO, self.LUA_EVENT_REFRESH_GEM_SLATE_INFO, self)
- end
- function this:CloseEquipTips()
- GUI:UIPanel_Close("dev/ui/Tips/Panel/KLUIEquipTips/KLUIEquipTipsPanel")
- GUI:UIPanel_Close("dev/ui/Tips/Panel/KLUIEquipTipsComparsion/KLUIEquipTipsComparsionPanel")
- local itemGetPathPanel = GUI:GetUI("dev/ui/Common/Panel/KLItemGetPath/KLItemGetPathPanel")
- if itemGetPathPanel then
- GUI:UIPanel_Close("dev/ui/Common/Panel/KLItemGetPath/KLItemGetPathPanel")
- end
- end
- function this:Close()
- if self.Schedule1 then
- SL:UnSchedule(self.Schedule1)
- end
- end
- function this:SetLiuGuang(equipInfo)
- local liuGuangId = nil
- if equipInfo then
- liuGuangId = EquipFunc.GetEquipLiuGuangId(equipInfo)
- end
- if liuGuangId then
- GUI:SetStreamAttr(self.view.equip_tips_item, liuGuangId)
- else
- GUI:ResetStreamAttr(self.view.equip_tips_item)
- end
- end
- function this:GetCareer(job)
- local all_career = {}
- if job and table.count(job) > 0 then
- local i = 1
- while i <= table.count(job) do
- local str = ""
- local t_str = ""
- if i == 1 then
- t_str = "需要职业:"
- end
- local baseCareer = job[i][1]
- local careerLevel = job[i][2]
- local tbl = SL:GetConfigMultiKeys('cfg_career',
- baseCareer,
- careerLevel,
- 'baseCareer',
- 'careerRank'
- )
- if baseCareer == SL:MeData_GetCareer().baseCareer and SL:MeData_GetCareer().careerRank >= careerLevel then
- str = str .. "<color=#C9C9C9>" .. tbl.name .. "</color>"
- else
- str = str .. "<color=#A52822>" .. tbl.name .. "</color>"
- end
- if string.len(tbl.name) >= 15 then
- table.insert(all_career, { title = t_str, name = str })
- i = i + 1
- else
- if job[i + 1] then
- local baseCareer2 = job[i + 1][1]
- local careerLevel2 = job[i + 1][2]
- local tbl2 = SL:GetConfigMultiKeys('cfg_career',
- baseCareer2,
- careerLevel2,
- 'baseCareer',
- 'careerRank'
- )
- if baseCareer2 == SL:MeData_GetCareer().baseCareer and SL:MeData_GetCareer().careerRank >= careerLevel2 then
- str = str .. "<color=#C9C9C9> " .. tbl2.name .. "</color>"
- else
- str = str .. "<color=#A52822> " .. tbl2.name .. "</color>"
- end
- end
- table.insert(all_career, { title = t_str, name = str })
- i = i + 2
- end
- end
- end
- return all_career
- end
- function this:NeedCareerDataListItemCountFunc()
- return #self.need_career
- end
- function this:NeedCareerDataListItemGetFunc(realIndex)
- end
- function this:NeedCareerDataListItemInitFunc(realIndex, kmlcontrol)
- end
- function this:NeedCareerDataListItemUpdateFunc(realIndex, kmlcontrol)
- local career = self.need_career[realIndex + 1]
- local title = GUI:GetChildControl(self.view.equipzhiyeNeedData, realIndex, "title")
- GUI:Text_setString(title, career.title)
- local name = GUI:GetChildControl(self.view.equipzhiyeNeedData, realIndex, "name")
- GUI:Text_setString(name, career.name)
- end
- function this:GetUseAttLimit(useAttLimit)
- local useAttLimit_list = {}
- self.useAttLimit = {}
- if useAttLimit and table.count(useAttLimit) > 0 then
- for i, v in ipairs(useAttLimit) do
- local attId = v[1]
- local attValue = v[2]
- local my_attValue = SL:MeData_GetSpecialAttrValue(attId)
- local name = SL:GetConfig("cfg_att_info", attId).name
- local name_str = "所需" .. name .. ":"
- local value_str = ""
- local entryAttr = SL:GetEquipValue(EMetaVarGetKey.EQUIP_ENTRY_ATTR, self.args.equip_pos, self.args.cfgId, self.args.id)
- local offsetValue = self:GetAttrValueOffset(attId, attValue, entryAttr)
- self.useAttLimit[attId] = -offsetValue
- attValue = attValue - offsetValue
- if my_attValue >= attValue then
- value_str = tostring(attValue)
- else
- local add_value = attValue - my_attValue
- name_str = "<color=#A52822>" .. name_str .. "</color>"
- value_str = "<color=#A52822>" .. attValue .. "(还需" .. add_value .. ")" .. "</color>"
- end
- if attValue ~= 0 then
- table.insert(useAttLimit_list, { name = name_str, value = value_str })
- end
- end
- end
- return useAttLimit_list
- end
- function this:NeedDataListItemCountFunc()
- return #self.useAttLimit_list
- end
- function this:NeedDataListItemGetFunc(realIndex)
- end
- function this:NeedDataListItemInitFunc(realIndex, kmlcontrol)
- end
- function this:NeedDataListItemUpdateFunc(realIndex, kmlcontrol)
- local data = self.useAttLimit_list[realIndex + 1]
- local name = GUI:GetChildControl(self.view.equipNeedData, realIndex, "name")
- GUI:Text_setString(name, data.name)
- local value = GUI:GetChildControl(self.view.equipNeedData, realIndex, "value")
- GUI:Text_setString(value, data.value)
- end
- function this:GetBaseAttr(baseAttr)
- local baseAttrList = {}
- if not baseAttr then
- return baseAttrList
- end
- local max1
- local min1
- local max2
- local min2
- local max3
- local min3
- local max4
- local min4
- local max5
- local min5
- for i, v in ipairs(baseAttr) do
- if v.type == 201011 then
- max1 = v
- elseif v.type == 201021 then
- min1 = v
- elseif v.type == 202011 then
- max2 = v
- elseif v.type == 202021 then
- min2 = v
- elseif v.type == 205021 then
- max3 = v
- elseif v.type == 205011 then
- min3 = v
- elseif v.type == 203021 then
- max4 = v
- elseif v.type == 203011 then
- min4 = v
- elseif v.type == 200011 then
- min5 = v
- elseif v.type == 200021 then
- max5 = v
- end
- end
- if max1 and min1 then
- local _value = min1.num .. "~" .. max1.num
- table.insert(baseAttrList, { name = "攻击力", value = _value })
- end
- if max2 and min2 then
- local _value = min2.num .. "~" .. max2.num
- table.insert(baseAttrList, { name = "魔法攻击力", value = _value })
- end
- if max3 and min3 then
- local _value = min3.num .. "~" .. max3.num
- table.insert(baseAttrList, { name = "诅咒攻击力", value = _value })
- end
- if max4 and min4 then
- local _value = min4.num .. "~" .. max4.num
- table.insert(baseAttrList, { name = "天鹰攻击力", value = _value })
- end
- if max5 and min5 then
- local _value = min5.num .. "~" .. max5.num
- table.insert(baseAttrList, { name = "攻击力", value = _value })
- end
- for i, v in ipairs(baseAttr) do
- 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
- else
- local _name = SL:GetConfig("cfg_att_info", v.type).name
- local _value = self:GetAttrValue(v.type, v.num)
- if self:chenckAttrShow(v.type) then
- if not self:chenckAttrValue(v.type) then
- _value = ""
- end
- table.insert(baseAttrList, { name = _name, value = _value, type = v.type })
- end
- end
- end
- return baseAttrList
- end
- function this:GetAttr(baseAttr)
- local baseAttrList = {}
- if not baseAttr then
- return baseAttrList
- end
- for i, one in pairs(baseAttr) do
- for j, v in ipairs(one) do
- local nameAttr = SL:GetConfig("cfg_att_info", v.attId).name
- local _value = self:GetAttrValue(v.attId, v.attNum)
- if self:chenckAttrShow(v.attId) then
- _value = nameAttr .. "+" .. _value
- if not self:chenckAttrValue(v.attId) then
- _value = nameAttr
- end
- local _name = i .. "件套效果"
- table.insert(baseAttrList, { name = _name, value = _value, isActive = v.isActive })
- end
- end
- end
- return baseAttrList
- end
- function this:chenckAttrShow(attId)
- return true
- end
- function this:chenckAttrValue(attId)
- local attShow = SL:GetConfig("cfg_att_info", attId).attShow
- if attShow == 1 then
- return true
- end
- return false
- end
- function this:GetAttrValue(attId, attValue)
- local remarks = SL:GetConfig("cfg_att_info", attId).remarks
- if remarks == 1 then
- return tostring(attValue)
- else
- local value = attValue / 100
- local value_str = value .. "%"
- return value_str
- end
- end
- function this:EquipAttrDataListItemCountFunc()
- return #self.all_info
- end
- function this:EquipAttrDataListItemGetFunc(realIndex)
- end
- function this:EquipAttrDataListItemInitFunc(realIndex, kmlcontrol)
- end
- function this:EquipAttrDataListItemUpdateFunc(realIndex, kmlcontrol)
- local data = self.all_info[realIndex + 1]
- local root = GUI:GetChildControl(self.view.all_info_data, realIndex, "root")
- local title = GUI:GetChildControl(self.view.all_info_data, realIndex, "title")
- local di = GUI:GetChildControl(self.view.all_info_data, realIndex, "di")
- local value = GUI:GetChildControl(self.view.all_info_data, realIndex, "value")
- local desc = GUI:GetChildControl(self.view.all_info_data, realIndex, "desc")
- local more_info = GUI:GetChildControl(self.view.all_info_data, realIndex, "more_info")
- local loading_name = GUI:GetChildControl(self.view.all_info_data, realIndex, "loading_name")
- local info_loadingbar = GUI:GetChildControl(self.view.all_info_data, realIndex, "info_loadingbar")
- local loadingbar_text = GUI:GetChildControl(self.view.all_info_data, realIndex, "loadingbar_text")
- local item = GUI:GetChildControl(self.view.all_info_data, realIndex, "item")
- local itemname = GUI:GetChildControl(self.view.all_info_data, realIndex, "itemname")
- if data.bg and not string.isNullOrEmpty(data.bg) then
- GUI:Image_loadTexture(di, data.bg, "Atlas/UIEquipInfoPanel.spriteatlas")
- else
- GUI:Image_loadTexture(di, "img_tips_shuxing_di", "Atlas/UIEquipInfoPanel.spriteatlas")
- end
- if data.is_title then
- GUI:setContentSize(root, 350, 25)
- GUI:setVisible(item, false)
- GUI:setVisible(itemname, false)
- GUI:setVisible(di, true)
- GUI:setVisible(desc, false)
- GUI:setVisible(more_info, false)
- GUI:setVisible(info_loadingbar, false)
- GUI:setVisible(loading_name, false)
- if not string.isNullOrEmpty(data.title) then
- GUI:setVisible(title, true)
- GUI:Image_loadTexture(title, data.title, "Atlas/TipsAttTitle.spriteatlas")
- GUI:setVisible(value, false)
- else
- GUI:setVisible(title, false)
- GUI:setVisible(value, true)
- local _name = nil
- if not string.isNullOrEmpty(data.name) then
- _name = data.name
- else
- _name = ""
- end
- local _value = nil
- if not string.isNullOrEmpty(data.value) then
- _value = data.value
- else
- _value = ""
- end
- local value_str = _name .. " " .. _value
- GUI:Text_setString(value, value_str)
- if data.color then
- GUI:Text_setTextColor(value, data.color)
- end
- end
- elseif data.info then
- GUI:setContentSize(root, 350, data.height)
- GUI:setVisible(title, false)
- GUI:setVisible(item, false)
- GUI:setVisible(itemname, false)
- GUI:setVisible(di, false)
- GUI:setVisible(value, false)
- GUI:setVisible(more_info, true)
- GUI:setVisible(info_loadingbar, false)
- GUI:setVisible(loading_name, false)
- GUI:Text_setString(more_info, data.info)
- elseif data.loadingbar then
- GUI:setContentSize(root, 350, 25)
- GUI:setVisible(title, false)
- GUI:setVisible(item, false)
- GUI:setVisible(itemname, false)
- GUI:setVisible(di, false)
- GUI:setVisible(value, false)
- GUI:setVisible(more_info, false)
- GUI:setVisible(info_loadingbar, true)
- GUI:setVisible(loading_name, true)
- GUI:Text_setString(loading_name, data.loadingbar.name) -- 进度条前方文字
- GUI:Text_setString(loadingbar_text, data.loadingbar.valueInfo) -- 进度条上方文字
- GUI:SetLoadingbar_startper(info_loadingbar, data.loadingbar.value) -- 百分制
- elseif data.archenge then
- -- 大天使装备的特殊处理,已保证只执行一次!!!
- GUI:setContentSize(root, 350, 25)
- GUI:setVisible(title, false)
- GUI:setVisible(item, false)
- GUI:setVisible(itemname, false)
- GUI:setVisible(di, false)
- GUI:setVisible(value, false)
- GUI:setVisible(more_info, false)
- GUI:setVisible(info_loadingbar, true)
- GUI:setVisible(loading_name, true)
- self.archenge.loadingbar = info_loadingbar
- self.archenge.valueInfo = loadingbar_text
- self.archenge.loading_name = loading_name
- GUI:Text_setString(loading_name, data.archenge.name) -- 进度条前方文字
- GUI:Text_setString(loadingbar_text, data.archenge.valueInfo) -- 进度条上方文字
- GUI:SetLoadingbar_startper(info_loadingbar, data.archenge.value) -- 百分制
- --此协议为大天使装备的特殊处理,已保证只发送一次
- if (not self.args.info or not self.args.info.otherRid) and not self.archenge.isMaxLv then
- SL:SendLuaNetMsg(LuaMessageIdToSever.REQ_ANGEL_EQUIP_ATTR, { itemId = self.args.id, itemConfigId = self.args.cfgId })
- end
- elseif data.itemInfo then
- GUI:setVisible(title, false)
- GUI:setVisible(item, true)
- GUI:setVisible(itemname, true)
- GUI:setVisible(di, false)
- GUI:setVisible(value, false)
- GUI:setVisible(more_info, false)
- GUI:setVisible(info_loadingbar, false)
- GUI:setVisible(loading_name, false)
- GUI:Item_setItemId(item, data.itemInfo.itemId)
- GUI:Text_setTextColor(itemname, data.itemInfo.color)
- GUI:Text_setString(itemname, data.itemInfo.name)
- else
- GUI:setContentSize(root, 350, 16)
- GUI:setVisible(title, false)
- GUI:setVisible(value, true)
- GUI:setVisible(item, false)
- GUI:setVisible(itemname, false)
- GUI:setVisible(more_info, false)
- GUI:setVisible(info_loadingbar, false)
- GUI:setVisible(loading_name, false)
- if string.isNullOrEmpty(data.bg) then
- GUI:setVisible(di, false)
- else
- GUI:setVisible(di, true)
- end
- local _name = nil
- if not string.isNullOrEmpty(data.name) then
- _name = data.name
- else
- _name = ""
- end
- local _value = nil
- if not string.isNullOrEmpty(data.value) then
- _value = data.value
- else
- _value = ""
- end
- local value_str = _name .. " " .. _value
- GUI:Text_setString(value, value_str)
- if data.color then
- GUI:Text_setTextColor(value, data.color)
- end
- if data.desc then
- GUI:setVisible(desc, true)
- GUI:Text_setString(desc, data.desc)
- end
- if data.descColor then
- GUI:Text_setTextColor(desc, data.descColor)
- end
- end
- end
- function this:depotsBtnUpdate()
- GUI:setVisible(self.view.left_btn, true)
- GUI:Button_setTitleText(self.view.left_btn, "丢弃")
- GUI:setVisible(self.view.right_btn, true)
- GUI:Button_setTitleText(self.view.right_btn, "取出")
- end
- function this:bagBtnUpdate()
- local leftButton = SL:GetEquipValue(EMetaVarGetKey.EQUIP_TIPS_LEFT_BUTTON, self.args.equip_pos, self.args.cfgId, self.args.id)
- local rightButton = SL:GetEquipValue(EMetaVarGetKey.EQUIP_TIPS_RIGHT_BUTTON, self.args.equip_pos, self.args.cfgId, self.args.id)
- local isDelete = SL:GetConfig("cfg_item", self.args.cfgId).isDelete
- self.left_all = {}
- self.left_all_item = {}
- for i, v in ipairs(leftButton) do
- -- for j, btn_type in ipairs(v) do
- -- if btn_type == "9" and isDelete == 0 then
- -- else
- -- table.insert(self.left_all, btn_type)
- -- end
- -- end
- local btn_type = v[1]
- if btn_type == "9" and isDelete == 0 then
- else
- table.insert(self.left_all, v)
- end
- end
- self.right_all = {}
- self.right_all_item = {}
- for i, v in ipairs(rightButton) do
- -- for j, btn_type in ipairs(v) do
- -- if btn_type == "9" and isDelete == 0 then
- -- else
- -- table.insert(self.right_all, btn_type)
- -- end
- -- end
- local btn_type = v[1]
- if btn_type == "9" and isDelete == 0 then
- else
- table.insert(self.right_all, v)
- end
- end
- self.left_is_open = false
- if #self.left_all < 1 then
- GUI:setVisible(self.view.left_btn, false)
- elseif #self.left_all == 1 then
- GUI:setVisible(self.view.left_btn, true)
- local str = self:getBtnName(self.left_all[1])
- GUI:Button_setTitleText(self.view.left_btn, str)
- else
- GUI:setVisible(self.view.left_btn, true)
- GUI:Button_setTitleText(self.view.left_btn, "更多")
- GUI:DataListInitData(self.view.left_data_list, function()
- return self:LeftDataListItemCountFunc()
- end, function(realIndex)
- return self:LeftDataListItemGetFunc(realIndex)
- end, function(realIndex, kmlcontrol)
- return self:LeftDataListItemInitFunc(realIndex, kmlcontrol)
- end, function(realIndex, kmlcontrol)
- return self:LeftDataListItemUpdateFunc(realIndex, kmlcontrol)
- end)
- end
- self.right_is_open = false
- if GUI:GetUI("dev/ui/Bag/Panel/KLDepots/KLDepotsPanel") then
- GUI:setVisible(self.view.right_btn, true)
- GUI:Button_setTitleText(self.view.right_btn, "放入")
- return
- end
- if GUI:GetUI("dev/outui/Equip/Panel/KLEquipOverlay/KLEquipOverlayPanel") then
- GUI:setVisible(self.view.left_btn, false)
- GUI:setVisible(self.view.right_btn, true)
- GUI:Button_setTitleText(self.view.right_btn, "放置")
- return
- end
- if #self.right_all < 1 then
- GUI:setVisible(self.view.right_btn, false)
- elseif #self.right_all == 1 then
- GUI:setVisible(self.view.right_btn, true)
- local str = self:getBtnName(self.right_all[1])
- GUI:Button_setTitleText(self.view.right_btn, str)
- else
- GUI:setVisible(self.view.right_btn, true)
- GUI:Button_setTitleText(self.view.right_btn, "更多")
- GUI:DataListInitData(self.view.right_data_list, function()
- return self:RightDataListItemCountFunc()
- end, function(realIndex)
- return self:RightDataListItemGetFunc(realIndex)
- end, function(realIndex, kmlcontrol)
- return self:RightDataListItemInitFunc(realIndex, kmlcontrol)
- end, function(realIndex, kmlcontrol)
- return self:RightDataListItemUpdateFunc(realIndex, kmlcontrol)
- end)
- end
- end
- function this:BtnLeftOnClick()
- if self.args.equip_pos == "depots" then
- local storeIndex = SL:GetDepotsIndex(self.args.id)
- SL:ReqStoreGiveUpItemMessage(storeIndex)
- self:CloseEquipTips()
- return
- end
- --合成
- if self.args.equip_pos == "synthesis" then
- self:CloseEquipTips()
- return
- end
- if #self.left_all < 1 then
- elseif #self.left_all == 1 then
- local btnType = self.left_all[1][1]
- if not InfoManager.equipOrItemTipsInfo:IsCanOnClickButton(self.left_all[1]) then
- return
- end
- if btnType == "0" then
- self:CloseEquipTips()
- elseif btnType == "2" then
- self:CloseEquipTips()
- elseif btnType == "3" then
- self:PutOneEquip()
- elseif btnType == "9" then
- local name = SL:GetEquipValue(EMetaVarGetKey.EQUIP_NAME, self.args.equip_pos, self.args.cfgId, self.args.id)
- SL:CommonTipsMessage({ showTips = "是否摧毁" .. name,
- ui = self,
- sureBtnText = "确定",
- cancelBtnText = "取消",
- callback = self.DestroyItem
- })
- elseif btnType == "10" then
- self:JieFeng()
- elseif btnType == "11" then
- self:DiuQi()
- elseif btnType == "13" then
- self:Decompose()
- elseif btnType == "99" then
- self:OpenPanel(self.left_all[1])
- end
- else
- if not self.left_is_open then
- GUI:setVisible(self.view.left_btn_content, true)
- self.left_is_open = true
- GUI:DataListUpdateData(self.view.left_data_list)
- else
- GUI:setVisible(self.view.left_btn_content, false)
- self.left_is_open = false
- end
- end
- end
- function this:PutOneEquip()
- local ItemInfo = SL:GetPosItemInfo(self.args.equip_pos, self.args.cfgId, self.args.id)
- SL:SetMetaValue(EMetaVarSetKey.SET_ROLE_ATTR_VALUE_OFFSET, self.useAttLimit)
- if SL:CheckEquipWear(ItemInfo) == 1 then
- SL:PutOnEquip(ItemInfo)
- else
- SL:SetMetaValue(EMetaVarSetKey.SET_ROLE_ATTR_VALUE_OFFSET, self.useAttLimit)
- SL.Equip:ShowCantEquipTip(ItemInfo)
- end
- self:CloseEquipTips()
- end
- function this.DestroyItem(returnData)
- local ui = returnData.ui
- local index = SL:GetBagIndex(ui.args.id)
- SL:ReqDestroyItemMessage(index)
- ui:CloseEquipTips()
- end
- function this:JieFeng()
- self:CloseEquipTips()
- end
- function this:DiuQi()
- if self.args.equip_pos == "depots" then
- local storeIndex = SL:GetDepotsIndex(self.args.id)
- SL:ReqStoreGiveUpItemMessage(storeIndex)
- else
- local index = SL:GetBagIndex(self.args.id)
- SL:ReqGiveUpItemMessage(index)
- end
- self:CloseEquipTips()
- end
- function this:Decompose()
- self:CloseEquipTips()
- GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
- GUI:UIPanel_Close("dev/ui/Equip/Panel/KLEquipUI/KLEquipUIPanel")
- SL:OpenForgeGroupUI(EForgeGroupType.Decompose)
- end
- function this:TakeOffEquip()
- if not self.args.id then
- return
- end
- local panel = GUI:GetUI("dev/outui/Mount/Panel/KLMountEquip/KLMountEquipPanel")
- if panel then
- ---@type cfg_item_column
- local tbl = SL:GetConfig("cfg_item", self.args.cfgId, "id")
- SL:SendLuaNetMsg(LuaMessageIdToSever.REQ_MOUNT_TAKE_OFF_ITEM, { self.args.mountId, tbl.subType })
- else
- local wearBarId, pos = SL:GetEquipWearBarIdPos(self.args.id)
- SL:TakeOffEquip(wearBarId, pos)
- end
- self:CloseEquipTips()
- end
- function this:ShengJi()
- if not InfoManager.equipOrItemTipsInfo:IsCanOnClickButton("", 10407) then
- return
- end
- self:CloseEquipTips()
- GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
- GUI:UIPanel_Close("dev/ui/Equip/Panel/KLEquipUI/KLEquipUIPanel")
- SL:OpenForgeGroupUI(EForgeGroupType.Jewelry)
- end
- function this:ForgeOnClick()
- if not InfoManager.equipOrItemTipsInfo:IsCanOnClickButton("", 10401) then
- return
- end
- self:CloseEquipTips()
- GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
- GUI:UIPanel_Close("dev/ui/Equip/Panel/KLEquipUI/KLEquipUIPanel")
- local wearBarId, pos = SL:GetEquipWearBarIdPos(self.args.id)
- SL:OpenForgeGroupUI(EForgeGroupType.Strength, pos)
- end
- function this:BreakOnClick()
- self:CloseEquipTips()
- GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
- GUI:UIPanel_Close("dev/ui/Equip/Panel/KLEquipUI/KLEquipUIPanel")
- GUI:UIPanel_Open("dev/outui/Archangel/Panel/KLArchangelGroup/KLArchangelGroupPanel", nil, nil, { selectId = self.args.cfgId })
- end
- function this:getBtnName(data)
- local btn_type = data[1]
- if btn_type == "0" then
- return "取消"
- elseif btn_type == "1" then
- return "使用"
- elseif btn_type == "2" then
- return "回收"
- elseif btn_type == "3" then
- return "穿戴"
- elseif btn_type == "4" then
- return "强化"
- elseif btn_type == "5" then
- return "上架"
- elseif btn_type == "6" then
- return "合并"
- elseif btn_type == "7" then
- return "拆分"
- elseif btn_type == "8" then
- return "批量使用"
- elseif btn_type == "9" then
- return "摧毁"
- elseif btn_type == "10" then
- return "解封"
- elseif btn_type == "11" then
- return "丢弃"
- elseif btn_type == "13" then
- return "分解"
- elseif btn_type == "14" then
- return "装备"
- elseif btn_type == "99" then
- return data[2]
- end
- return ""
- end
- function this:LeftDataListItemCountFunc()
- return #self.left_all
- end
- function this:LeftDataListItemGetFunc(realIndex)
- local data = self.left_all[realIndex + 1]
- local str = self:getBtnName(data)
- local message = { equip_pos = self.args.equip_pos, cfgId = self.args.cfgId, id = self.args.id, btnType = data, nameStr = str }
- local item = GUI:UIPanel_Open("dev/ui/Tips/Item/KLUITips/KLTipBtntem", self.view.left_data_list, self, message, true)
- self.left_all_item[item.view.root] = item
- return item.view.root
- end
- function this:LeftDataListItemInitFunc(realIndex, kmlcontrol)
- end
- function this:LeftDataListItemUpdateFunc(realIndex, kmlcontrol)
- end
- function this:BtnRightOnClick()
- if self.args.equip_pos == "depots" then
- local storeIndex = SL:GetDepotsIndex(self.args.id)
- SL.Equip:ReqStoreTakeButtonMessage(storeIndex)
- self:CloseEquipTips()
- return
- end
- local depotPanel = GUI:GetUI("dev/ui/Bag/Panel/KLDepots/KLDepotsPanel")
- if depotPanel then
- local BagIndex = SL:GetBagIndex(self.args.id)
- if depotPanel.bagType == "privilege" then
- SL.Equip:ReqBagPutStoreButtonMessage(BagIndex, SL:GetDepotsCurPage() + depotPanel.maxDepotsPages)
- else
- SL.Equip:ReqBagPutStoreButtonMessage(BagIndex, SL:GetDepotsCurPage())
- end
- self:CloseEquipTips()
- return
- end
- --叠加
- local overlay = GUI:GetUI("dev/outui/Equip/Panel/KLEquipOverlay/KLEquipOverlayPanel")
- if overlay then
- overlay:SelectItem(self.args.equip_pos, self.args.cfgId, self.args.id)
- self:CloseEquipTips()
- return
- end
- --合成
- if self.args.equip_pos == "synthesis" then
- SL:onLUAEvent(LUA_EVENT_TIPS_ONCLICK_REPLACE)
- self:CloseEquipTips()
- return
- end
- if #self.right_all < 1 then
- elseif #self.right_all == 1 then
- local btnType = self.right_all[1][1]
- if not InfoManager.equipOrItemTipsInfo:IsCanOnClickButton(self.right_all[1]) then
- return
- end
- if btnType == "0" then
- self:CloseEquipTips()
- elseif btnType == "1" then
- self:UseItem()
- elseif btnType == "2" then
- self:CloseEquipTips()
- elseif btnType == "3" then
- self:PutOneEquip()
- elseif btnType == "9" then
- SL:CommonTipsMessage({ showTips = "是否摧毁" .. name,
- ui = self,
- sureBtnText = "确定",
- cancelBtnText = "取消",
- callback = self.DestroyItem
- })
- elseif btnType == "10" then
- self:JieFeng()
- elseif btnType == "11" then
- self:DiuQi()
- elseif btnType == "13" then
- self:Decompose()
- elseif btnType == "14" then
- --准备坐骑道具
- local panel = GUI:GetUI("dev/outui/Mount/Panel/KLMountEquip/KLMountEquipPanel")
- if panel then
- local BagIndex = SL:GetBagIndex(self.args.id)
- ---@type cfg_item_column
- local tbl = SL:GetConfig("cfg_item", self.args.cfgId, "id")
- SL:SendLuaNetMsg(LuaMessageIdToSever.REQ_MOUNT_PUT_ON_ITEM, { self.args.mountId, BagIndex, tbl.subType, self.args.cfgId, self.args.id })
- else
- GUI:UIPanel_Open("dev/outui/Mount/Panel/KLMountStore/KLMountStorePanel", nil, nil)
- GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
- end
- self:CloseEquipTips()
- elseif btnType == "99" then
- self:OpenPanel(self.right_all[1])
- end
- else
- if not self.right_is_open then
- GUI:setVisible(self.view.right_btn_content, true)
- self.right_is_open = true
- GUI:DataListUpdateData(self.view.right_data_list)
- else
- GUI:setVisible(self.view.right_btn_content, false)
- self.right_is_open = false
- end
- end
- end
- function this:UseItem()
- ---@type cfg_item_column
- local itemTbl = SL:GetConfig("cfg_item", self.args.cfgId)
- SL:UseItem(self.args.cfgId, self.args.id, self.args.count)
- self:CloseEquipTips()
- if itemTbl.type == E_ItemType.TriggerItem and itemTbl.subType == E_OutTriggerItemType.TransferRing then
- GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
- SL.HideMainPanel()
- --守护处理,跳转到外观守护界面
- GUI:UIPanel_Open("dev/outui/AppearGroup/Panel/KLAppearGroup/KLAppearGroupPanel", nil, nil, E_FashionType.TransferRing)
- SL:ScheduleOnce(0.3, function()
- SL:onLUAEvent(TRANSFER_RING_SELECT_ITEM, self.args.cfgId)
- end)
- elseif itemTbl.type == E_ItemType.TriggerItem and itemTbl.subType == E_OutTriggerItemType.GuardSkin then
- GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
- SL.HideMainPanel()
- --守护处理,跳转到外观守护界面
- GUI:UIPanel_Open("dev/outui/AppearGroup/Panel/KLAppearGroup/KLAppearGroupPanel", nil, nil, E_FashionType.Appear)
- SL:ScheduleOnce(0.3, function()
- SL:onLUAEvent(APPEAR_SELECT_ITEM, self.args.cfgId)
- end)
- end
- end
- function this:OpenPanel(btnType)
- if #btnType < 3 then
- return
- end
- self:CloseEquipTips()
- GUI:UIPanel_Close("dev/ui/Bag/Panel/KLUIBag/KLUIBagPanel")
- GUI:UIPanel_Close("dev/ui/Equip/Panel/KLEquipUI/KLEquipUIPanel")
- local panel = btnType[4]
- if #btnType == 4 then
- GUI:UIPanel_Open(panel)
- elseif #btnType == 5 then
- local num = btnType[5]
- if tonumber(num) then
- num = tonumber(num)
- end
- GUI:UIPanel_Open(panel, nil, nil, num)
- elseif #btnType >= 7 then
- local message = {}
- for i = 5, #btnType - 2, 3 do
- if btnType[i] and btnType[i + 1] and btnType[i + 2] then
- if btnType[i + 1] == "string" then
- message[btnType[i]] = btnType[i + 2]
- else
- message[btnType[i]] = tonumber(btnType[i + 2])
- end
- end
- end
- GUI:UIPanel_Open(panel, nil, nil, message)
- end
- SL.HideMainPanel()
- end
- function this:RightDataListItemCountFunc()
- return #self.right_all
- end
- function this:RightDataListItemGetFunc(realIndex)
- local data = self.right_all[realIndex + 1]
- local str = self:getBtnName(data)
- local message = { equip_pos = self.args.equip_pos, cfgId = self.args.cfgId, id = self.args.id, btnType = data, nameStr = str }
- local item = GUI:UIPanel_Open("dev/ui/Tips/Item/KLUITips/KLTipBtntem", self.view.right_data_list, self, message, true)
- self.right_all_item[item.view.root] = item
- return item.view.root
- end
- function this:RightDataListItemInitFunc(realIndex, kmlcontrol)
- end
- function this:RightDataListItemUpdateFunc(realIndex, kmlcontrol)
- end
- ---获取被属性衰减过的实际生效属性
- ---@param attrList CommonProtos.EquipEntryAttrVo[] 幸运属性
- function this:GetAttrValueOffset(attrId, attrValue, attrList)
- if not attrList then
- return 0
- end
- local specialValue = 0
- ---@type cfg_att_special_column
- local specialTbl = SL:GetConfig("cfg_att_special", tostring(attrId), "param")
- if specialTbl and specialTbl.type[1] == 21 then
- for _, v in pairs(attrList) do
- if v.type == specialTbl.id then
- specialValue = v.num
- break
- end
- end
- ---@type cfg_att_info_column
- local tbl = SL:GetConfig("cfg_att_info", specialTbl.id)
- if tbl then
- if tbl.remarks == 2 then
- specialValue = attrValue * specialValue * 100
- end
- end
- end
- return specialValue
- end
- ----------首饰特殊处理显示----------------------------------------------------------
- ---@return cfg_equip_ornaments_column
- function this:GetJewelryTblInfoByLevel(cfgId, Level)
- local ornament_tbl = SL:GetConfig('cfg_equip_ornamentsMain', cfgId)
- local ornamentsTbl = SL:GetConfigTable('cfg_equip_ornaments')
- for _, v in pairs(ornamentsTbl) do
- if v.ornamentsGroup == ornament_tbl.ornamentsGroup and v.lv == Level then
- return v
- end
- end
- return nil
- end
- -- function this:SetJewelryTips()
- -- local jewelryEquip = SL:GetPosItemInfo(self.args.equip_pos, self.args.cfgId, self.args.id)
- -- if not jewelryEquip then
- -- jewelryEquip = {}
- -- jewelryEquip.luaExtData = "null"
- -- end
- -- ---@type RES_UPDATE_EQUIP_ORNAMENTS
- -- local OutEquipData = SL:JsonDecode(jewelryEquip.luaExtData)
- -- local preLevel = 0
- -- if OutEquipData == nil or (OutEquipData and not OutEquipData.ssuplv) then
- -- preLevel = 0
- -- else
- -- preLevel = OutEquipData.ssuplv
- -- end
- -- local PreOrnament_Tbl = self:GetJewelryTblInfoByLevel(self.args.cfgId, preLevel)
- -- local NextOrnament_Tbl = self:GetJewelryTblInfoByLevel(self.args.cfgId, preLevel + 1)
- -- if PreOrnament_Tbl then
- -- local nextLevel = ""
- -- ----基础属性标题
- -- if not self.IsHaveStrengthen then
- -- table.insert(self.all_info, { title = "tips_attribute21" })
- -- end
- -- ----等级
- -- table.insert(self.all_info, { name = "LV." .. preLevel, value = "" })
- -- self:JewelSpecialAttr(PreOrnament_Tbl, "#FFFFFF")
- -- for _, attrValue in pairs(PreOrnament_Tbl.basicAtt) do
- -- if not self:IsJewelSpecialAttr(attrValue[1]) then
- -- local preValue = 0
- -- local attrName = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).name
- -- local att_remark = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).remarks
- -- if att_remark == 1 then
- -- preValue = attrValue[2]
- -- else
- -- preValue = tonumber(attrValue[2]) / 100 .. '%'
- -- end
- -- table.insert(self.all_info, { name = attrName .. ":", value = preValue, color = "#FFFFFF" })
- -- end
- -- end
- -- if NextOrnament_Tbl then
- -- nextLevel = preLevel + 1
- -- ----下一等级
- -- table.insert(self.all_info, { name = "下一级LV." .. nextLevel, value = "" })
- -- self:JewelSpecialAttr(NextOrnament_Tbl, "#B0B0B0")
- -- for _, attrValue in pairs(NextOrnament_Tbl.basicAtt) do
- -- if not self:IsJewelSpecialAttr(attrValue[1]) then
- -- local NextValue = 0
- -- local attrName = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).name
- -- local att_remark = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).remarks
- -- if att_remark == 1 then
- -- NextValue = attrValue[2]
- -- else
- -- NextValue = tonumber(attrValue[2]) / 100 .. '%'
- -- end
- -- table.insert(self.all_info, { name = attrName .. ":", value = NextValue, color = "#B0B0B0" })
- -- end
- -- end
- -- end
- -- end
- -- ----------卓越属性
- -- ----卓越属性标题
- -- table.insert(self.all_info, { title = "tips_attribute3" })
- -- local ornament_tbl = SL:GetConfig('cfg_equip_ornamentsMain', self.args.cfgId)
- -- local ornamentsTbl = SL:GetConfigTable('cfg_equip_ornaments')
- -- for _, v in pairs(ornamentsTbl) do
- -- if v.ornamentsGroup == ornament_tbl.ornamentsGroup then
- -- if next(v.excellenceAtt) then
- -- for _, attrValue in pairs(v.excellenceAtt) do
- -- local preValue = 0
- -- local attrName = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).name
- -- local att_remark = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).remarks
- -- local desc = ""
- -- local descColor = "#FFFFFF"
- -- local color = "#B0B0B0"
- -- if preLevel < v.lv then
- -- desc = v.lv .. "级可激活"
- -- descColor = "#ff2323"
- -- color = "#B0B0B0"
- -- else
- -- desc = v.lv .. "级可激活"
- -- descColor = "#1ADD1F"
- -- color = "#B0B0B0"
- -- end
- -- if OutEquipData and OutEquipData.ssactlv then
- -- for _, data in pairs(OutEquipData.ssactlv) do
- -- if tonumber(data) == v.lv then
- -- desc = "已激活"
- -- descColor = "#4BA7E8"
- -- color = "#4BA7E8"
- -- end
- -- end
- -- end
- -- if att_remark == 1 then
- -- preValue = attrValue[2]
- -- else
- -- preValue = tonumber(attrValue[2]) / 100 .. '%'
- -- end
- -- if self:chenckAttrShow(tonumber(attrValue[1])) then
- -- local nameStr = nil
- -- if not self:chenckAttrValue(tonumber(attrValue[1])) then
- -- preValue = ""
- -- nameStr = attrName
- -- else
- -- nameStr = attrName .. " +"
- -- end
- -- table.insert(self.all_info, { name = nameStr, value = preValue, color = color, desc = desc, descColor = descColor })
- -- end
- -- end
- -- end
- -- end
- -- end
- -- end
- function this:SetJewelryTips()
- local jichu_list
- local jichu_index
- for i, v in ipairs(self.all_att_sort_list) do
- if v.attr_type == 1 then
- jichu_index = i
- jichu_list = v.data
- break
- end
- end
- if not jichu_list then
- jichu_list = {}
- end
- local jewelryEquip = SL:GetPosItemInfo(self.args.equip_pos, self.args.cfgId, self.args.id)
- if not jewelryEquip then
- jewelryEquip = {}
- jewelryEquip.luaExtData = "null"
- end
- ---@type RES_UPDATE_EQUIP_ORNAMENTS
- local OutEquipData = SL:JsonDecode(jewelryEquip.luaExtData,false)
- local preLevel = 0
- if OutEquipData == nil or (OutEquipData and not OutEquipData.ssuplv) then
- preLevel = 0
- else
- preLevel = OutEquipData.ssuplv
- end
- local PreOrnament_Tbl = self:GetJewelryTblInfoByLevel(self.args.cfgId, preLevel)
- local NextOrnament_Tbl = self:GetJewelryTblInfoByLevel(self.args.cfgId, preLevel + 1)
- local shoushi_att = {}
- if PreOrnament_Tbl then
- local nextLevel = ""
- ----基础属性标题
- if not self.IsHaveStrengthen then
- --table.insert(self.all_info, { title = "tips_attribute21" })
- end
- ----等级
- --table.insert(self.all_info, { name = "LV." .. preLevel, value = "" })
- table.insert(shoushi_att, { name = "LV." .. preLevel, value = "" })
- local one_att = self:JewelSpecialAttr(PreOrnament_Tbl, "#FFFFFF")
- if one_att then
- table.insert(shoushi_att, one_att)
- end
- for _, attrValue in pairs(PreOrnament_Tbl.basicAtt) do
- if not self:IsJewelSpecialAttr(attrValue[1]) then
- local preValue = 0
- local attrName = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).name
- local att_remark = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).remarks
- if att_remark == 1 then
- preValue = attrValue[2]
- else
- preValue = tonumber(attrValue[2]) / 100 .. '%'
- end
- --table.insert(self.all_info, { name = attrName .. ":", value = preValue, color = "#FFFFFF" })
- table.insert(shoushi_att, { name = attrName .. ":", value = preValue, color = "#FFFFFF" })
- end
- end
- if NextOrnament_Tbl then
- nextLevel = preLevel + 1
- ----下一等级
- --table.insert(self.all_info, { name = "下一级LV." .. nextLevel, value = "" })
- table.insert(shoushi_att, { name = "下一级LV." .. nextLevel, value = "" ,color="#999999",color_not_change =true})
- local o_att = self:JewelSpecialAttr(NextOrnament_Tbl, "#B0B0B0")
- if o_att then
- o_att.color="#999999"
- o_att.color_not_change =true
- table.insert(shoushi_att, o_att)
- end
- for _, attrValue in pairs(NextOrnament_Tbl.basicAtt) do
- if not self:IsJewelSpecialAttr(attrValue[1]) then
- local NextValue = 0
- local attrName = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).name
- local att_remark = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).remarks
- if att_remark == 1 then
- NextValue = attrValue[2]
- else
- NextValue = tonumber(attrValue[2]) / 100 .. '%'
- end
- --table.insert(self.all_info, { name = attrName .. ":", value = NextValue, color = "#B0B0B0" })
- table.insert(shoushi_att, { name = attrName .. ":", value = NextValue ,color="#999999",color_not_change =true})
- end
- end
- end
- end
- if jichu_index then
- self.all_att_sort_list[jichu_index].data = jichu_list
- else
- table.insert(self.all_att_sort_list, { attr_type = 1, data = jichu_list })
- end
- if shoushi_att and #shoushi_att > 0 then
- table.insert(self.all_att_sort_list, { attr_type = 10, data = shoushi_att })
- end
- ----------卓越属性
- ----卓越属性标题
- --table.insert(self.all_info, { title = "tips_attribute3" })
- local zhuoyue_list
- local zhuoyue_index
- for i, v in ipairs(self.all_att_sort_list) do
- if v.attr_type == 4 then
- zhuoyue_index = i
- zhuoyue_list = v.data
- break
- end
- end
- if not zhuoyue_list then
- zhuoyue_list = {}
- end
- local ornament_tbl = SL:GetConfig('cfg_equip_ornamentsMain', self.args.cfgId)
- local ornamentsTbl = SL:GetConfigTable('cfg_equip_ornaments')
- for _, v in pairs(ornamentsTbl) do
- if v.ornamentsGroup == ornament_tbl.ornamentsGroup then
- if next(v.excellenceAtt) then
- for _, attrValue in pairs(v.excellenceAtt) do
- local preValue = 0
- local attrName = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).name
- local att_remark = SL:GetConfig("cfg_att_info", tonumber(attrValue[1])).remarks
- local desc = ""
- local descColor = "#FFFFFF"
- local color = "#B0B0B0"
- if preLevel < v.lv then
- desc = v.lv .. "级可激活"
- descColor = "#ff2323"
- color = "#B0B0B0"
- else
- desc = v.lv .. "级可激活"
- descColor = "#1ADD1F"
- color = "#B0B0B0"
- end
- if OutEquipData and OutEquipData.ssactlv then
- for _, data in pairs(OutEquipData.ssactlv) do
- if tonumber(data) == v.lv then
- desc = "已激活"
- descColor = "#4BA7E8"
- color = "#4BA7E8"
- end
- end
- end
- if att_remark == 1 then
- preValue = attrValue[2]
- else
- preValue = tonumber(attrValue[2]) / 100 .. '%'
- end
- if self:chenckAttrShow(tonumber(attrValue[1])) then
- local nameStr = nil
- if not self:chenckAttrValue(tonumber(attrValue[1])) then
- preValue = ""
- nameStr = attrName
- else
- nameStr = attrName .. " +"
- end
- --table.insert(self.all_info, { name = nameStr, value = preValue, color = color, desc = desc, descColor = descColor })
- table.insert(zhuoyue_list, { name = nameStr, value = preValue, color = color, desc = desc, descColor = descColor })
- end
- end
- end
- end
- end
- if #zhuoyue_list > 0 then
- if zhuoyue_index then
- self.all_att_sort_list[zhuoyue_index].data = zhuoyue_list
- else
- table.insert(self.all_att_sort_list, { attr_type = 4, data = zhuoyue_list })
- end
- end
- end
- function this:JewelSpecialAttr(PreOrnament_Tbl, _Color)
- local max1
- local min1
- local max2
- local min2
- local max3
- local min3
- local max4
- local min4
- for i, v in ipairs(PreOrnament_Tbl.basicAtt) do
- if v[1] == 200021 then
- max1 = v
- elseif v[1] == 200011 then
- min1 = v
- elseif v[1] == 202011 then
- max2 = v
- elseif v[1] == 202021 then
- min2 = v
- elseif v[1] == 205021 then
- max3 = v
- elseif v[1] == 205011 then
- min3 = v
- elseif v[1] == 203021 then
- max4 = v
- elseif v[1] == 203011 then
- min4 = v
- end
- end
- if max1 and min1 then
- local _value = min1[2] .. "~" .. max1[2]
- return { name = "攻击力", value = _value, color = _Color }
- end
- if max2 and min2 then
- local _value = min2[1] .. "~" .. max2[2]
- return { name = "魔法攻击力", value = _value, color = _Color }
- end
- if max3 and min3 then
- local _value = min3[1] .. "~" .. max3[2]
- return { name = "诅咒攻击力", value = _value, color = _Color }
- end
- if max4 and min4 then
- local _value = min4[1] .. "~" .. max4[2]
- return { name = "天鹰攻击力", value = _value, color = _Color }
- end
- return
- end
- function this:IsJewelSpecialAttr(attrId)
- 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
- return true
- end
- return false
- end
- ----------首饰特殊处理显示end----------------------------------------------------------
- ----------大天使装备对进度条的特殊处理------------------------------------------
- function this:RES_ANGEL_EQUIPMENT_ATTR_INFO(_, message)
- if message[tostring(self.args.id)] then
- GUI:SetLoadingbar_startper(self.archenge.loadingbar, (message[tostring(self.args.id)].exp / self.archenge.maxExp) * 100)
- GUI:Text_setString(self.archenge.valueInfo, tostring(message[tostring(self.args.id)].exp) .. "/" .. tostring(self.archenge.maxExp))
- GUI:Text_setString(self.archenge.loading_name, "<color='#1add1f'>Lv." .. tostring(message[tostring(self.args.id)].level) .. "</color>")
- end
- end
- ----------萤石属性-----------start----------------------------------------------------------------
- function this:GetGemAtt()
- self.all_gem_att = {}
- local rid = SL:GetMetaValue(EMetaVarGetKey.USER_ID)
- local target_id = nil
- if self.args.info and self.args.info.otherRid then
- if tostring(self.args.info.otherRid) ~= rid then
- target_id = self.args.info.otherRid
- end
- end
- if not self.args.id then
- return
- end
- --显示的是自己装备的萤石属性
- if not target_id then
- if self.args.equip_pos ~= "equip" and self.args.equip_pos ~= "chat" then
- return
- end
- local index = SL.Equip:GetIndexBaseOnItemId(self.args.id)
- if not index then
- return
- end
- local wearBarId, pos = SL:GetEquipWearBarIdPos(self.args.id)
- local gem_data = InfoManager.gemSlateInfo:GetTargetEquipGem(pos)
- if gem_data then
- for k, gem_id in pairs(gem_data.gems) do
- local tab=SL:GetConfig("cfg_equip_gem", gem_id)
- for i, att in ipairs(tab.gemAtt) do
- local target_index = nil
- for j=1,#self.all_gem_att,1 do
- if self.all_gem_att[j].type == att[1] then
- target_index = j
- end
- end
- if target_index then
- local tar_value = self.all_gem_att[target_index].num
- tar_value = tar_value + att[2]
- self.all_gem_att[target_index].num = tar_value
- else
- table.insert(self.all_gem_att,{type=att[1],num=att[2]})
- end
-
- end
- end
- end
-
- else
- --显示别人装备的萤石属性
- if not self.gemOtherPlayerId then
- SL:SendLuaNetMsg(LuaMessageIdToSever.REQ_OTHER_GEM_EQUIP_INFO, { rid = target_id })--请求一下别的玩家的萤石信息
- else
- if not EquipFunc.checkOtherEquips() then
- return
- end
- local wearBarId, pos = EquipFunc.OtherGetEquipWearBarIdPos(self.args.id)
- local gem_data = InfoManager.gemSlateInfo:GetOtherPlayerTargetEquipGem(pos)
- if gem_data then
- for k, gem_id in pairs(gem_data.gems) do
- local tab=SL:GetConfig("cfg_equip_gem", gem_id)
- for i, att in ipairs(tab.gemAtt) do
- local target_index = nil
- for j=1,#self.all_gem_att,1 do
- if self.all_gem_att[j].type == att[1] then
- target_index = j
- end
- end
- if target_index then
- local tar_value = self.all_gem_att[target_index].num
- tar_value = tar_value + att[2]
- self.all_gem_att[target_index].num = tar_value
- else
- table.insert(self.all_gem_att,{type=att[1],num=att[2]})
- end
-
- end
- end
- end
- end
- end
- end
- function this:LUA_EVENT_REFRESH_GEM_SLATE_INFO(_id,message)
- if not self.args.info or not self.args.info.otherRid then
- return
- end
- if tostring(self.args.info.otherRid) ~= tostring(message) then
- return
- end
- self.gemOtherPlayerId= message
- self:Refresh()
- end
- ----------萤石属性-----------end----------------------------------------------------------------
- return this
|