奖励显示碎片
This commit is contained in:
parent
a44fb6ca2c
commit
f73980c7de
@ -7,6 +7,7 @@ function RewardCell:init()
|
||||
self.mask = uiMap["reward_cell.item_bg.mask"]
|
||||
self.check = uiMap["reward_cell.check"]
|
||||
self.numTx = uiMap["reward_cell.item_bg.num"]
|
||||
self.fragment = uiMap["reward_cell.item_bg.fragment"]
|
||||
end
|
||||
|
||||
function RewardCell:refresh(reward)
|
||||
@ -15,11 +16,7 @@ function RewardCell:refresh(reward)
|
||||
if reward.type == GConst.REWARD_TYPE.ITEM then
|
||||
self:_refreshItem(reward.item)
|
||||
id = reward.item.cfg_id or reward.item.id
|
||||
-- elseif reward.type == GConst.REWARD_TYPE.EQUIP then
|
||||
-- self:_refreshEquip(reward.equip)
|
||||
-- id = reward.equip.id
|
||||
end
|
||||
|
||||
if id then
|
||||
self:addClickListener(function()
|
||||
ModuleManager.TipsManager:showRewardTips(id, reward.type, self.baseObject)
|
||||
@ -34,9 +31,6 @@ function RewardCell:refreshByConfig(reward, mask, check)
|
||||
if reward.type == GConst.REWARD_TYPE.ITEM then
|
||||
self:_refreshItem(reward)
|
||||
id = reward.id
|
||||
elseif reward.type == GConst.REWARD_TYPE.EQUIP then
|
||||
-- self:_refreshEquip(reward)
|
||||
-- id = reward.id
|
||||
end
|
||||
|
||||
if id then
|
||||
@ -51,23 +45,23 @@ function RewardCell:_refreshItem(item)
|
||||
if info == nil then
|
||||
return
|
||||
end
|
||||
|
||||
self.numTx:setVisible(true)
|
||||
self.frameBg:setSprite(GConst.ATLAS_PATH.ICON_ITEM, "frame_0")
|
||||
self.icon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, info.icon)
|
||||
self.numTx:setText(item.count or item.num)
|
||||
end
|
||||
|
||||
function RewardCell:_refreshEquip(equip)
|
||||
local info = ConfigManager:getConfig("equip")[equip.id]
|
||||
if info == nil then
|
||||
return
|
||||
if info.type == GConst.ItemConst.ITEM_TYPE.HERO_FRAGMENT then
|
||||
local heroInfo = ConfigManager:getConfig("hero")[info.parameter]
|
||||
if heroInfo then
|
||||
self.icon:setLocalScale(0.86, 0.86, 0.86)
|
||||
self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO, heroInfo.icon)
|
||||
else
|
||||
self.icon:setSprite(GConst.ATLAS_PATH.COMMON, "common_alpha")
|
||||
end
|
||||
self.fragment:setVisible(true)
|
||||
else
|
||||
self.icon:setLocalScale(1, 1, 1)
|
||||
self.icon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, info.icon)
|
||||
self.fragment:setVisible(false)
|
||||
end
|
||||
|
||||
self.numTx:setVisible(true)
|
||||
self.frameBg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "frame_" .. info.qlt)
|
||||
self.icon:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, tostring(info.icon))
|
||||
self.numTx:setText(equip.count)
|
||||
end
|
||||
|
||||
function RewardCell:showNumTx(str)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user