1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176 |
- ---@class KLUIEquipTipsComparsionPanel:UIKmlLuaPanelBase
- ---@field view KLUIEquipTipsComparsionPanelView
- local KLUIEquipTipsComparsionPanel = class(UIKmlLuaPanelBase)
- local this = KLUIEquipTipsComparsionPanel
- ---创建时调用一次
- function this:Init()
- -- 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 }
- 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
- if self.type == 6 and self.subType == 14 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
- if self.type == 6 and 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
- end
- --模型数据
- local modelData = {
- mscale = "30,30,30",
- 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
- 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
- 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 = 5,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})
- -- 装备有无
- if not self.args.id or not InfoManager.archangeEquipInfo:IsHaveArchangeEquip(self.args.id) then
- 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
- else
- --有装备
- 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 = InfoManager.archangeEquipInfo:GetEquipLevelInfo(self.args.id).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 = "#999999",color_not_change=true })
- 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
- 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)
- 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 = InfoManager.archangeEquipInfo:GetGrailStrengthLv(tonumber(v.id))
- 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
- 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)
- SL:RegisterLuaNetMsg(LuaMessageIdToClient.RES_ANGEL_EQUIPMENT_ATTR_INFO, self.RES_ANGEL_EQUIPMENT_ATTR_INFO, self) -- 大天使装备需要等一个回调
- end
- function this:CloseEquipTips()
- GUI:UIPanel_Close("dev/ui/Tips/Panel/KLUIEquipTips/KLUIEquipTipsComparsionPanel")
- 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(di, true)
- GUI:setVisible(item, false)
- GUI:setVisible(itemname, false)
- 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(di, false)
- GUI:setVisible(item, false)
- GUI:setVisible(itemname, 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(di, false)
- GUI:setVisible(item, false)
- GUI:setVisible(itemname, 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.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)
- EquipInfo.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: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 = json.decode(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 = "#B0B0B0" ,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" 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
-
-
- end
- end
- ----------萤石属性-----------end----------------------------------------------------------------
- return this
|