miduo_client/Assets/ManagedResources/~Lua/Modules/Incarnation/IncarnationUpHelpPopup.lua

107 lines
3.0 KiB
Lua
Raw Normal View History

2022-04-24 22:13:28 +08:00
require("Base/BasePanel")
IncarnationUpHelpPopup = Inherit(BasePanel)
local this=IncarnationUpHelpPopup
local PropertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
function this:InitComponent()
this.btnBack = Util.GetGameObject(self.gameObject, "BackMask")
this.back = Util.GetGameObject(self.gameObject, "BG/BackBtn")
2022-11-02 17:20:28 +08:00
this.itemList={}
for i=1,5 do
local item=Util.GetGameObject(self.gameObject, "scroll/grid/item"..i)
table.insert(this.itemList,item)
end
2022-04-24 22:13:28 +08:00
end
function this:BindEvent()
Util.AddClick(this.btnBack, function()
self:ClosePanel()
end)
Util.AddClick(this.back, function()
self:ClosePanel()
end)
end
--添加事件监听(用于子类重写)
function this:AddListener()
end
--移除事件监听(用于子类重写)
function this:RemoveListener()
end
function this:OnSortingOrderChange()
end
function this:OnOpen(_cardId)
2022-11-02 17:20:28 +08:00
for i = 1, #this.itemList do
this.UpdateItemInfo(this.itemList[i],_cardId,i)
end
end
function this.UpdateItemInfo(go,_cardId,star)
local maxLevel=Util.GetGameObject(go, "maxLevel"):GetComponent("Text")
local propGrid=Util.GetGameObject(go, "propLayout/grid")
local skillDes=Util.GetGameObject(go, "skillDes"):GetComponent("Text")
local starList={}
for i=1,5 do
local starObj=Util.GetGameObject(go, "maxStar/Image"..i)
if i<=star then
starObj:SetActive(true)
else
starObj:SetActive(false)
end
--table.insert(starList,star)
end
2022-04-24 22:13:28 +08:00
local cardData= IncarnationManager.itemDataList[_cardId]
local cardConfig=ConfigManager.GetConfigData(ConfigName.ChangingCard,_cardId)
2022-11-02 17:20:28 +08:00
local starConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.ChangingCardStar,"PoolId",cardConfig.Star,"Level",star)
2022-11-02 11:48:41 +08:00
local maxStarProp=starConfig.Exp
2022-04-25 15:52:46 +08:00
local levelConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.ChangingCardLevel,"PoolId",cardConfig.LevelUpPool,"Level",cardConfig.LevelMax)
local maxLevelProp=levelConfig.PropList
2022-11-02 17:20:28 +08:00
maxLevel.text=cardConfig.LevelMax..""
skillDes.text="技能:"..IncarnationManager.GetSkillDesStr(_cardId,star)
2022-04-25 15:52:46 +08:00
local propList={}
for k,v in pairs(maxStarProp) do
if propList[v[1]] then
propList[v[1]]=propList[v[1]]+v[2]
2022-04-24 22:13:28 +08:00
else
2022-04-25 15:52:46 +08:00
propList[v[1]]=v[2]
2022-04-24 22:13:28 +08:00
end
2022-04-25 15:52:46 +08:00
end
for k,v in pairs(maxLevelProp) do
if propList[v[1]] then
propList[v[1]]=propList[v[1]]+v[2]
2022-04-24 22:13:28 +08:00
else
2022-04-25 15:52:46 +08:00
propList[v[1]]=v[2]
2022-04-24 22:13:28 +08:00
end
2022-04-25 15:52:46 +08:00
end
local index=0
for k,v in pairs(propList) do
2022-11-02 17:20:28 +08:00
local propText=propGrid.transform:GetChild(index):GetComponent("Text")
2022-04-25 15:52:46 +08:00
propText.text = PropertyConfig[k].Info.."+"..GetPropertyFormatStrOne(PropertyConfig[k].Style,v)
2022-04-24 22:13:28 +08:00
index=index+1
end
end
2022-11-02 17:20:28 +08:00
2022-04-24 22:13:28 +08:00
function this:OnShow()
end
function this:OnClose()
end
--界面销毁时调用(用于子类重写)
function this:OnDestroy()
2022-11-02 17:20:28 +08:00
this.itemList={}
2022-04-24 22:13:28 +08:00
end
return this