2021-11-09 11:42:19 +08:00
|
|
|
|
require("Base/BasePanel")
|
|
|
|
|
local RewardTalismanSingleShowPopup2 = Inherit(BasePanel)
|
|
|
|
|
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
|
|
|
|
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
|
|
|
|
local passiveSkillConfig = ConfigManager.GetConfig(ConfigName.PassiveSkillConfig)
|
|
|
|
|
local typeToUpdate = {
|
|
|
|
|
[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")
|
2021-11-09 14:39:27 +08:00
|
|
|
|
self.textPre = Util.GetGameObject(self.transform, "TextPre")
|
|
|
|
|
self.linePre = Util.GetGameObject(self.transform, "line")
|
|
|
|
|
--topBar
|
2021-11-09 11:42:19 +08:00
|
|
|
|
self.topBar = Util.GetGameObject(self.transform, "Content/topBar")
|
2021-11-09 14:39:27 +08:00
|
|
|
|
--装备详情
|
2021-11-09 11:42:19 +08:00
|
|
|
|
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")
|
2021-11-09 14:39:27 +08:00
|
|
|
|
|
2021-11-09 11:42:19 +08:00
|
|
|
|
--装备属性--midBar
|
2021-11-09 14:39:27 +08:00
|
|
|
|
self.midBar = Util.GetGameObject(self.transform, "Content/midBar/Grid")
|
|
|
|
|
--baseAttri
|
|
|
|
|
self.baseAttri = Util.GetGameObject(self.midBar, "baseAttri")
|
|
|
|
|
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.refineMasterName = Util.GetGameObject(self.refineAttri, "refineMaster/attriName"):GetComponent("Text")
|
|
|
|
|
self.refineMasterGrid = Util.GetGameObject(self.refineAttri, "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")
|
2021-11-09 11:42:19 +08:00
|
|
|
|
|
|
|
|
|
--分解按钮--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")
|
2021-11-09 14:39:27 +08:00
|
|
|
|
self.btnUpgrade = Util.GetGameObject(self.btnGrid, "btnUpgrade")
|
|
|
|
|
self.btnUpstar = Util.GetGameObject(self.btnGrid, "btnUpstar")
|
2021-11-09 11:42:19 +08:00
|
|
|
|
--装备获取途径--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
|
2021-11-09 14:39:27 +08:00
|
|
|
|
--跳转itemlist
|
2021-11-09 11:42:19 +08:00
|
|
|
|
self.jumpViewList = {}
|
2021-11-09 14:39:27 +08:00
|
|
|
|
--装备icon
|
|
|
|
|
self.itemPre = nil
|
|
|
|
|
|
|
|
|
|
self.BaseAttriList = {}--基础属性对象
|
|
|
|
|
self.RefineAttriList = {}--精炼属性对象
|
|
|
|
|
self.treeAttriList = {}--神应属性对象
|
|
|
|
|
self.treeAttriList2 = {}--神应属性对象2
|
2021-11-09 11:42:19 +08:00
|
|
|
|
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()
|
|
|
|
|
end)
|
|
|
|
|
--卸下
|
|
|
|
|
Util.AddClick(self.btnDown, function()
|
|
|
|
|
end)
|
|
|
|
|
--替换
|
|
|
|
|
Util.AddClick(self.btnSwitch, function()
|
|
|
|
|
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
|
2021-11-09 14:39:27 +08:00
|
|
|
|
self.parent = _parent --父界面
|
|
|
|
|
self.equipData = _equipData --当前装备数据
|
|
|
|
|
self.openType = _openType --0不显示按钮、1背包、2已穿戴(显示卸下)、3未穿戴(显示穿戴)、4未穿戴(显示替换)
|
|
|
|
|
self.howGet:SetActive(_isShowGet and true or false)--是否显示获取途径
|
|
|
|
|
self.btnGrid:SetActive(self.openType ~= 0)
|
|
|
|
|
self.curHeroData = _curHeroData --装备了该装备的英雄数据
|
|
|
|
|
self.nextEquip = _targetEquipData--要替换的目标装备
|
|
|
|
|
self.isShowGo = _isShowGo and _isShowGo or false--是否显示跳转按钮
|
|
|
|
|
self.func = _func
|
2021-11-09 11:42:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function RewardTalismanSingleShowPopup2:SetBtns()
|
|
|
|
|
local itemConfigData=ConfigManager.GetConfigData(ConfigName.ItemConfig, tonumber(self.equipData.id))
|
|
|
|
|
self.btnSure:SetActive(itemConfigData.IfResolve==1)
|
2021-11-09 14:39:27 +08:00
|
|
|
|
self.btnJump:SetActive(BagManager.isBagPanel)
|
2021-11-09 11:42:19 +08:00
|
|
|
|
self.btnWear:SetActive(self.openType == 3)
|
|
|
|
|
self.btnDown:SetActive(self.openType == 2)
|
|
|
|
|
self.btnSwitch:SetActive(self.openType == 4)
|
2021-11-09 14:39:27 +08:00
|
|
|
|
self.btnUpgrade:SetActive(self.openType == 2)
|
|
|
|
|
self.btnUpstar:SetActive(self.openType == 2)
|
2021-11-09 11:42:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function RewardTalismanSingleShowPopup2:OnShow()
|
2021-11-09 14:39:27 +08:00
|
|
|
|
self:SetBtns()
|
|
|
|
|
--=============================上部装备基础信息============================
|
|
|
|
|
local equipConfigData = ConfigManager.GetConfigData(ConfigName.JewelConfig, self.equipData.id)
|
|
|
|
|
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 = GetStringByEquipQua(equipConfigData.Level,GetQuaStringByEquipQua(equipConfigData.Level))
|
|
|
|
|
--装备名称
|
|
|
|
|
self.eqiopName.text=GetStringByEquipQua(itemConfigData.Quantity,GetLanguageStrById(itemConfigData.Name))
|
|
|
|
|
--装备类型
|
|
|
|
|
self.equipType.text = string.format("宝物类型:%s",EquipTreasureTypeStr[equipConfigData.Location])
|
|
|
|
|
--上方底图
|
|
|
|
|
self.topBar:GetComponent("Image").sprite = self.spLoader:LoadSprite("t_tongyong_di_"..equipConfigData.Level)
|
|
|
|
|
--计算战力
|
|
|
|
|
local Power = 0
|
|
|
|
|
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.powerNum.text = Power
|
|
|
|
|
|
|
|
|
|
--=============================中部========================================
|
|
|
|
|
-- if self.equipData.upHeroDid == "" or self.equipData.upHeroDid == "0" then
|
|
|
|
|
-- this.treasurePanel[i].strongAttri.gameObject:SetActive(false)
|
|
|
|
|
-- this.treasurePanel[i].refineMasterAttri:SetActive(false)
|
2021-11-09 11:42:19 +08:00
|
|
|
|
-- end
|
2021-11-09 14:39:27 +08:00
|
|
|
|
--(基础属性)
|
|
|
|
|
local baseInfo = EquipTreasureManager.GetCurLvPropertyValue(1,self.equipData.levelPool,self.equipData.lv)
|
|
|
|
|
self.baseLevel.text = string.format("[强化等级:%s/%s]",self.equipData.lv,self.equipData.maxLv)
|
|
|
|
|
self:SetPropertyShow1(baseInfo,self.BaseAttriList,self.baseGrid)
|
|
|
|
|
--(精炼属性)
|
|
|
|
|
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.equipData.treeLv < 1 and SacredTreeManager.CulAttri(self.equipData) < 1) or self.openType == 1 or self.openType ~= 0 then
|
|
|
|
|
self.treeAttri:SetActive(false)
|
|
|
|
|
else
|
|
|
|
|
self.treeAttri:SetActive(true)
|
|
|
|
|
self:SetPropertyShow2(treeInfo,self.treeAttriList,self.treeGrid,self.treeAttriList2)
|
|
|
|
|
end
|
2021-11-09 11:42:19 +08:00
|
|
|
|
|
2021-11-09 14:39:27 +08:00
|
|
|
|
--=============================下部=========================================
|
|
|
|
|
--获取途径
|
|
|
|
|
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
|
2021-11-09 11:42:19 +08:00
|
|
|
|
|
|
|
|
|
|
2021-11-09 14:39:27 +08:00
|
|
|
|
--(此处需要三遍才能完全打开)
|
|
|
|
|
ForceRebuildLayout(self.midBar.transform)
|
|
|
|
|
ForceRebuildLayout(self.midBar.transform)
|
|
|
|
|
ForceRebuildLayout(self.midBar.transform)
|
|
|
|
|
|
|
|
|
|
if self.func then
|
|
|
|
|
self.func()
|
|
|
|
|
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]
|
|
|
|
|
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
|
|
|
|
|
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 = "<color=#66FF00>"..string.."</color>"
|
|
|
|
|
else
|
|
|
|
|
string = "<color=#828282>"..string.."\n".."<size=25>"..string.format("(四灵试炼%s层解锁)",attriConfig[index][2]).."</size></color>"
|
|
|
|
|
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.equipData.jewels < 2 then
|
|
|
|
|
go.gameObject:SetActive(false)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
go.gameObject:SetActive(true)
|
|
|
|
|
for i = 1, #self.equipData.jewels do
|
|
|
|
|
local curEquipTreasureData = EquipTreasureManager.GetTreasureData(self.equipData.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<b.SortId
|
|
|
|
|
end)
|
|
|
|
|
for i = 1, #allCurTypeJewelResonanceConfig do
|
|
|
|
|
--获取当前强化/精炼 大师等级数据
|
|
|
|
|
if allCurTypeJewelResonanceConfig[i].Level <= minLv then
|
|
|
|
|
if curJewelResonanceConfig then
|
|
|
|
|
if curJewelResonanceConfig.SortId < allCurTypeJewelResonanceConfig[i].SortId then
|
|
|
|
|
curJewelResonanceConfig = allCurTypeJewelResonanceConfig[i]
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
curJewelResonanceConfig = allCurTypeJewelResonanceConfig[i]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if curJewelResonanceConfig.SortId < 1 then
|
|
|
|
|
go.gameObject:SetActive(false)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
go.gameObject:SetActive(true)
|
|
|
|
|
if curTabIndex == 1 then
|
|
|
|
|
title.text = string.format("<color=#FE2F33>强化大师%s级</color>",curJewelResonanceConfig.SortId)
|
|
|
|
|
else
|
|
|
|
|
title.text = string.format("<color=#FE2F33>精炼大师%s级</color>",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("<color=#66FF00>%s</color>",str)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
return true
|
2021-11-09 11:42:19 +08:00
|
|
|
|
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()
|
2021-11-09 14:39:27 +08:00
|
|
|
|
self.BaseAttriList = {}--基础属性对象
|
|
|
|
|
self.RefineAttriList = {}--精炼属性对象
|
|
|
|
|
self.treeAttriList = {}--神应属性对象
|
|
|
|
|
self.treeAttriList2 = {}--神应属性对象2
|
2021-11-09 11:42:19 +08:00
|
|
|
|
self.jumpViewList = {}
|
2021-11-09 14:39:27 +08:00
|
|
|
|
self.itemPre = nil
|
2021-11-09 11:42:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return RewardTalismanSingleShowPopup2
|