require("Base/BasePanel") local RewardTalismanSingleShowPopup2 = Inherit(BasePanel) local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig) local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig) local spcialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig) local passiveSkillConfig = ConfigManager.GetConfig(ConfigName.PassiveSkillConfig) local equipConfigData local isGongMing = false local typeToUpdate = { -- [1] = 3,--已穿戴->卸载单件 [2] = 2,--已穿戴->卸载单件 [3] = 1,--未穿戴->穿单件 [4] = 3,--未穿戴->替换单件 } --初始化组件(用于子类重写) function RewardTalismanSingleShowPopup2:InitComponent() self.spLoader = SpriteLoader.New() self.mask = Util.GetGameObject(self.transform, "mask") self.content = Util.GetGameObject(self.transform, "Content") self.textPre = Util.GetGameObject(self.transform, "TextPre") self.skillPre = Util.GetGameObject(self.transform, "proPre") self.linePre = Util.GetGameObject(self.transform, "line") --topBar self.topBar = Util.GetGameObject(self.transform, "Content/topBar") --装备详情 self.eqiopName = Util.GetGameObject(self.topBar, "name"):GetComponent("Text") self.icon = Util.GetGameObject(self.topBar, "icon") self.equipType=Util.GetGameObject(self.topBar, "equipType"):GetComponent("Text") self.equipQuaText=Util.GetGameObject(self.topBar, "equipQuaText"):GetComponent("Text") self.equipInfoText=Util.GetGameObject(self.topBar, "equipInfoText"):GetComponent("Text") self.powerNum=Util.GetGameObject(self.topBar, "powerNum"):GetComponent("Text") self.powerNumUpDown = Util.GetGameObject(self.topBar, "powerUPorDown"):GetComponent("Image") --装备属性--midBar self.mid = Util.GetGameObject(self.transform, "Content/midBar") self.midBar = Util.GetGameObject(self.transform, "Content/midBar/Grid") --baseAttri self.baseAttri = Util.GetGameObject(self.midBar, "baseAttri") self.skillPro = Util.GetGameObject(self.midBar, "suitPro") self.skillGrid=Util.GetGameObject(self.midBar, "suitPro/proGrid") self.baseName = Util.GetGameObject(self.baseAttri, "baseName/attriName"):GetComponent("Text") self.baseLevel = Util.GetGameObject(self.baseAttri, "baseName/attriNum"):GetComponent("Text") self.baseGrid = Util.GetGameObject(self.baseAttri, "grid") self.baseMaster = Util.GetGameObject(self.midBar, "baseMasterAttri") self.baseMasterName = Util.GetGameObject(self.baseMaster, "baseMaster/attriName"):GetComponent("Text") self.baseMasterGrid = Util.GetGameObject(self.baseMaster, "gridMaster") --refineAttri self.refineAttri = Util.GetGameObject(self.midBar, "refineAttri") self.refineName = Util.GetGameObject(self.refineAttri, "refineName/attriName"):GetComponent("Text") self.refineLevel = Util.GetGameObject(self.refineAttri, "refineName/attriNum"):GetComponent("Text") self.refineGrid = Util.GetGameObject(self.refineAttri, "grid") self.refineMaster = Util.GetGameObject(self.midBar, "refineMasterAttri") self.refineMasterName = Util.GetGameObject(self.refineMaster, "refineMaster/attriName"):GetComponent("Text") self.refineMasterGrid = Util.GetGameObject(self.refineMaster, "gridMaster") --treeAttri self.treeAttri = Util.GetGameObject(self.midBar, "treeAttri") self.treeName = Util.GetGameObject(self.treeAttri, "treeName/attriName"):GetComponent("Text") self.treeLevel = Util.GetGameObject(self.treeAttri, "treeName/attriNum"):GetComponent("Text") self.treeGrid = Util.GetGameObject(self.treeAttri, "grid") self.skillNameInfo=Util.GetGameObject(self.midBar, "suitPro/PropertyName"):GetComponent("Text") --分解按钮--btmBar self.btmBar = Util.GetGameObject(self.transform, "Content/btmBar") self.howGet = Util.GetGameObject(self.btmBar, "howGet") self.btnGrid = Util.GetGameObject(self.btmBar, "btnGrid") self.btnSure = Util.GetGameObject(self.btnGrid, "btnSure") self.btnJump = Util.GetGameObject(self.btnGrid, "btnJump") self.btnWear = Util.GetGameObject(self.btnGrid, "btnWear") self.btnDown = Util.GetGameObject(self.btnGrid, "btnDown") self.btnSwitch = Util.GetGameObject(self.btnGrid, "btnSwitch") self.btnUpgrade = Util.GetGameObject(self.btnGrid, "btnUpgrade") self.btnUpgradeTxt =Util.GetGameObject(self.btnGrid, "btnUpgrade/Text"):GetComponent("Text") self.btnUpstar = Util.GetGameObject(self.btnGrid, "btnUpstar") self.btnUpstarTxt = Util.GetGameObject(self.btnGrid, "btnUpstar/Text"):GetComponent("Text") self.btnShenYing = Util.GetGameObject(self.btnGrid, "btnShenYing") self.upgradeRed = Util.GetGameObject(self.btnUpgrade, "red") self.upstarRed = Util.GetGameObject(self.btnUpstar, "red") self.shenyingRed = Util.GetGameObject(self.btnShenYing, "red") --装备获取途径--btmBar self.canGetPre = Util.GetGameObject(self.btmBar, "scroll/canGetPre") self.canGetGrid = Util.GetGameObject(self.btmBar, "scroll") self.canGetScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.canGetGrid.transform,self.canGetPre, nil, Vector2.New(self.canGetGrid.transform.rect.width, self.canGetGrid.transform.rect.height), 1, 1, Vector2.New(0, 0)) self.canGetScrollView.moveTween.MomentumAmount = 1 self.canGetScrollView.moveTween.Strength = 2 self.canGetScrollView.elastic = false --跳转itemlist self.jumpViewList = {} --装备icon self.itemPre = nil self.BaseAttriList = {}--基础属性对象 self.RefineAttriList = {}--精炼属性对象 self.TreeAttriList = {}--神应属性对象 self.TreeAttriList2 = {}--神应属性对象2 self.BaseMasterList = {}--强化大师 self.RefineMasterList = {}--精炼大师 self.skillList = {} --技能属性 end --绑定事件(用于子类重写) function RewardTalismanSingleShowPopup2:BindEvent() Util.AddClick(self.mask, function() PlaySoundWithoutClick(SoundConfig.Sound_UICancel) self:ClosePanel() end) --跳转 Util.AddClick(self.btnJump, function() JumpManager.GoJump(22001) end) --分解 Util.AddClick(self.btnSure, function() self:ClosePanel() JumpManager.GoJump(24005) end) --穿戴 Util.AddClick(self.btnWear, function() local config if self.position>6 then if equipConfigData.Profession~=0 then if self.curHeroData.heroConfig.Profession~=equipConfigData.Profession then PopupTipPanel.ShowTip("该英雄无法装备此法相") return end if not CheckListIsContainValue1(equipConfigData.Job,self.curHeroData.heroConfig.Job) then PopupTipPanel.ShowTip("该英雄无法装备此法相") return end end else config=spcialConfig[40] end if config then local limits = string.split(config.Value, "|") if limits then local heroConfig=ConfigManager.GetConfigData(ConfigName.HeroConfig,self.curHeroData.id) local lvs=string.split(limits[1],"#") local stars=string.split(limits[2],"#") local lv=tonumber(lvs[2]) if PlayerManager.level6 then NetManager.WearFaxiangEquipRequest(self.curHeroData.dynamicId,equipIdList,1,function () self:ClosePanel() self.parent.UpdateEquipPosHeroData(3,typeToUpdate[self.openType],equipDataList,0,self.position) HeroPropManager.SetDirtyByType(self.curHeroData.dynamicId, Hero_Prop_Type.FaXiang) end) else NetManager.EquipWearRequest(self.curHeroData.dynamicId,equipIdList,2,function () self:ClosePanel() self.parent.UpdateEquipPosHeroData(2,typeToUpdate[self.openType],equipDataList,0,self.position) end) end end) --卸下 Util.AddClick(self.btnDown, function() local equipIdList={} local equipDataList={} table.insert(equipIdList,self.equipData.idDyn) table.insert(equipDataList,self.equipData) if self.position>6 then NetManager.WearFaxiangEquipRequest(self.curHeroData.dynamicId,equipIdList,2,function () self:ClosePanel() self.parent.UpdateEquipPosHeroData(3,typeToUpdate[self.openType],equipDataList) HeroPropManager.SetDirtyByType(self.curHeroData.dynamicId, Hero_Prop_Type.FaXiang) end) else NetManager.EquipUnLoadOptRequest(self.curHeroData.dynamicId,equipIdList ,2,function () self:ClosePanel() self.parent.UpdateEquipPosHeroData(2,typeToUpdate[self.openType],equipDataList) end) end end) --替换 Util.AddClick(self.btnSwitch, function() local equipIdList={} local equipDataList={} table.insert(equipIdList,self.equipData.idDyn) table.insert(equipDataList,self.equipData) if self.position>6 then if equipConfigData.Profession~=0 then if self.curHeroData.heroConfig.Profession~=equipConfigData.Profession then PopupTipPanel.ShowTip("该英雄无法装备此法相") return end if not CheckListIsContainValue1(equipConfigData.Job,self.curHeroData.heroConfig.Job) then PopupTipPanel.ShowTip("该英雄无法装备此法相") return end end NetManager.WearFaxiangEquipRequest(self.curHeroData.dynamicId,equipIdList,3,function () self:ClosePanel() self.parent.UpdateEquipPosHeroData(3,typeToUpdate[self.openType],equipDataList,self.nextEquip,self.position) HeroPropManager.SetDirtyByType(self.curHeroData.dynamicId, Hero_Prop_Type.FaXiang) end) else NetManager.EquipWearRequest(self.curHeroData.dynamicId,equipIdList,2,function () self:ClosePanel() self.parent.UpdateEquipPosHeroData(2,typeToUpdate[self.openType],equipDataList,self.nextEquip,self.position) end) end end) Util.AddClick(self.btnUpgrade, function() if self.position>6 then UIManager.OpenPanel(UIName.FaXiangStrongPopup,self.equipData,1) self:ClosePanel() else if isGongMing then PopupTipPanel.ShowTip(Language[12184]) else UIManager.OpenPanel(UIName.EquipTreasureStrongPopup,self.equipData,1) self:ClosePanel() end end end) Util.AddClick(self.btnUpstar, function() if self.position>6 then UIManager.OpenPanel(UIName.FaXiangStrongPopup,self.equipData,2) else UIManager.OpenPanel(UIName.EquipTreasureStrongPopup,self.equipData,2) end self:ClosePanel() end) Util.AddClick(self.btnShenYing, function() UIManager.OpenPanel(UIName.EquipTreasureStrongPopup,self.equipData,3) self:ClosePanel() end) end --添加事件监听(用于子类重写) function RewardTalismanSingleShowPopup2:AddListener() end --移除事件监听(用于子类重写) function RewardTalismanSingleShowPopup2:RemoveListener() end --界面打开时调用(用于子类重写) function RewardTalismanSingleShowPopup2:OnOpen(_parent,_equipData,_openType,_isShowGet,_isShowGo,_curHeroData,_position,_targetEquipData,_func) if not _equipData then return end self.parent = _parent --父界面 self.equipData = _equipData --当前装备数据 self.openType = _openType --0不显示按钮、1背包、2已穿戴(显示卸下)、3未穿戴(显示穿戴)、4未穿戴(显示替换) self.isShowGet = _isShowGet self.howGet:SetActive(_isShowGet and true or false)--是否显示获取途径 self.btnGrid:SetActive(self.openType ~= 0) self.curHeroData = _curHeroData --装备了该装备的英雄数据 self.position = _position self.nextEquip = _targetEquipData--要替换的目标装备 self.isShowGo = _isShowGo and _isShowGo or false--是否显示跳转按钮 self.func = _func end function RewardTalismanSingleShowPopup2:SetBtns() Log("self.equipData.id:"..self.equipData.id) local itemConfigData=ConfigManager.GetConfigData(ConfigName.ItemConfig, tonumber(self.equipData.id)) self.btnSure:SetActive(itemConfigData.IfResolve==1 and BagManager.isBagPanel) self.btnJump:SetActive(BagManager.isBagPanel) self.btnWear:SetActive(self.openType == 3) self.btnDown:SetActive(self.openType == 2) self.btnSwitch:SetActive(self.openType == 4) self.btnUpgrade:SetActive(self.openType == 2) self.btnUpstar:SetActive(self.openType == 2) self.btnShenYing:SetActive(self.openType == 2 and CheckFunctionOpen(84) and self.position<7)--对标建木神树功能开启 if self.position and self.position>6 then self.btnUpgradeTxt.text="升 级" self.btnUpstarTxt.text="升 星" else self.btnUpgradeTxt.text="强 化" self.btnUpstarTxt.text="精 炼" end if self.equipData and self.equipData ~= 0 then isGongMing = HarmonyManager.IsInfo(self.equipData.upHeroDid) Util.SetGray(self.btnUpgrade, isGongMing) end end function RewardTalismanSingleShowPopup2:OnShow() self:SetBtns() --=============================上部装备基础信息============================ --法相 if self.position>6 then equipConfigData = ConfigManager.GetConfigData(ConfigName.FaxiangConfig, self.equipData.id) else equipConfigData = ConfigManager.GetConfigData(ConfigName.JewelConfig, self.equipData.id) end local itemConfigData = ConfigManager.GetConfigData(ConfigName.ItemConfig, self.equipData.id) --魂灵宝Icon if not self.itemPre then self.itemPre = SubUIManager.Open(SubUIConfig.ItemView,self.icon.transform) end self.itemPre:OnOpen(false,{equipConfigData.Id,0},1,false, false,false, 0,self.equipData.idDyn) --装备描述 self.equipInfoText.text = GetLanguageStrById(itemConfigData.ItemDescribe) --品质 self.equipQuaText.text =GetQuaStringByEquipQua(itemConfigData.Quantity)-- GetStringByEquipQua(itemConfigData.Quantity,GetQuaStringByEquipQua(itemConfigData.Quantity)) --装备名称 self.eqiopName.text=GetLanguageStrById(itemConfigData.Name) --上方底图 self.topBar:GetComponent("Image").sprite = self.spLoader:LoadSprite("Bg_hz_beibao_pinjise_00"..itemConfigData.Quantity) --计算战力 local Power = 0 if itemConfigData.ItemType==ItemType.FaXiang then self.equipType.text = "道具种类:法相" self.skillNameInfo.text="技能详情" Power = equipConfigData.Score else if not self.equipData.idDyn then Power = EquipTreasureManager.CalculateWarForceBySid(self.equipData.id, self.equipData.lv, self.equipData.refineLv, self.equipData.treeLv) else Power = EquipTreasureManager.CalculateWarForce(self.equipData.idDyn) end self.skillNameInfo.text="精炼技能:" self.equipType.text = string.format("宝物类型:%s",EquipTreasureTypeStr[equipConfigData.Location]) end self.powerNum.text = Power if self.openType == 4 then self.powerNumUpDown.gameObject:SetActive(true) local Power2 = EquipTreasureManager.CalculateWarForce(self.nextEquip.idDyn) if(Power > Power2) then self.powerNumUpDown.sprite = self.spLoader:LoadSprite(PowerChangeIconDef[1]) elseif(Power < Power2)then self.powerNumUpDown.sprite = self.spLoader:LoadSprite(PowerChangeIconDef[2]) else self.powerNumUpDown.gameObject:SetActive(false) end else self.powerNumUpDown.gameObject:SetActive(false) end --=============================中部======================================== --(基础属性) local baseInfo=nil local skills=nil if self.position>6 then baseInfo = FaXiangManager.GetCurLvPropertyValue(self.equipData.levelPool,self.equipData.lv,self.equipData.refinePool,self.equipData.refineLv) self.treeAttri:SetActive(false) self.refineAttri:SetActive(false) if equipConfigData.PassiveSkill and #equipConfigData.PassiveSkill>0 then skills={} for i = 1, #equipConfigData.PassiveSkill do local skilldata={} skilldata.PassiveSkillId=equipConfigData.PassiveSkill[i][1] skilldata.Level=i-1 table.insert(skills,skilldata) end end --skills=ConfigManager.TryGetAllConfigsDataByDoubleKey(ConfigName.JewelRankupConfig,"Type",2,"PoolID",equipConfigData.RankupPool) else baseInfo = EquipTreasureManager.GetCurLvPropertyValue(1,self.equipData.levelPool,self.equipData.lv) --(精炼属性) local refineInfo = EquipTreasureManager.GetCurLvPropertyValue(2,self.equipData.refinePool,self.equipData.refineLv,true) self.refineLevel.text = string.format("[精炼等级:%s/%s]",self.equipData.refineLv,self.equipData.maxRefineLv) if LengthOfTable(refineInfo) == 0 or refineInfo == nil then self.refineAttri:SetActive(false) else self.refineAttri:SetActive(true) self:SetPropertyShow1(refineInfo,self.RefineAttriList,self.refineGrid) end --(神应属性) local treeInfo=SacredTreeManager.GetCurLvPropertyValue(3,self.equipData.treePool,self.equipData.treeLv or 0) self.treeLevel.text = string.format("[神应等级:%s/%s]",self.equipData.treeLv,self.equipData.maxTreeLv) if self.openType == 2 and CheckFunctionOpen(84)then self.treeAttri:SetActive(true) self:SetPropertyShow2(treeInfo,self.TreeAttriList,self.treeGrid,self.TreeAttriList2) else self.treeAttri:SetActive(false) end --精炼技能 skills=ConfigManager.TryGetAllConfigsDataByDoubleKey(ConfigName.JewelRankupConfig,"Type",2,"PoolID",equipConfigData.RankupPool) end self.baseLevel.text = string.format("[强化等级:%s/%s]",self.equipData.lv,self.equipData.maxLv) self:SetPropertyShow1(baseInfo,self.BaseAttriList,self.baseGrid) if skills and #skills>0 then local skillIds={} local skillInfos={} for i = 1, #skills do if skills[i].PassiveSkillId and skills[i].PassiveSkillId>0 then if not BattleUtil.ChecklistIsContainValue(skillIds,skills[i].PassiveSkillId) then table.insert(skillIds,skills[i].PassiveSkillId) table.insert(skillInfos,{id=skills[i].PassiveSkillId,lv=skills[i].Level}) LogError("skills[i].PassiveSkillId=="..skills[i].PassiveSkillId) end end end LogError("skillids=="..#skillIds) if #skillInfos>0 then self.skillPro:SetActive(true) self:SetSkillShow(skillInfos,self.skillList,self.skillGrid,self.equipData.refineLv) else self.skillPro:SetActive(false) end end --大师属性 if self.equipData.upHeroDid == "" or self.equipData.upHeroDid == "0" or self.position>6 then self.baseMaster:SetActive(false) self.refineMaster:SetActive(false) else --强化共鸣 self:GongMingSetData(1,self.BaseMasterList,self.baseMasterGrid,self.baseMasterName,self.baseMaster) --精炼共鸣 self:GongMingSetData(2,self.RefineMasterList,self.refineMasterGrid,self.refineMasterName,self.refineMaster) end if self.openType == 2 then if self.position>6 then self.upgradeRed:SetActive(FaXiangManager.CheckIsShowRed(self.equipData.idDyn,1)) self.upstarRed:SetActive(FaXiangManager.CheckIsShowRed(self.equipData.idDyn,2)) self.shenyingRed:SetActive(false) else self.upgradeRed:SetActive(HeroManager.CheckIsUpTreasure(self.equipData.idDyn,1)) self.upstarRed:SetActive(HeroManager.CheckIsUpTreasure(self.equipData.idDyn,2)) self.shenyingRed:SetActive(HeroManager.CheckIsUpTreasure(self.equipData.idDyn,3)) end end --=============================下部========================================= --获取途径 if self.jumpViewList and #self.jumpViewList > 0 then for i = 1,#self.jumpViewList do SubUIManager.Close(self.jumpViewList[i]) end end local curitemData = itemConfig[tonumber(self.equipData.id)] if curitemData and curitemData.Jump then if curitemData.Jump and #curitemData.Jump>0 then self.canGetScrollView:SetData(curitemData.Jump,function (index, item) local tempView = nil if self.isShowGo then tempView = SubUIManager.Open(SubUIConfig.JumpView, item.transform, curitemData.Jump[index],true) else tempView = SubUIManager.Open(SubUIConfig.JumpView, item.transform, curitemData.Jump[index],false) end table.insert(self.jumpViewList,tempView) end,true,true) end end --(此处需要三遍才能完全打开) ForceRebuildLayout(self.midBar.transform) ForceRebuildLayout(self.midBar.transform) ForceRebuildLayout(self.midBar.transform) local maxHeight = self.isShowGet and 850 or 850 local sizeDelta = GetPreferredHeight(self.midBar.transform) if sizeDelta >= maxHeight then self.mid:GetComponent("LayoutElement").minHeight = maxHeight else self.mid:GetComponent("LayoutElement").minHeight = sizeDelta end if self.func then self.func() end end function RewardTalismanSingleShowPopup2:SetSkillShow(_infos,_preList,_grid,_lv) local dataCount=LengthOfTable(_infos) local preCount=#_preList for i = 1, dataCount-preCount do local go = newObject(self.skillPre) go.transform:SetParent(_grid.transform) go.transform.localScale = Vector3.one go.transform.localPosition = Vector3.zero go.gameObject:SetActive(false) table.insert(_preList,go) end local index=1 for key, value in pairs(_infos) do local obj=_preList[index] local proper=passiveSkillConfig[value.id] local str="" if self.position >6 then if value.lv<=_lv then str=""..proper.Desc.." ("..value.lv.."星解锁)".."" else str=""..proper.Desc.." ("..value.lv.."星解锁)".."" end else if value.lv<=_lv then str=""..proper.Desc.." (精炼"..value.lv.."级解锁)".."" else str=""..proper.Desc.." (精炼"..value.lv.."级解锁)".."" end end obj:GetComponent("Text").text=str obj.gameObject:SetActive(true) index=index+1 end for i = 1, #_preList do if i>=index then _preList[i]:SetActive(false) end end end --基础和精炼属性专用 function RewardTalismanSingleShowPopup2:SetPropertyShow1(_infos,_preList,_grid) local dataCount=LengthOfTable(_infos) local preCount=#_preList for i = 1, dataCount-preCount do local go = newObject(self.textPre) go.transform:SetParent(_grid.transform) go.transform.localScale = Vector3.one go.transform.localPosition = Vector3.zero go.gameObject:SetActive(false) table.insert(_preList,go) end local index=1 for key, value in pairs(_infos) do local obj=_preList[index] local proper=propertyConfig[key] local str="" if proper.Style==1 then obj.transform:GetComponent("Text").text = GetLanguageStrById(proper.Info).."+".. value.currValue else obj.transform:GetComponent("Text").text=GetLanguageStrById(proper.Info).."+"..value.currValue/100 .."%" end if self.curHeroData then if proper.Style==1 then local potencyAdd=HeroManager.GetHeroPotencyAddByTypeAndPotencyData(self.curHeroData.potential,self.position) LogError("potencyAdd============"..potencyAdd) str = str..GetLanguageStrById(proper.Info).."+".. value.currValue..string.format(" 潜能 +%s(%s%%)",math.floor(value.currValue*(potencyAdd)+0.5),potencyAdd*100) else --str = str..GetLanguageStrById(proper.Info).."+".. value.currValue..string.format(" 潜能 +%s(%s%%)",0,0) end else str = str..GetLanguageStrById(proper.Info).."+".. value.currValue..string.format(" 潜能 +%s(%s%%)",0,0) end obj.transform:GetComponent("Text").text=str obj.gameObject:SetActive(true) index=index+1 end for i = 1, #_preList do if i>=index then _preList[i]:SetActive(false) end end end --神应专用 function RewardTalismanSingleShowPopup2:SetPropertyShow2(_infos,_preList,_grid,_preList2) local curTree = SacredTreeManager.CulAttri(self.equipData) local attriConfig = ConfigManager.GetConfigDataByKey(ConfigName.GodHoodTreeSetting,"Id",0).PropertyUnlcokLevelForClient local dataCount=LengthOfTable(_infos) local preCount=#_preList ---行数 for i = 1, math.ceil(dataCount/2) - preCount do local go = newObject(self.linePre) go.transform:SetParent(_grid.transform) go.transform.localScale = Vector3.one go.transform.localPosition = Vector3.zero go.gameObject:SetActive(false) table.insert(_preList,go) end preCount = #_preList2 for i = 1, dataCount - preCount do local go = newObject(self.textPre) table.insert(_preList2,go) go.transform:SetParent(_preList[math.ceil(#_preList2/2)].transform) go.transform.localScale = Vector3.one go.transform.localPosition = Vector3.zero go.gameObject:SetActive(false) end local index=1 for key, value in pairs(attriConfig) do local obj = _preList2[index] _preList[math.ceil(index/2)].gameObject:SetActive(true) local proper=propertyConfig[value[1]] local string = "" if _infos[value[1]] then if proper.Style==1 then string = GetLanguageStrById(proper.Info).."+".._infos[value[1]].currValue--value.currValue else string = GetLanguageStrById(proper.Info).."+".._infos[value[1]].currValue/100 .."%" end end if index <= curTree then string = ""..string.."" else string = ""..string.."\n"..""..string.format("(四灵试炼%s层解锁)",attriConfig[index][2]).."" end obj.transform:GetComponent("Text").text = string obj.gameObject:SetActive(true) index=index+1 end for i = 1, #_preList2 do if i >= index then _preList2[i]:SetActive(false) end end for i = 1, #_preList do if i > math.ceil(index/2) then _preList[i]:SetActive(false) end end end --大师判断 function RewardTalismanSingleShowPopup2:GongMingSetData(curTabIndex,proPreList,grid,title,go) --获取穿戴宝物强化/精炼的最小等级 local minLv--最小等级 local maxlv --最大等级 if self.curHeroData==nil then self.baseMaster:SetActive(false) self.refineMaster:SetActive(false) return end if #self.curHeroData.jewels < 2 then go.gameObject:SetActive(false) return end go.gameObject:SetActive(true) for i = 1, #self.curHeroData.jewels do local curEquipTreasureData = EquipTreasureManager.GetTreasureData(self.curHeroData.jewels[i]) if curTabIndex == 1 then if minLv then if curEquipTreasureData.lv < minLv then minLv = curEquipTreasureData.lv end else minLv = curEquipTreasureData.lv end if maxlv then if curEquipTreasureData.maxLv < maxlv then maxlv = curEquipTreasureData.maxLv end else maxlv = curEquipTreasureData.maxLv end elseif curTabIndex == 2 then if minLv then if curEquipTreasureData.refineLv < minLv then minLv = curEquipTreasureData.refineLv end else minLv = curEquipTreasureData.refineLv end if maxlv then if curEquipTreasureData.maxRefineLv < maxlv then maxlv = curEquipTreasureData.maxRefineLv end else maxlv = curEquipTreasureData.maxRefineLv end end end local curJewelResonanceConfig = nil local allCurTypeJewelResonanceConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.JewelResonanceConfig,"Type",curTabIndex) table.sort(allCurTypeJewelResonanceConfig,function(a,b) return a.SortId强化大师%s级",curJewelResonanceConfig.SortId) else title.text = string.format("精炼大师%s级",curJewelResonanceConfig.SortId) end for i = 1, math.max(#curJewelResonanceConfig.Property,#proPreList) do if not curJewelResonanceConfig.Property[i] then proPreList[i].gameObject:SetActive(false) else if not proPreList[i] then proPreList[i] = newObjToParent(self.textPre,grid.transform) end proPreList[i].gameObject:SetActive(true) local str = GetLanguageStrById(propertyConfig[curJewelResonanceConfig.Property[i][1]].Info).."+"..GetPropertyFormatStr(propertyConfig[curJewelResonanceConfig.Property[i][1]].Style,curJewelResonanceConfig.Property[i][2]) proPreList[i].transform:GetComponent("Text").text = string.format("%s",str) end end end return true end --界面关闭时调用(用于子类重写) function RewardTalismanSingleShowPopup2:OnClose() if self.jumpViewList then for i = 1, #self.jumpViewList do destroy(self.jumpViewList[i].gameObject) end end end --界面销毁时调用(用于子类重写) function RewardTalismanSingleShowPopup2:OnDestroy() self.spLoader:Destroy() self.BaseAttriList = {}--基础属性对象 self.RefineAttriList = {}--精炼属性对象 self.TreeAttriList = {}--神应属性对象 self.TreeAttriList2 = {}--神应属性对象2 self.BaseMasterList = {}--强化大师 self.RefineMasterList = {}--精炼大师 self.jumpViewList = {} self.skillList = {} self.itemPre = nil end return RewardTalismanSingleShowPopup2