miduo_client/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleEquipTreasureChangePopu...

520 lines
24 KiB
Lua
Raw Normal View History

2020-08-25 15:46:38 +08:00
require("Base/BasePanel")
2020-05-09 13:31:21 +08:00
RoleEquipTreasureChangePopup = Inherit(BasePanel)
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
local spcialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig)
local this=RoleEquipTreasureChangePopup
local type--1 穿装备 2 卸装备 3 替换装备
local curHeroData
local curEquipData
local nextEquipData
local openThisPanel
local equipIdList
local equipDataList
local position
2020-12-15 17:27:16 +08:00
local curBasePropertyList={}
local nextBasePropertyList={}
local curRefinePropertyList={}
local nextRefinePropertyList={}
local curTreePropertyList={}
local nextTreePropertyList={}
2020-05-09 13:31:21 +08:00
--初始化组件(用于子类重写)
function RoleEquipTreasureChangePopup:InitComponent()
this.btnBack= Util.GetGameObject(self.transform, "btnBack")
this.bg1= Util.GetGameObject(self.transform, "GameObject/bg1")
this.desc1= Util.GetGameObject(self.transform, "GameObject/bg1/equipInfo/Text"):GetComponent("Text")
this.currEquipProImg=Util.GetGameObject(self.transform, "GameObject/bg1/equipInfo/proImg"):GetComponent("Image")
this.curEquipName=Util.GetGameObject(self.transform, "GameObject/bg1/equipInfo/name/text"):GetComponent("Text")
this.curEquipFrame=Util.GetGameObject(self.transform, "GameObject/bg1/equipInfo/frame"):GetComponent("Image")
this.curEquipIcon=Util.GetGameObject(self.transform, "GameObject/bg1/equipInfo/icon"):GetComponent("Image")
this.curEquipTypeText=Util.GetGameObject(self.transform, "GameObject/bg1/equipInfo/equipTypeText"):GetComponent("Text")
this.curEquipLvText=Util.GetGameObject(self.transform, "GameObject/bg1/equipInfo/lvTxt"):GetComponent("Text")
this.curEquipRefineLvTxt=Util.GetGameObject(self.transform, "GameObject/bg1/equipInfo/starTxt"):GetComponent("Text")
this.treeImg1=Util.GetGameObject(self.transform, "GameObject/bg1/equipInfo/treeImg")
this.curEquipTreeLvTxt=Util.GetGameObject(self.transform, "GameObject/bg1/equipInfo/treeImg/treeTxt"):GetComponent("Text")
2020-05-09 13:31:21 +08:00
this.curEquipBtns=Util.GetGameObject(self.transform, "GameObject/bg1/btns")
this.curEquipBtnStrong=Util.GetGameObject(self.transform, "GameObject/bg1/btns/btnStrong")
this.curEquipBtnRefine=Util.GetGameObject(self.transform, "GameObject/bg1/btns/btnRefine")
this.curEquipBtnRemove=Util.GetGameObject(self.transform, "GameObject/bg1/btns/btnRemove")
this.curEquipBtnAdd=Util.GetGameObject(self.transform, "GameObject/bg1/btns/btnAdd")
this.curEquipBtnChange=Util.GetGameObject(self.transform, "GameObject/bg1/btns/btnChange")
this.qualityText=Util.GetGameObject(self.transform, "GameObject/bg1/equipInfo/qualityText"):GetComponent("Text")
this.powerNum1=Util.GetGameObject(self.transform, "GameObject/bg1/equipInfo/powerNum"):GetComponent("Text")
this.powerUPorDown1=Util.GetGameObject(self.transform, "GameObject/bg1/equipInfo/powerUPorDown")
this.propertyPre=Util.GetGameObject(self.transform, "GameObject/bg1/PropertyTxt")
this.curEquipSign=Util.GetGameObject(self.transform, "GameObject/bg1/Text")
2020-12-15 17:27:16 +08:00
2020-05-09 13:31:21 +08:00
this.bg2= Util.GetGameObject(self.transform, "GameObject/bg2")
this.desc2= Util.GetGameObject(self.transform, "GameObject/bg2/equipInfo/Text"):GetComponent("Text")
this.nextEquipName=Util.GetGameObject(self.transform, "GameObject/bg2/equipInfo/name/text"):GetComponent("Text")
this.nextEquipFrame=Util.GetGameObject(self.transform, "GameObject/bg2/equipInfo/frame"):GetComponent("Image")
this.nextEquipIcon=Util.GetGameObject(self.transform, "GameObject/bg2/equipInfo/icon"):GetComponent("Image")
this.nextEquipTypeText=Util.GetGameObject(self.transform, "GameObject/bg2/equipInfo/equipTypeText"):GetComponent("Text")
this.nextEquipLvText=Util.GetGameObject(self.transform, "GameObject/bg2/equipInfo/lvTxt"):GetComponent("Text")
this.nextEquipBtns=Util.GetGameObject(self.transform, "GameObject/bg2/btns")
this.nextEquipBtns:SetActive(false)
this.nextEquipProImg=Util.GetGameObject(self.transform, "GameObject/bg2/equipInfo/proImg"):GetComponent("Image")
this.nextEquipBtnStrong=Util.GetGameObject(self.transform, "GameObject/bg2/btns/btnStrong")
this.nextEquipBtnRefine=Util.GetGameObject(self.transform, "GameObject/bg2/btns/btnRefine")
this.nextEquipBtnRemove=Util.GetGameObject(self.transform, "GameObject/bg2/btns/btnRemove")
this.nextEquipBtnAdd=Util.GetGameObject(self.transform, "GameObject/bg2/btns/btnAdd")
this.nextEquipBtnChange=Util.GetGameObject(self.transform, "GameObject/bg2/btns/btnChange")
this.qualityText2=Util.GetGameObject(self.transform, "GameObject/bg2/equipInfo/qualityText"):GetComponent("Text")
this.GameObject=Util.GetGameObject(self.transform, "GameObject")
this.powerNum2=Util.GetGameObject(self.transform, "GameObject/bg2/equipInfo/powerNum"):GetComponent("Text")
this.powerUPorDown2=Util.GetGameObject(self.transform, "GameObject/bg2/equipInfo/powerUPorDown")
this.nextEquipRefineLvTxt=Util.GetGameObject(self.transform, "GameObject/bg2/equipInfo/starTxt"):GetComponent("Text")
this.treeImg2=Util.GetGameObject(self.transform, "GameObject/bg2/equipInfo/treeImg")
this.nextEquipTreeLvTxt=Util.GetGameObject(self.transform, "GameObject/bg2/equipInfo/treeImg/treeTxt"):GetComponent("Text")
2020-12-15 17:27:16 +08:00
this.TextPre = Util.GetGameObject(self.transform, "GameObject/bg1/TextPre")
this.curBaseAttri = Util.GetGameObject(self.transform, "GameObject/bg1/Scroll/grid/baseAttri")
this.curBaseAttriNum = Util.GetGameObject(this.curBaseAttri, "name/attriNum"):GetComponent("Text")
this.curBaseAttriGrid = Util.GetGameObject(this.curBaseAttri, "grid")
this.curRefineAttri = Util.GetGameObject(self.transform, "GameObject/bg1/Scroll/grid/refineAttri")
this.curRefineAttriNum = Util.GetGameObject(this.curRefineAttri, "name/attriNum"):GetComponent("Text")
this.curRefineAttriGrid = Util.GetGameObject(this.curRefineAttri, "grid")
this.curTreeAttri = Util.GetGameObject(self.transform, "GameObject/bg1/Scroll/grid/treeAttri")
this.curTreeAttriNum = Util.GetGameObject(this.curTreeAttri, "name/attriNum"):GetComponent("Text")
this.curTreeAttriGrid = Util.GetGameObject(this.curTreeAttri, "grid")
this.nextBaseAttri = Util.GetGameObject(self.transform, "GameObject/bg2/Scroll/grid/baseAttri")
this.nextBaseAttriNum = Util.GetGameObject(this.nextBaseAttri, "name/attriNum"):GetComponent("Text")
this.nextBaseAttriGrid = Util.GetGameObject(this.nextBaseAttri, "grid")
this.nextRefineAttri = Util.GetGameObject(self.transform, "GameObject/bg2/Scroll/grid/refineAttri")
this.nextRefineAttriNum = Util.GetGameObject(this.nextRefineAttri, "name/attriNum"):GetComponent("Text")
this.nextRefineAttriGrid = Util.GetGameObject(this.nextRefineAttri, "grid")
this.nextTreeAttri = Util.GetGameObject(self.transform, "GameObject/bg2/Scroll/grid/treeAttri")
this.nextTreeAttriNum = Util.GetGameObject(this.nextTreeAttri, "name/attriNum"):GetComponent("Text")
this.nextTreeAttriGrid = Util.GetGameObject(this.nextTreeAttri, "grid")
2020-05-09 13:31:21 +08:00
end
--绑定事件(用于子类重写)
function RoleEquipTreasureChangePopup:BindEvent()
Util.AddClick(this.btnBack, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel()
end)
Util.AddClick(this.curEquipBtnRemove, function()
equipIdList={}
equipDataList={}
table.insert(equipIdList,curEquipData.idDyn)
table.insert(equipDataList,curEquipData)
NetManager.EquipUnLoadOptRequest(curHeroData.dynamicId,equipIdList ,2,function ()
self:ClosePanel()
openThisPanel.UpdateEquipPosHeroData(2,type,equipDataList)
end)
end)
Util.AddClick(this.curEquipBtnAdd, function()
local config=spcialConfig[40]
if config then
local limits = string.split(config.Value, "|")
if limits then
local heroConfig=ConfigManager.GetConfigData(ConfigName.HeroConfig,curHeroData.id)
local lvs=string.split(limits[1],"#")
local stars=string.split(limits[2],"#")
local lv=tonumber(lvs[2])
if PlayerManager.level<lv then
2020-06-23 18:36:24 +08:00
PopupTipPanel.ShowTip(string.format(Language[11829],lv))
2020-05-09 13:31:21 +08:00
return
else
local star=tonumber(stars[2])
if heroConfig~=nil and curHeroData.star< star then
2020-06-23 18:36:24 +08:00
PopupTipPanel.ShowTip(string.format(Language[11830],star))
2020-05-09 13:31:21 +08:00
return
end
end
end
end
equipIdList={}
equipDataList={}
table.insert(equipIdList,curEquipData.idDyn)
table.insert(equipDataList,curEquipData)
NetManager.EquipWearRequest(curHeroData.dynamicId,equipIdList,2,function ()
self:ClosePanel()
openThisPanel.UpdateEquipPosHeroData(2,type,equipDataList,0,position)
end)
end)
Util.AddClick(this.nextEquipBtnChange, function()
equipIdList={}
equipDataList={}
table.insert(equipIdList,nextEquipData.idDyn)
table.insert(equipDataList,nextEquipData)
NetManager.EquipWearRequest(curHeroData.dynamicId,equipIdList,2,function ()
self:ClosePanel()
openThisPanel.UpdateEquipPosHeroData(2,type,equipDataList,curEquipData,position)
end)
end)
Util.AddClick(this.nextEquipBtnStrong, function()
UIManager.OpenPanel(UIName.EquipTreasureStrongPopup,nextEquipData,1)
end)
Util.AddClick(this.curEquipBtnStrong, function()
UIManager.OpenPanel(UIName.EquipTreasureStrongPopup,curEquipData,1)
end)
Util.AddClick(this.nextEquipBtnRefine, function()
UIManager.OpenPanel(UIName.EquipTreasureStrongPopup,nextEquipData,2)
end)
Util.AddClick(this.curEquipBtnRefine, function()
UIManager.OpenPanel(UIName.EquipTreasureStrongPopup,curEquipData,2)
end)
end
--添加事件监听(用于子类重写)
function RoleEquipTreasureChangePopup:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Treasure.TreasureLvUp, this.CurrEquipDataChange)
end
--移除事件监听(用于子类重写)
function RoleEquipTreasureChangePopup:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Treasure.TreasureLvUp, this.CurrEquipDataChange)
end
function this.CurrEquipDataChange()
--替换
if type==3 then
nextEquipData = EquipTreasureManager.GetSingleEquipTreasreData(nextEquipData.idDyn)
this.NextCurEquipData()
else
curEquipData = EquipTreasureManager.GetSingleEquipTreasreData(curEquipData.idDyn)
this.ShowCurEquipData()
end
end
--界面打开时调用(用于子类重写)
function RoleEquipTreasureChangePopup:OnOpen(_openThisPanel,_type,_curHeroData,_curEquipData,_nextEquipData,_position)
openThisPanel = _openThisPanel
2020-05-15 16:52:35 +08:00
type = _type--1 穿戴 2 卸下 3 替换 4显示信息
2020-05-09 13:31:21 +08:00
curHeroData = _curHeroData
curEquipData = _curEquipData
nextEquipData = _nextEquipData
position = _position
end
function RoleEquipTreasureChangePopup:OnShow()
this.bg1:SetActive(false)
this.bg2:SetActive(false)
this.curEquipBtns:SetActive(false)
this.curEquipBtnStrong:SetActive(false)
this.curEquipBtnRefine:SetActive(false)
this.curEquipBtnRemove:SetActive(false)
this.curEquipBtnAdd:SetActive(false)
this.curEquipBtnChange:SetActive(false)
this.nextEquipBtns:SetActive(false)
this.nextEquipBtnStrong:SetActive(false)
this.nextEquipBtnRefine:SetActive(false)
this.nextEquipBtnRemove:SetActive(false)
this.nextEquipBtnAdd:SetActive(false)
this.nextEquipBtnChange:SetActive(false)
2020-12-15 17:27:16 +08:00
this.curBaseAttri:SetActive(true)
2020-05-09 13:31:21 +08:00
if type==1 then
2020-12-15 17:27:16 +08:00
this.ShowCurEquipData()
2020-05-09 13:31:21 +08:00
this.bg1:SetActive(true)
this.curEquipBtns:SetActive(true)
this.curEquipBtnAdd:SetActive(true)
this.curEquipBtnStrong:SetActive(true)
this.curEquipBtnRefine:SetActive(true)
this.curEquipSign.gameObject:SetActive(false)
2020-12-15 17:27:16 +08:00
elseif type==2 then
this.ShowCurEquipData()
2020-05-09 13:31:21 +08:00
this.bg1:SetActive(true)
this.curEquipBtns:SetActive(true)
this.curEquipBtnStrong:SetActive(true)
this.curEquipBtnRefine:SetActive(true)
this.curEquipBtnRemove:SetActive(true)
this.curEquipSign.gameObject:SetActive(false)
elseif type==3 then
2020-12-15 17:27:16 +08:00
this.ShowCurEquipData()
2020-05-09 13:31:21 +08:00
this.NextCurEquipData()
this.curEquipSign.gameObject:SetActive(true)
this.bg1:SetActive(true)
this.bg2:SetActive(true)
this.nextEquipBtns:SetActive(true)
this.nextEquipBtnChange:SetActive(true)
this.nextEquipBtnStrong:SetActive(true)
this.nextEquipBtnRefine:SetActive(true)
2020-05-15 16:52:35 +08:00
elseif type==4 then
2020-12-15 17:27:16 +08:00
this.ShowCurEquipData()
2020-05-15 16:52:35 +08:00
this.bg1:SetActive(true)
this.curEquipBtns:SetActive(false)
this.curEquipBtnStrong:SetActive(true)
this.curEquipBtnRefine:SetActive(true)
this.curEquipBtnRemove:SetActive(true)
this.curEquipSign.gameObject:SetActive(false)
end
2020-05-09 13:31:21 +08:00
end
function this.ShowCurEquipData()
local equipConfigData=ConfigManager.GetConfigData(ConfigName.JewelConfig, curEquipData.id)
local itemConfigData=ConfigManager.GetConfigData(ConfigName.ItemConfig, curEquipData.id)
local curPower=EquipTreasureManager.CalculateWarForce(curEquipData.idDyn)
this.powerNum1.text=curPower
this.desc1.text=itemConfigData.ItemDescribe
if type==3 and nextEquipData~=nil then
local nextPower=EquipTreasureManager.CalculateWarForce(nextEquipData.idDyn)
if(curPower>nextPower) then
this.powerUPorDown1:SetActive(true)
this.powerUPorDown1:GetComponent("Image").sprite=Util.LoadSprite(PowerChangeIconDef[1])
elseif(curPower<nextPower )then
this.powerUPorDown1:SetActive(true)
this.powerUPorDown1:GetComponent("Image").sprite=Util.LoadSprite(PowerChangeIconDef[2])
else
this.powerUPorDown1:SetActive(false)
end
else
this.powerUPorDown1:SetActive(false)
end
this.qualityText.text=GetStringByEquipQua(equipConfigData.Level,GetQuaStringByEquipQua(equipConfigData.Level))
this.curEquipName.text=itemConfigData.Name
2020-06-23 18:36:24 +08:00
this.curEquipTypeText.text=string.format(Language[11831],EquipTreasureTypeStr[equipConfigData.Location])
2020-05-09 13:31:21 +08:00
this.curEquipFrame.sprite = Util.LoadSprite(curEquipData.frame)
this.curEquipIcon.sprite = Util.LoadSprite(curEquipData.icon)
this.currEquipProImg.sprite=Util.LoadSprite(curEquipData.proIcon)
2020-12-15 17:27:16 +08:00
--强化等级
2020-05-09 13:31:21 +08:00
local lv=curEquipData.lv
if lv==0 then
this.curEquipLvText.gameObject:SetActive(false)
else
this.curEquipLvText.gameObject:SetActive(true)
this.curEquipLvText.text=lv
end
--精良等级
2020-05-09 13:31:21 +08:00
local refine=curEquipData.refineLv
if refine==0 then
this.curEquipRefineLvTxt.gameObject:SetActive(false)
else
this.curEquipRefineLvTxt.gameObject:SetActive(true)
this.curEquipRefineLvTxt.text="+"..refine
end
--神应等级
local treeLv=curEquipData.treeLv
if curEquipData.upHeroDid == "" or curEquipData.upHeroDid == "0" or treeLv == 0 then
this.treeImg1:SetActive(false)
else
this.treeImg1:SetActive(true)
this.curEquipTreeLvTxt.text=treeLv
end
2020-12-15 17:27:16 +08:00
--(基础属性)
local baseInfo=EquipTreasureManager.GetCurLvPropertyValue(1,curEquipData.levelPool,curEquipData.lv)
this.curBaseAttriNum.text = "[强化等级:"..curEquipData.lv.."/"..curEquipData.maxLv.."]"
this.SetPropertyShow1(baseInfo,curBasePropertyList,this.curBaseAttriGrid)
--(精炼属性)
local refineInfo=EquipTreasureManager.GetCurLvPropertyValue(2,curEquipData.refinePool,curEquipData.refineLv)
this.curRefineAttriNum.text = "[精炼等级:"..curEquipData.refineLv.."/"..curEquipData.maxRefineLv.."]"
if LengthOfTable(refineInfo)==0 or refineInfo==nil then
this.curRefineAttri:SetActive(false)
2020-05-09 13:31:21 +08:00
else
2020-12-15 17:27:16 +08:00
this.curRefineAttri:SetActive(true)
this.SetPropertyShow1(refineInfo,curRefinePropertyList,this.curRefineAttriGrid)
end
--(神应属性)
-- local tLv = curEquipData.treeLv <= curEquipData.maxTreeLv and curEquipData.treeLv or curEquipData.maxTreeLv
-- LogYellow("Pool:"..curEquipData.treePool.." tLv:"..tLv)
local treeInfo=EquipTreasureManager.GetCurLvPropertyValue(3,curEquipData.treePool,curEquipData.treeLv)
this.curTreeAttriNum.text = "[神应等级:"..curEquipData.treeLv.."/"..curEquipData.maxTreeLv.."]"
if curEquipData.upHeroDid == "" or curEquipData.upHeroDid == "0" then
this.curTreeAttri:SetActive(false)
else
this.curTreeAttri:SetActive(true)
this.SetPropertyShow2(treeInfo,curTreePropertyList,this.curTreeAttriGrid)
2020-05-09 13:31:21 +08:00
end
2020-12-15 17:27:16 +08:00
-- --(神应属性)
-- local treeInfo=SacredTreeManager.GetCurLvPropertyValue(3,nextEquipData.treePool,nextEquipData.treeLv)
-- this.nextTreeAttriNum.text = "[神应等级:"..nextEquipData.treeLv.."/"..nextEquipData.maxTreeLv.."]"
-- if nextEquipData.upHeroDid == "" or nextEquipData.upHeroDid == "0" then
-- this.nextTreeAttri:SetActive(false)
-- else
-- this.nextTreeAttri:SetActive(true)
-- this.SetPropertyShow2(treeInfo,nextTreePropertyList,this.nextTreeAttriGrid)
-- end
2020-05-09 13:31:21 +08:00
end
2020-12-15 17:27:16 +08:00
2020-05-09 13:31:21 +08:00
function this.NextCurEquipData()
local equipConfigData=ConfigManager.GetConfigData(ConfigName.JewelConfig, nextEquipData.id)
local itemConfigData=ConfigManager.GetConfigData(ConfigName.ItemConfig, nextEquipData.id)
local nextPower=EquipTreasureManager.CalculateWarForce(nextEquipData.idDyn)
local curPower=0
if curEquipData~=nil then
curPower=EquipTreasureManager.CalculateWarForce(curEquipData.idDyn)
end
this.powerNum2.text=nextPower
this.powerUPorDown2:SetActive(false)
if type==3 and curEquipData~=null then
if nextPower>curPower then
this.powerUPorDown2:SetActive(true)
this.powerUPorDown2:GetComponent("Image").sprite=Util.LoadSprite(PowerChangeIconDef[1])
elseif nextPower<curPower then
this.powerUPorDown2:SetActive(true)
this.powerUPorDown2:GetComponent("Image").sprite=Util.LoadSprite(PowerChangeIconDef[2])
else
this.powerUPorDown2:SetActive(false)
end
else
this.powerUPorDown1:SetActive(false)
end
this.qualityText2.text=GetStringByEquipQua(equipConfigData.Level,GetQuaStringByEquipQua(equipConfigData.Level))
this.nextEquipName.text=nextEquipData.name
this.desc2.text=itemConfigData.ItemDescribe
--强化
2020-05-09 13:31:21 +08:00
local lv=nextEquipData.lv
if lv==0 then
this.nextEquipLvText.gameObject:SetActive(false)
else
this.nextEquipLvText.gameObject:SetActive(true)
this.nextEquipLvText.text=lv
end
--精炼
2020-05-09 13:31:21 +08:00
local refine=nextEquipData.refineLv
if refine==0 then
this.nextEquipRefineLvTxt.gameObject:SetActive(false)
else
this.nextEquipRefineLvTxt.gameObject:SetActive(true)
this.nextEquipRefineLvTxt.text="+" ..refine
end
--神应等级
2020-12-15 17:27:16 +08:00
local treeLv=nextEquipData.treeLv
if nextEquipData.upHeroDid == "" or nextEquipData.upHeroDid == "0" or treeLv == 0 then
this.treeImg2:SetActive(false)
else
this.treeImg2:SetActive(true)
this.nextEquipTreeLvTxt.text=treeLv
end
2020-05-09 13:31:21 +08:00
this.nextEquipFrame.sprite = Util.LoadSprite(nextEquipData.frame)
this.nextEquipIcon.sprite = Util.LoadSprite(nextEquipData.icon)
this.nextEquipProImg.sprite=Util.LoadSprite(nextEquipData.proIcon)
2020-06-23 18:36:24 +08:00
this.nextEquipTypeText.text=string.format(Language[11831],EquipTreasureTypeStr[equipConfigData.Location])
2020-12-15 17:27:16 +08:00
--(基础属性)
local baseInfo=EquipTreasureManager.GetCurLvPropertyValue(1,nextEquipData.levelPool,nextEquipData.lv)
this.nextBaseAttriNum.text = "[强化等级:"..nextEquipData.lv.."/"..nextEquipData.maxLv.."]"
this.SetPropertyShow1(baseInfo,nextBasePropertyList,this.nextBaseAttriGrid)
--(精炼属性)
local refineInfo=EquipTreasureManager.GetCurLvPropertyValue(2,nextEquipData.refinePool,nextEquipData.refineLv)
this.nextRefineAttriNum.text = "[精炼等级:"..nextEquipData.refineLv.."/"..nextEquipData.maxRefineLv.."]"
if LengthOfTable(refineInfo)==0 or refineInfo==nil then
this.nextRefineAttri:SetActive(false)
2020-05-09 13:31:21 +08:00
else
2020-12-15 17:27:16 +08:00
this.nextRefineAttri:SetActive(true)
this.SetPropertyShow1(refineInfo,nextRefinePropertyList,this.nextRefineAttriGrid)
end
--(神应属性)
local treeInfo=SacredTreeManager.GetCurLvPropertyValue(3,nextEquipData.treePool,nextEquipData.treeLv)
this.nextTreeAttriNum.text = "[神应等级:"..nextEquipData.treeLv.."/"..nextEquipData.maxTreeLv.."]"
if nextEquipData.upHeroDid == "" or nextEquipData.upHeroDid == "0" then
this.nextTreeAttri:SetActive(false)
else
this.nextTreeAttri:SetActive(true)
this.SetPropertyShow2(treeInfo,nextTreePropertyList,this.nextTreeAttriGrid)
2020-05-09 13:31:21 +08:00
end
end
2020-12-15 17:27:16 +08:00
--神应专用
function this.SetPropertyShow2(_infos,_preList,_grid)
local curTree = SacredTreeManager.CulAttri()
local attriConfig = ConfigManager.GetConfigDataByKey(ConfigName.GodHoodTreeSetting,"Id",0).PropertyUnlcokLevelForClient
local dataCount=LengthOfTable(_infos)
local preCount=#_preList
for i = 1, dataCount-preCount do
local go = newObject(this.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(attriConfig) do
local obj=_preList[index]
local proper=propertyConfig[value[1]]
local string
if proper.Style==1 then
string = proper.Info.."+".._infos[value[1]].currValue--value.currValue
else
string = proper.Info.."+".._infos[value[1]].currValue/100 .."%"
end
if index <= curTree then
string = "<color=#3CD200>"..string.."</color>"
else
string = "<color=#828282>"..string.."\n".."<size=25>(四灵试炼"..attriConfig[index][2].."层解锁)</size></color>"
end
obj.transform:GetComponent("Text").text = string
obj.gameObject:SetActive(true)
index=index+1
end
for i = 1, #_preList do
if i>=index then
_preList[i]:SetActive(false)
end
end
end
2020-05-09 13:31:21 +08:00
2020-12-15 17:27:16 +08:00
function this.SetPropertyShow1(_infos,_preList,_grid)
2020-05-09 13:31:21 +08:00
local dataCount=LengthOfTable(_infos)
local preCount=#_preList
for i = 1, dataCount-preCount do
2020-12-15 17:27:16 +08:00
local go = newObject(this.TextPre)
2020-05-09 13:31:21 +08:00
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
2020-12-15 17:27:16 +08:00
obj.transform:GetComponent("Text").text = proper.Info.."+".. value.currValue
2020-05-09 13:31:21 +08:00
else
2020-12-15 17:27:16 +08:00
obj.transform:GetComponent("Text").text=proper.Info.."+"..value.currValue/100 .."%"
2020-05-09 13:31:21 +08:00
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 RoleEquipTreasureChangePopup:OnClose()
end
--界面销毁时调用(用于子类重写)
function RoleEquipTreasureChangePopup:OnDestroy()
2020-12-15 17:27:16 +08:00
type=0--1 穿装备 2 卸装备 3 替换装备
curHeroData=nil
curEquipData=nil
nextEquipData=nil
openThisPanel=nil
equipIdList=nil
equipDataList=nil
position=0
curBasePropertyList={}
nextBasePropertyList={}
curRefinePropertyList={}
nextRefinePropertyList={}
curTreePropertyList={}
nextTreePropertyList={}
2020-05-09 13:31:21 +08:00
end
2020-06-23 18:36:24 +08:00
return RoleEquipTreasureChangePopup