diff --git a/lua/app/config/strings/cn/item.lua b/lua/app/config/strings/cn/item.lua index 59df7f1a..c7e028d6 100644 --- a/lua/app/config/strings/cn/item.lua +++ b/lua/app/config/strings/cn/item.lua @@ -275,6 +275,10 @@ local item = { ["name"]="死灵法师", ["desc"]="凑齐可解锁或升级。" }, + [10001]={ + ["name"]="箱子", + ["desc"]="箱子" + }, [55002]={ ["name"]="血族快递伯爵", ["desc"]="凑齐可解锁或升级。" diff --git a/lua/app/module/item/item_const.lua b/lua/app/module/item/item_const.lua index fc16d773..a1623a18 100644 --- a/lua/app/module/item/item_const.lua +++ b/lua/app/module/item/item_const.lua @@ -41,6 +41,8 @@ ItemConst.ITEM_TYPE = { FIXED_BOX_ITEM = 8, AVATAR = 9, FRAME = 10, + BOX_SELECT = 12, -- 选宝箱(背包中使用) + BOX_RANDOM = 13, -- 随机宝箱(背包中使用) -- EPIC_HERO_FRAMENT = 11, -- SKIN = 12 } diff --git a/lua/app/module/tips/tips_manager.lua b/lua/app/module/tips/tips_manager.lua index ed307651..68af9a83 100644 --- a/lua/app/module/tips/tips_manager.lua +++ b/lua/app/module/tips/tips_manager.lua @@ -28,16 +28,17 @@ function TipsManager:showHelpTips(params) UIManager:showUI("app/ui/tips/help_tips", params) end -function TipsManager:showRewardTips(rewardId, rewardType, tarPrefabObj, alignType) +function TipsManager:showRewardTips(rewardId, rewardType, tarPrefabObj, alignType, params, showItemTip) if rewardType == GConst.REWARD_TYPE.ITEM then local info = ConfigManager:getConfig("item")[rewardId] if info then - if info.type == GConst.ItemConst.ITEM_TYPE.RANDOM_FRAGMENT - or info.type == GConst.ItemConst.ITEM_TYPE.EPIC_HERO_FRAMENT then - -- 随机碎片 or 权重随机碎片 or 史诗英雄碎片 - self:showHeroFragmentTips(rewardId) - return - elseif info.type == GConst.ItemConst.ITEM_TYPE.WEIGHT_FRAGMENT then + -- if info.type == GConst.ItemConst.ITEM_TYPE.RANDOM_FRAGMENT + -- or info.type == GConst.ItemConst.ITEM_TYPE.EPIC_HERO_FRAMENT then + -- -- 随机碎片 or 权重随机碎片 or 史诗英雄碎片 + -- self:showHeroFragmentTips(rewardId) + -- return + -- else + if info.type == GConst.ItemConst.ITEM_TYPE.WEIGHT_FRAGMENT then -- 宝箱 self:showWeightBoxTips(rewardId) return @@ -49,9 +50,14 @@ function TipsManager:showRewardTips(rewardId, rewardType, tarPrefabObj, alignTyp -- 英雄碎片 ModuleManager.HeroManager:showHeroDetailUI(info.parameter, true) return - elseif info.type == GConst.ItemConst.ITEM_TYPE.SKIN then - -- 英雄皮肤 - ModuleManager.HeroManager:showHeroSkinUI(DataManager.SkinData:getHeroIdBySkinId(info.parameter), info.parameter) + -- elseif info.type == GConst.ItemConst.ITEM_TYPE.SKIN then + -- -- 英雄皮肤 + -- ModuleManager.HeroManager:showHeroSkinUI(DataManager.SkinData:getHeroIdBySkinId(info.parameter), info.parameter) + -- return + elseif info.type == GConst.ItemConst.ITEM_TYPE.BOX_RANDOM or + info.type == GConst.ItemConst.ITEM_TYPE.BOX_SELECT then + -- 展示自选宝箱 + GFunc.showCommonBoxUI(rewardId, not showItemTip) return elseif info.type == GConst.ItemConst.ITEM_TYPE.RANDOM_BOX_ITEM or info.type == GConst.ItemConst.ITEM_TYPE.FIXED_BOX_ITEM then self:showBoxItemTips(rewardId) diff --git a/lua/app/ui/bag/bag_main_ui.lua b/lua/app/ui/bag/bag_main_ui.lua index 1eb2f007..4c821046 100644 --- a/lua/app/ui/bag/bag_main_ui.lua +++ b/lua/app/ui/bag/bag_main_ui.lua @@ -52,6 +52,9 @@ function BagMainUI:onLoadRootComplete() end) self.scrollRectComp:addRefreshCallback(function(index, cell) cell:refreshByEntity(self.list[index]) + cell:addClickListener(function() + ModuleManager.TipsManager:showRewardTips(self.list[index]:getId(), self.list[index]:getType(), cell.baseObject, nil, nil, true) + end) end) self.scrollRectComp:clearCells() end diff --git a/lua/app/ui/common/cell/reward_cell.lua b/lua/app/ui/common/cell/reward_cell.lua index f452e87b..a10cb6e8 100644 --- a/lua/app/ui/common/cell/reward_cell.lua +++ b/lua/app/ui/common/cell/reward_cell.lua @@ -27,6 +27,9 @@ function RewardCell:init() self.select = uiMap["reward_cell.content.item_bg.select"] -- 自选 self.choose = uiMap["reward_cell.choose"] + -- 概率标记 + self.probNode = uiMap["reward_cell.content.prob"] + self.txProb = uiMap["reward_cell.content.prob.tx_prob"] self:hideFrameAnimation() self.baseObject:addClickListener(function() @@ -36,6 +39,8 @@ function RewardCell:init() ModuleManager.TipsManager:showRewardTips(self.rewardId, self.rewardType, self.baseObject) end end) + + self:setShowProbTag(false) end function RewardCell:refresh(reward) @@ -60,6 +65,11 @@ function RewardCell:refreshByChoose() self.content:setVisible(false) end +function RewardCell:refreshById(id, num) + local reward = {id = id, type = GConst.REWARD_TYPE.ITEM, num = num} + self:refreshByConfig(reward) +end + function RewardCell:refreshByConfig(reward, mask, check) self:showMask(mask, check) if reward.type == GConst.REWARD_TYPE.ITEM then @@ -264,4 +274,12 @@ function RewardCell:showSelect(show) self.select:setActive(show == true) end +function RewardCell:setShowProbTag(show, prob) + if self.probNode == nil or self.txProb == nil then + return + end + self.probNode:setActive(show) + self.txProb:setText((prob or 0) .. "%") +end + return RewardCell \ No newline at end of file diff --git a/lua/app/ui/common/common_box_ui.lua b/lua/app/ui/common/common_box_ui.lua index 018f9d14..78ca8aa5 100755 --- a/lua/app/ui/common/common_box_ui.lua +++ b/lua/app/ui/common/common_box_ui.lua @@ -122,14 +122,14 @@ function CommonBoxUI:onRefresh() end) self.scrollRect:addRefreshCallback(function(index, cell) cell:refreshByConfig(self.rewards[index]) - cell:setShowSelect(index == self.curIndex) + cell:showSelect(index == self.curIndex) cell:setShowProbTag(self.itemType == GConst.ItemConst.ITEM_TYPE.BOX_RANDOM, self:getRewardProb(index)) if index ~= self.curIndex and self.itemType == GConst.ItemConst.ITEM_TYPE.BOX_SELECT then cell:addClickListener(function() self:onClickReward(index) end) else - -- cell:setClickShowTips() + cell:clearClickListener() end end) end @@ -147,12 +147,12 @@ function CommonBoxUI:onRefresh() -- 展示宝箱tips self.selectNode:setActive(false) self.btnUse:setActive(false) - self.contentNode:setSizeDeltaY(500) + self.contentNode:setSizeDeltaY(580) else -- 展示宝箱开奖励 self.selectNode:setActive(true) self.btnUse:setActive(true) - self.contentNode:setSizeDeltaY(648) + self.contentNode:setSizeDeltaY(728) end end