PGRData/Script/matrix/xui/xuisupersmashbros/monster/grids/XUiSSBMonsterRewardGrid.lua

28 lines
No EOL
977 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local XUiSSBMonsterRewardGrid = XClass(nil, "XUiSSBMonsterRewardGrid")
function XUiSSBMonsterRewardGrid:Ctor(uiPrefab, rootUi)
--self:Init(uiPrefab, rootUi)
end
function XUiSSBMonsterRewardGrid:Init(uiPrefab, rootUi)
XTool.InitUiObjectByUi(self, uiPrefab)
--self.Reward = XUiGridCommon.New(rootUi, self.GridReward)
local energyItem = require("XUi/XUiSuperSmashBros/Common/XUiSSBDisplayItem")
self.Reward = energyItem.New(uiPrefab)
end
--==========
--刷新
--@param:
--isEnergy 是不是显示能量道具
--data: 当显示能量道具时这个表示道具数量不是的时候表示道具Id
--==========
function XUiSSBMonsterRewardGrid:Refresh(data, isLevelItem)
if isLevelItem then
self.Reward:Refresh(XDataCenter.SuperSmashBrosManager.GetLevelItem(), data)
elseif data then
self.Reward:Refresh((data.TemplateId and data.TemplateId > 0) and data.TemplateId or data.Id, data.Count)
end
end
return XUiSSBMonsterRewardGrid