diff --git a/lua/app/ui/common/cell/reward_cell.lua b/lua/app/ui/common/cell/reward_cell.lua index 0d939419..1d8195d2 100644 --- a/lua/app/ui/common/cell/reward_cell.lua +++ b/lua/app/ui/common/cell/reward_cell.lua @@ -19,7 +19,8 @@ function RewardCell:refresh(reward) end if id then self:addClickListener(function() - ModuleManager.TipsManager:showRewardTips(id, reward.type, self.baseObject) + local desc = self:getRewardDesc(id, reward.type) + ModuleManager.TipsManager:showDescTips(desc, self.baseObject) end) end end @@ -35,7 +36,8 @@ function RewardCell:refreshByConfig(reward, mask, check) if id then self:addClickListener(function() - ModuleManager.TipsManager:showRewardTips(id, reward.type, self.baseObject) + local desc = self:getRewardDesc(id, reward.type) + ModuleManager.TipsManager:showDescTips(desc, self.baseObject) end) end end @@ -104,4 +106,14 @@ function RewardCell:setLocalScale(x, y, z) self.baseObject:setLocalScale(x, y, z) end +function RewardCell:getRewardDesc(id, rewardType) + if rewardType == GConst.REWARD_TYPE.ITEM then + local item18NInfo = I18N:getConfig("item")[id] + if item18NInfo then + return item18NInfo.desc + end + end + return GConst.EMPTY_STRING +end + return RewardCell \ No newline at end of file