背包
This commit is contained in:
parent
6223aad350
commit
248e9720be
@ -275,6 +275,10 @@ local item = {
|
|||||||
["name"]="死灵法师",
|
["name"]="死灵法师",
|
||||||
["desc"]="凑齐可解锁或升级。"
|
["desc"]="凑齐可解锁或升级。"
|
||||||
},
|
},
|
||||||
|
[10001]={
|
||||||
|
["name"]="箱子",
|
||||||
|
["desc"]="箱子"
|
||||||
|
},
|
||||||
[55002]={
|
[55002]={
|
||||||
["name"]="血族快递伯爵",
|
["name"]="血族快递伯爵",
|
||||||
["desc"]="凑齐可解锁或升级。"
|
["desc"]="凑齐可解锁或升级。"
|
||||||
|
|||||||
@ -41,6 +41,8 @@ ItemConst.ITEM_TYPE = {
|
|||||||
FIXED_BOX_ITEM = 8,
|
FIXED_BOX_ITEM = 8,
|
||||||
AVATAR = 9,
|
AVATAR = 9,
|
||||||
FRAME = 10,
|
FRAME = 10,
|
||||||
|
BOX_SELECT = 12, -- 选宝箱(背包中使用)
|
||||||
|
BOX_RANDOM = 13, -- 随机宝箱(背包中使用)
|
||||||
-- EPIC_HERO_FRAMENT = 11,
|
-- EPIC_HERO_FRAMENT = 11,
|
||||||
-- SKIN = 12
|
-- SKIN = 12
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,16 +28,17 @@ function TipsManager:showHelpTips(params)
|
|||||||
UIManager:showUI("app/ui/tips/help_tips", params)
|
UIManager:showUI("app/ui/tips/help_tips", params)
|
||||||
end
|
end
|
||||||
|
|
||||||
function TipsManager:showRewardTips(rewardId, rewardType, tarPrefabObj, alignType)
|
function TipsManager:showRewardTips(rewardId, rewardType, tarPrefabObj, alignType, params, showItemTip)
|
||||||
if rewardType == GConst.REWARD_TYPE.ITEM then
|
if rewardType == GConst.REWARD_TYPE.ITEM then
|
||||||
local info = ConfigManager:getConfig("item")[rewardId]
|
local info = ConfigManager:getConfig("item")[rewardId]
|
||||||
if info then
|
if info then
|
||||||
if info.type == GConst.ItemConst.ITEM_TYPE.RANDOM_FRAGMENT
|
-- if info.type == GConst.ItemConst.ITEM_TYPE.RANDOM_FRAGMENT
|
||||||
or info.type == GConst.ItemConst.ITEM_TYPE.EPIC_HERO_FRAMENT then
|
-- or info.type == GConst.ItemConst.ITEM_TYPE.EPIC_HERO_FRAMENT then
|
||||||
-- 随机碎片 or 权重随机碎片 or 史诗英雄碎片
|
-- -- 随机碎片 or 权重随机碎片 or 史诗英雄碎片
|
||||||
self:showHeroFragmentTips(rewardId)
|
-- self:showHeroFragmentTips(rewardId)
|
||||||
return
|
-- return
|
||||||
elseif info.type == GConst.ItemConst.ITEM_TYPE.WEIGHT_FRAGMENT then
|
-- else
|
||||||
|
if info.type == GConst.ItemConst.ITEM_TYPE.WEIGHT_FRAGMENT then
|
||||||
-- 宝箱
|
-- 宝箱
|
||||||
self:showWeightBoxTips(rewardId)
|
self:showWeightBoxTips(rewardId)
|
||||||
return
|
return
|
||||||
@ -49,9 +50,14 @@ function TipsManager:showRewardTips(rewardId, rewardType, tarPrefabObj, alignTyp
|
|||||||
-- 英雄碎片
|
-- 英雄碎片
|
||||||
ModuleManager.HeroManager:showHeroDetailUI(info.parameter, true)
|
ModuleManager.HeroManager:showHeroDetailUI(info.parameter, true)
|
||||||
return
|
return
|
||||||
elseif info.type == GConst.ItemConst.ITEM_TYPE.SKIN then
|
-- elseif info.type == GConst.ItemConst.ITEM_TYPE.SKIN then
|
||||||
-- 英雄皮肤
|
-- -- 英雄皮肤
|
||||||
ModuleManager.HeroManager:showHeroSkinUI(DataManager.SkinData:getHeroIdBySkinId(info.parameter), info.parameter)
|
-- 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
|
return
|
||||||
elseif info.type == GConst.ItemConst.ITEM_TYPE.RANDOM_BOX_ITEM or info.type == GConst.ItemConst.ITEM_TYPE.FIXED_BOX_ITEM then
|
elseif info.type == GConst.ItemConst.ITEM_TYPE.RANDOM_BOX_ITEM or info.type == GConst.ItemConst.ITEM_TYPE.FIXED_BOX_ITEM then
|
||||||
self:showBoxItemTips(rewardId)
|
self:showBoxItemTips(rewardId)
|
||||||
|
|||||||
@ -52,6 +52,9 @@ function BagMainUI:onLoadRootComplete()
|
|||||||
end)
|
end)
|
||||||
self.scrollRectComp:addRefreshCallback(function(index, cell)
|
self.scrollRectComp:addRefreshCallback(function(index, cell)
|
||||||
cell:refreshByEntity(self.list[index])
|
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)
|
end)
|
||||||
self.scrollRectComp:clearCells()
|
self.scrollRectComp:clearCells()
|
||||||
end
|
end
|
||||||
|
|||||||
@ -27,6 +27,9 @@ function RewardCell:init()
|
|||||||
self.select = uiMap["reward_cell.content.item_bg.select"]
|
self.select = uiMap["reward_cell.content.item_bg.select"]
|
||||||
-- 自选
|
-- 自选
|
||||||
self.choose = uiMap["reward_cell.choose"]
|
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:hideFrameAnimation()
|
||||||
self.baseObject:addClickListener(function()
|
self.baseObject:addClickListener(function()
|
||||||
@ -36,6 +39,8 @@ function RewardCell:init()
|
|||||||
ModuleManager.TipsManager:showRewardTips(self.rewardId, self.rewardType, self.baseObject)
|
ModuleManager.TipsManager:showRewardTips(self.rewardId, self.rewardType, self.baseObject)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
self:setShowProbTag(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
function RewardCell:refresh(reward)
|
function RewardCell:refresh(reward)
|
||||||
@ -60,6 +65,11 @@ function RewardCell:refreshByChoose()
|
|||||||
self.content:setVisible(false)
|
self.content:setVisible(false)
|
||||||
end
|
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)
|
function RewardCell:refreshByConfig(reward, mask, check)
|
||||||
self:showMask(mask, check)
|
self:showMask(mask, check)
|
||||||
if reward.type == GConst.REWARD_TYPE.ITEM then
|
if reward.type == GConst.REWARD_TYPE.ITEM then
|
||||||
@ -264,4 +274,12 @@ function RewardCell:showSelect(show)
|
|||||||
self.select:setActive(show == true)
|
self.select:setActive(show == true)
|
||||||
end
|
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
|
return RewardCell
|
||||||
@ -122,14 +122,14 @@ function CommonBoxUI:onRefresh()
|
|||||||
end)
|
end)
|
||||||
self.scrollRect:addRefreshCallback(function(index, cell)
|
self.scrollRect:addRefreshCallback(function(index, cell)
|
||||||
cell:refreshByConfig(self.rewards[index])
|
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))
|
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
|
if index ~= self.curIndex and self.itemType == GConst.ItemConst.ITEM_TYPE.BOX_SELECT then
|
||||||
cell:addClickListener(function()
|
cell:addClickListener(function()
|
||||||
self:onClickReward(index)
|
self:onClickReward(index)
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
-- cell:setClickShowTips()
|
cell:clearClickListener()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@ -147,12 +147,12 @@ function CommonBoxUI:onRefresh()
|
|||||||
-- 展示宝箱tips
|
-- 展示宝箱tips
|
||||||
self.selectNode:setActive(false)
|
self.selectNode:setActive(false)
|
||||||
self.btnUse:setActive(false)
|
self.btnUse:setActive(false)
|
||||||
self.contentNode:setSizeDeltaY(500)
|
self.contentNode:setSizeDeltaY(580)
|
||||||
else
|
else
|
||||||
-- 展示宝箱开奖励
|
-- 展示宝箱开奖励
|
||||||
self.selectNode:setActive(true)
|
self.selectNode:setActive(true)
|
||||||
self.btnUse:setActive(true)
|
self.btnUse:setActive(true)
|
||||||
self.contentNode:setSizeDeltaY(648)
|
self.contentNode:setSizeDeltaY(728)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user