Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev
This commit is contained in:
commit
c996e1414e
@ -31,6 +31,8 @@ EventManager.CUSTOM_EVENT = {
|
|||||||
UPDATE_MAIN_MALL_HEIGHT = "UPDATE_MAIN_MALL_HEIGHT", -- 更新主要商品的高度
|
UPDATE_MAIN_MALL_HEIGHT = "UPDATE_MAIN_MALL_HEIGHT", -- 更新主要商品的高度
|
||||||
GO_DAILY_CHALLENGE = "GO_DAILY_CHALLENGE", -- 跳转每日挑战
|
GO_DAILY_CHALLENGE = "GO_DAILY_CHALLENGE", -- 跳转每日挑战
|
||||||
GO_CHAPTER = "GO_CHAPTER", -- 跳转主线章节
|
GO_CHAPTER = "GO_CHAPTER", -- 跳转主线章节
|
||||||
|
CLOSE_BOX_HERO_UI = "CLOSE_BOX_HERO_UI",
|
||||||
|
CLOSE_BOX_OPEN_UI = "CLOSE_BOX_OPEN_UI",
|
||||||
-- BORAD_TOUCH_BEGIN = "BORAD_TOUCH_BEGIN",
|
-- BORAD_TOUCH_BEGIN = "BORAD_TOUCH_BEGIN",
|
||||||
-- BORAD_TOUCH_OVER = "BORAD_TOUCH_OVER"
|
-- BORAD_TOUCH_OVER = "BORAD_TOUCH_OVER"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1408,14 +1408,15 @@ function BattleUnitComp:onSkillTakeEffect(skill, isFinalBlock, validEffectIdx)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleUnitComp:judgeSkillEffectCondition(skill, index)
|
function BattleUnitComp:judgeSkillEffectCondition(skill, index)
|
||||||
if not skill or skill:haveBuffCondition() then
|
if not skill or not skill:haveBuffCondition() then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local buffConditionIndex, conditionRel = skill:getBuffConditionRel(index)
|
local rel = skill:getBuffConditionRel(index)
|
||||||
if not buffConditionIndex then
|
if not rel then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
local buffConditionIndex, conditionRel = rel[1], rel[2]
|
||||||
local buffConditions = skill:getBuffCondition(buffConditionIndex)
|
local buffConditions = skill:getBuffCondition(buffConditionIndex)
|
||||||
|
|
||||||
return BATTLE_SKILL_CONDITION_HANDLE.judgeSkillEffectCondition(buffConditions, conditionRel, self.battleController)
|
return BATTLE_SKILL_CONDITION_HANDLE.judgeSkillEffectCondition(buffConditions, conditionRel, self.battleController)
|
||||||
@ -1791,20 +1792,11 @@ function BattleUnitComp:getEffectAndPlay(fxInfo, isLoop)
|
|||||||
effectObj:setLocalPosition(0, 0, 0)
|
effectObj:setLocalPosition(0, 0, 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if fxInfo.follow_direction then
|
if fxInfo.flip then
|
||||||
if self.side == BattleConst.SIDE_ATK then
|
|
||||||
if effectObj:getIsEulerAnglesFlip() then
|
|
||||||
effectObj:setLocalEulerAngles(0, 0, 0)
|
|
||||||
end
|
|
||||||
effectObj:setLocalScale(fxScale, fxScale, fxScale)
|
|
||||||
else
|
|
||||||
if effectObj:getIsEulerAnglesFlip() then
|
if effectObj:getIsEulerAnglesFlip() then
|
||||||
effectObj:setLocalEulerAngles(0, 180, 0)
|
effectObj:setLocalEulerAngles(0, 180, 0)
|
||||||
|
end
|
||||||
effectObj:setLocalScale(fxScale, fxScale, fxScale)
|
effectObj:setLocalScale(fxScale, fxScale, fxScale)
|
||||||
else
|
|
||||||
effectObj:setLocalScale(-fxScale, fxScale, fxScale)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
if effectObj:getIsEulerAnglesFlip() then
|
if effectObj:getIsEulerAnglesFlip() then
|
||||||
effectObj:setLocalEulerAngles(0, 0, 0)
|
effectObj:setLocalEulerAngles(0, 0, 0)
|
||||||
|
|||||||
@ -1018,7 +1018,9 @@ function BattleController:calculateCurElimination(onlyCheck)
|
|||||||
local elementType = entity:getElementType()
|
local elementType = entity:getElementType()
|
||||||
if not info.noAni and info.isIdle then
|
if not info.noAni and info.isIdle then
|
||||||
if not info.isSkill then
|
if not info.isSkill then
|
||||||
|
if not entity:isElmentTypeInvalid() then
|
||||||
elementTypeMap[elementType] = (elementTypeMap[elementType] or 0) + 1
|
elementTypeMap[elementType] = (elementTypeMap[elementType] or 0) + 1
|
||||||
|
end
|
||||||
if boomGridIds[info.posId] and boomGridIds[info.posId][GRID_BREAK_CONDITION.LINE] then
|
if boomGridIds[info.posId] and boomGridIds[info.posId][GRID_BREAK_CONDITION.LINE] then
|
||||||
lineCount = lineCount + 1
|
lineCount = lineCount + 1
|
||||||
linkElementType = elementType
|
linkElementType = elementType
|
||||||
|
|||||||
@ -20,8 +20,30 @@ end
|
|||||||
function BountyManager:onClaimReward(result)
|
function BountyManager:onClaimReward(result)
|
||||||
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
||||||
if result.rewards then
|
if result.rewards then
|
||||||
|
-- 读表获取该层奖励 如果是箱子走单独奖励展示接口
|
||||||
|
local isSpecialBox = false
|
||||||
|
local index = result.reqData.level
|
||||||
|
local isPro = result.reqData.is_pro
|
||||||
|
local info = DataManager.BountyData:getSeasonInfoByLevel(index)
|
||||||
|
local rewardType
|
||||||
|
local rewardId
|
||||||
|
if info then
|
||||||
|
local reward = isPro and info.reward_pro or info.reward
|
||||||
|
rewardType = reward and reward.type
|
||||||
|
rewardId = reward and reward.id
|
||||||
|
if rewardType == GConst.REWARD_TYPE.ITEM then
|
||||||
|
local itemCfgInfo = ConfigManager:getConfig("item")[rewardId]
|
||||||
|
if itemCfgInfo and itemCfgInfo.type == GConst.ItemConst.ITEM_TYPE.BOX then
|
||||||
|
isSpecialBox = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if isSpecialBox then
|
||||||
|
ModuleManager.ShopManager:showBoxOpenUI({type = GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY, params = rewardId, rewards = result.rewards})
|
||||||
|
else
|
||||||
GFunc.showRewardBox(result.rewards)
|
GFunc.showRewardBox(result.rewards)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
if result.reqData.is_pro ~= nil then
|
if result.reqData.is_pro ~= nil then
|
||||||
if result.reqData.is_pro then
|
if result.reqData.is_pro then
|
||||||
DataManager.BountyData:onClaimProReward(result.reqData.level)
|
DataManager.BountyData:onClaimProReward(result.reqData.level)
|
||||||
|
|||||||
@ -4,6 +4,10 @@ ItemConst.ITEM_ID_GOLD = 1
|
|||||||
ItemConst.ITEM_ID_GEM = 2
|
ItemConst.ITEM_ID_GEM = 2
|
||||||
ItemConst.ITEM_ID_VIT = 3
|
ItemConst.ITEM_ID_VIT = 3
|
||||||
ItemConst.ITEM_ID_BOUNTY_EXP = 7
|
ItemConst.ITEM_ID_BOUNTY_EXP = 7
|
||||||
|
ItemConst.ITEM_ID_BOX_LV_1 = 8
|
||||||
|
ItemConst.ITEM_ID_BOX_LV_2 = 9
|
||||||
|
ItemConst.ITEM_ID_BOX_LV_3 = 10
|
||||||
|
ItemConst.ITEM_ID_BOX_LV_4 = 11
|
||||||
ItemConst.ITEM_ID_EXP = 12
|
ItemConst.ITEM_ID_EXP = 12
|
||||||
ItemConst.ITEM_ID_BOX_KEY_LV_1 = 13
|
ItemConst.ITEM_ID_BOX_KEY_LV_1 = 13
|
||||||
ItemConst.ITEM_ID_BOX_KEY_LV_2 = 14
|
ItemConst.ITEM_ID_BOX_KEY_LV_2 = 14
|
||||||
|
|||||||
@ -10,6 +10,11 @@ ShopConst.MAIN_UI_POP_TYPE = { -- 当触发弹窗时,相关联的类型礼包也
|
|||||||
[PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = true
|
[PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ShopConst.BOX_REWARD_TYPE = {
|
||||||
|
SUMMON = 1,
|
||||||
|
BOUNTY = 2,
|
||||||
|
}
|
||||||
|
|
||||||
ShopConst.GEM_ICON_NAME = {
|
ShopConst.GEM_ICON_NAME = {
|
||||||
[1] = "shop_diamond_1",
|
[1] = "shop_diamond_1",
|
||||||
[2] = "shop_diamond_1",
|
[2] = "shop_diamond_1",
|
||||||
|
|||||||
@ -8,11 +8,12 @@ function ShopManager:showBoxLevelUI()
|
|||||||
UIManager:showUI("app/ui/shop/box_level_ui")
|
UIManager:showUI("app/ui/shop/box_level_ui")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 宝箱奖励开箱界面 type,params,rewards
|
||||||
function ShopManager:showBoxOpenUI(params)
|
function ShopManager:showBoxOpenUI(params)
|
||||||
UIManager:showUI("app/ui/shop/box_open_ui", params)
|
UIManager:showUI("app/ui/shop/box_open_ui", params)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 商店宝箱奖励展示界面
|
-- 宝箱奖励展示界面
|
||||||
function ShopManager:showBoxRewardUI(params)
|
function ShopManager:showBoxRewardUI(params)
|
||||||
UIManager:showUI("app/ui/shop/box_reward_ui", params)
|
UIManager:showUI("app/ui/shop/box_reward_ui", params)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -28,12 +28,10 @@ end
|
|||||||
|
|
||||||
function SummonManager:summonFinish(result)
|
function SummonManager:summonFinish(result)
|
||||||
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
||||||
DataManager.SummonData:cacheSummonRewards(result.rewards) -- 缓存一下 防止有其他地方需要使用
|
|
||||||
DataManager.SummonData:init(result.summon_info)
|
DataManager.SummonData:init(result.summon_info)
|
||||||
|
|
||||||
if result.reqData then
|
if result.reqData then
|
||||||
local summonType = result.reqData.type
|
local summonType = result.reqData.type
|
||||||
ModuleManager.ShopManager:showBoxOpenUI({type = summonType})
|
ModuleManager.ShopManager:showBoxOpenUI({type = GConst.ShopConst.BOX_REWARD_TYPE.SUMMON, params = summonType, rewards = result.rewards})
|
||||||
-- 任务
|
-- 任务
|
||||||
if summonType == GConst.SummonConst.SUMMON_TYPE.LV_1 then
|
if summonType == GConst.SummonConst.SUMMON_TYPE.LV_1 then
|
||||||
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_OPEN_SHOP_BOX_LEVEL_1, 1)
|
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_OPEN_SHOP_BOX_LEVEL_1, 1)
|
||||||
|
|||||||
@ -18,6 +18,13 @@ function BattleDailyChallengeBuffUI:ctor()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleDailyChallengeBuffUI:onClose()
|
||||||
|
if self.txSeq then
|
||||||
|
self.txSeq:Kill()
|
||||||
|
self.txSeq = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function BattleDailyChallengeBuffUI:onLoadRootComplete()
|
function BattleDailyChallengeBuffUI:onLoadRootComplete()
|
||||||
self:_display()
|
self:_display()
|
||||||
self:_addListeners()
|
self:_addListeners()
|
||||||
@ -32,6 +39,17 @@ function BattleDailyChallengeBuffUI:_display()
|
|||||||
for index, obj in ipairs(buffDescs) do
|
for index, obj in ipairs(buffDescs) do
|
||||||
obj:setText(self.buffDescs[index])
|
obj:setText(self.buffDescs[index])
|
||||||
end
|
end
|
||||||
|
local txNode = uiMap["battle_daily_challenge_buff_ui.raw_img"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
|
||||||
|
txNode.alpha = 0
|
||||||
|
uiMap["battle_daily_challenge_buff_ui.ui_spine_obj"]:playAnim("idle", false, true)
|
||||||
|
|
||||||
|
if self.txSeq then
|
||||||
|
self.txSeq:Kill()
|
||||||
|
self.txSeq = nil
|
||||||
|
end
|
||||||
|
self.txSeq = self.root:createBindTweenSequence()
|
||||||
|
self.txSeq:AppendInterval(0.2)
|
||||||
|
self.txSeq:Append(txNode:DOFade(1, 0.2))
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleDailyChallengeBuffUI:_addListeners()
|
function BattleDailyChallengeBuffUI:_addListeners()
|
||||||
|
|||||||
@ -56,6 +56,11 @@ function BoxHeroUI:onLoadRootComplete()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
self:refresh()
|
self:refresh()
|
||||||
|
|
||||||
|
-- 奖励界面打开时 关闭此界面
|
||||||
|
self:addEventListener(EventManager.CUSTOM_EVENT.CLOSE_BOX_HERO_UI, function()
|
||||||
|
self:closeUI()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BoxHeroUI:refresh()
|
function BoxHeroUI:refresh()
|
||||||
@ -70,7 +75,7 @@ function BoxHeroUI:refresh()
|
|||||||
self.itemCellList[i]:setNum("")
|
self.itemCellList[i]:setNum("")
|
||||||
self.itemTextList[i]:setText(rewards[i].num)
|
self.itemTextList[i]:setText(rewards[i].num)
|
||||||
self.itemCellList[i]:addClickListener(function()
|
self.itemCellList[i]:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(rewards[i].id, self.itemCellList[i]:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(rewards[i].id, GConst.REWARD_TYPE.ITEM, self.itemCellList[i]:getBaseObject())
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if ConfigManager:getConfig("item")[rewards[i].id].type == 3 then
|
if ConfigManager:getConfig("item")[rewards[i].id].type == 3 then
|
||||||
@ -102,10 +107,8 @@ function BoxHeroUI:onClickSummon()
|
|||||||
local costItem, cost = DataManager.SummonData:getSummonCost(self.summonType)
|
local costItem, cost = DataManager.SummonData:getSummonCost(self.summonType)
|
||||||
if GFunc.checkCost(costItem.id, costItem.num, false) then
|
if GFunc.checkCost(costItem.id, costItem.num, false) then
|
||||||
ModuleManager.SummonManager:summon(self.summonType, 1)
|
ModuleManager.SummonManager:summon(self.summonType, 1)
|
||||||
self:closeUI()
|
|
||||||
elseif GFunc.checkCost(cost.id, cost.num, true) then
|
elseif GFunc.checkCost(cost.id, cost.num, true) then
|
||||||
ModuleManager.SummonManager:summon(self.summonType, 2)
|
ModuleManager.SummonManager:summon(self.summonType, 2)
|
||||||
self:closeUI()
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -137,7 +137,7 @@ function BoxLevelUI:refresh()
|
|||||||
self.box1Add1ItemCell:refreshByCfg(reward1[1].id, 0)
|
self.box1Add1ItemCell:refreshByCfg(reward1[1].id, 0)
|
||||||
self.box1Add1ItemCell:setNum("")
|
self.box1Add1ItemCell:setNum("")
|
||||||
self.box1Add1ItemCell:addClickListener(function()
|
self.box1Add1ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward1[1].id, self.box1Add1ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward1[1].id, GConst.REWARD_TYPE.ITEM, self.box1Add1ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box1Add1Text:setText("+" .. tostring(reward1[1].num))
|
self.box1Add1Text:setText("+" .. tostring(reward1[1].num))
|
||||||
else
|
else
|
||||||
@ -145,7 +145,7 @@ function BoxLevelUI:refresh()
|
|||||||
self.box1Add1ItemCell:refreshByCfg(reward1[1].id, 0)
|
self.box1Add1ItemCell:refreshByCfg(reward1[1].id, 0)
|
||||||
self.box1Add1ItemCell:setNum("")
|
self.box1Add1ItemCell:setNum("")
|
||||||
self.box1Add1ItemCell:addClickListener(function()
|
self.box1Add1ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward1[1].id, self.box1Add1ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward1[1].id, GConst.REWARD_TYPE.ITEM, self.box1Add1ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box1Add1Text:setText("+" .. tostring(reward1[1].num))
|
self.box1Add1Text:setText("+" .. tostring(reward1[1].num))
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ function BoxLevelUI:refresh()
|
|||||||
self.box1Add2ItemCell:refreshByCfg(reward1[2].id, 0)
|
self.box1Add2ItemCell:refreshByCfg(reward1[2].id, 0)
|
||||||
self.box1Add2ItemCell:setNum("")
|
self.box1Add2ItemCell:setNum("")
|
||||||
self.box1Add2ItemCell:addClickListener(function()
|
self.box1Add2ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward1[2].id, self.box1Add2ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward1[2].id, GConst.REWARD_TYPE.ITEM, self.box1Add2ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box1Add2Text:setText("+" .. tostring(reward1[2].num))
|
self.box1Add2Text:setText("+" .. tostring(reward1[2].num))
|
||||||
end
|
end
|
||||||
@ -164,7 +164,7 @@ function BoxLevelUI:refresh()
|
|||||||
self.box2Add1ItemCell:refreshByCfg(reward2[1].id, 0)
|
self.box2Add1ItemCell:refreshByCfg(reward2[1].id, 0)
|
||||||
self.box2Add1ItemCell:setNum("")
|
self.box2Add1ItemCell:setNum("")
|
||||||
self.box2Add1ItemCell:addClickListener(function()
|
self.box2Add1ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward2[1].id, self.box2Add1ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward2[1].id, GConst.REWARD_TYPE.ITEM, self.box2Add1ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box2Add1Text:setText("+" .. tostring(reward2[1].num))
|
self.box2Add1Text:setText("+" .. tostring(reward2[1].num))
|
||||||
else
|
else
|
||||||
@ -172,7 +172,7 @@ function BoxLevelUI:refresh()
|
|||||||
self.box2Add1ItemCell:refreshByCfg(reward2[1].id, 0)
|
self.box2Add1ItemCell:refreshByCfg(reward2[1].id, 0)
|
||||||
self.box2Add1ItemCell:setNum("")
|
self.box2Add1ItemCell:setNum("")
|
||||||
self.box2Add1ItemCell:addClickListener(function()
|
self.box2Add1ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward2[1].id, self.box2Add1ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward2[1].id, GConst.REWARD_TYPE.ITEM, self.box2Add1ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box2Add1Text:setText("+" .. tostring(reward2[1].num))
|
self.box2Add1Text:setText("+" .. tostring(reward2[1].num))
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ function BoxLevelUI:refresh()
|
|||||||
self.box2Add2ItemCell:refreshByCfg(reward2[2].id, 0)
|
self.box2Add2ItemCell:refreshByCfg(reward2[2].id, 0)
|
||||||
self.box2Add2ItemCell:setNum("")
|
self.box2Add2ItemCell:setNum("")
|
||||||
self.box2Add2ItemCell:addClickListener(function()
|
self.box2Add2ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward2[2].id, self.box2Add2ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward2[2].id, GConst.REWARD_TYPE.ITEM, self.box2Add2ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box2Add2Text:setText("+" .. tostring(reward2[2].num))
|
self.box2Add2Text:setText("+" .. tostring(reward2[2].num))
|
||||||
end
|
end
|
||||||
@ -191,7 +191,7 @@ function BoxLevelUI:refresh()
|
|||||||
self.box3Add1ItemCell:refreshByCfg(reward3[1].id, 0)
|
self.box3Add1ItemCell:refreshByCfg(reward3[1].id, 0)
|
||||||
self.box3Add1ItemCell:setNum("")
|
self.box3Add1ItemCell:setNum("")
|
||||||
self.box3Add1ItemCell:addClickListener(function()
|
self.box3Add1ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward3[1].id, self.box3Add1ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward3[1].id, GConst.REWARD_TYPE.ITEM, self.box3Add1ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box3Add1Text:setText("+" .. tostring(reward3[1].num))
|
self.box3Add1Text:setText("+" .. tostring(reward3[1].num))
|
||||||
else
|
else
|
||||||
@ -199,7 +199,7 @@ function BoxLevelUI:refresh()
|
|||||||
self.box3Add1ItemCell:refreshByCfg(reward3[1].id, 0)
|
self.box3Add1ItemCell:refreshByCfg(reward3[1].id, 0)
|
||||||
self.box3Add1ItemCell:setNum("")
|
self.box3Add1ItemCell:setNum("")
|
||||||
self.box3Add1ItemCell:addClickListener(function()
|
self.box3Add1ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward3[1].id, self.box3Add1ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward3[1].id, GConst.REWARD_TYPE.ITEM, self.box3Add1ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box3Add1Text:setText("+" .. tostring(reward3[1].num))
|
self.box3Add1Text:setText("+" .. tostring(reward3[1].num))
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ function BoxLevelUI:refresh()
|
|||||||
self.box3Add2ItemCell:refreshByCfg(reward3[2].id, 0)
|
self.box3Add2ItemCell:refreshByCfg(reward3[2].id, 0)
|
||||||
self.box3Add2ItemCell:setNum("")
|
self.box3Add2ItemCell:setNum("")
|
||||||
self.box3Add2ItemCell:addClickListener(function()
|
self.box3Add2ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward3[2].id, self.box3Add2ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward3[2].id, GConst.REWARD_TYPE.ITEM, self.box3Add2ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box3Add2Text:setText("+" .. tostring(reward3[2].num))
|
self.box3Add2Text:setText("+" .. tostring(reward3[2].num))
|
||||||
end
|
end
|
||||||
|
|||||||
@ -84,7 +84,7 @@ function BoxLevelUpUI:refresh()
|
|||||||
self.box1Add1ItemCell:refreshByCfg(reward1[1].id, 0)
|
self.box1Add1ItemCell:refreshByCfg(reward1[1].id, 0)
|
||||||
self.box1Add1ItemCell:setNum("")
|
self.box1Add1ItemCell:setNum("")
|
||||||
self.box1Add1ItemCell:addClickListener(function()
|
self.box1Add1ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward1[1].id, self.box1Add1ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward1[1].id, GConst.REWARD_TYPE.ITEM, self.box1Add1ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box1Add1Text:setText("+" .. tostring(reward1[1].num))
|
self.box1Add1Text:setText("+" .. tostring(reward1[1].num))
|
||||||
else
|
else
|
||||||
@ -92,7 +92,7 @@ function BoxLevelUpUI:refresh()
|
|||||||
self.box1Add1ItemCell:refreshByCfg(reward1[1].id, 0)
|
self.box1Add1ItemCell:refreshByCfg(reward1[1].id, 0)
|
||||||
self.box1Add1ItemCell:setNum("")
|
self.box1Add1ItemCell:setNum("")
|
||||||
self.box1Add1ItemCell:addClickListener(function()
|
self.box1Add1ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward1[1].id, self.box1Add1ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward1[1].id, GConst.REWARD_TYPE.ITEM, self.box1Add1ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box1Add1Text:setText("+" .. tostring(reward1[1].num))
|
self.box1Add1Text:setText("+" .. tostring(reward1[1].num))
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ function BoxLevelUpUI:refresh()
|
|||||||
self.box1Add2ItemCell:refreshByCfg(reward1[2].id, 0)
|
self.box1Add2ItemCell:refreshByCfg(reward1[2].id, 0)
|
||||||
self.box1Add2ItemCell:setNum("")
|
self.box1Add2ItemCell:setNum("")
|
||||||
self.box1Add2ItemCell:addClickListener(function()
|
self.box1Add2ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward1[2].id, self.box1Add2ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward1[2].id, GConst.REWARD_TYPE.ITEM, self.box1Add2ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box1Add2Text:setText("+" .. tostring(reward1[2].num))
|
self.box1Add2Text:setText("+" .. tostring(reward1[2].num))
|
||||||
end
|
end
|
||||||
@ -111,7 +111,7 @@ function BoxLevelUpUI:refresh()
|
|||||||
self.box2Add1ItemCell:refreshByCfg(reward2[1].id, 0)
|
self.box2Add1ItemCell:refreshByCfg(reward2[1].id, 0)
|
||||||
self.box2Add1ItemCell:setNum("")
|
self.box2Add1ItemCell:setNum("")
|
||||||
self.box2Add1ItemCell:addClickListener(function()
|
self.box2Add1ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward2[1].id, self.box2Add1ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward2[1].id, GConst.REWARD_TYPE.ITEM, self.box2Add1ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box2Add1Text:setText("+" .. tostring(reward2[1].num))
|
self.box2Add1Text:setText("+" .. tostring(reward2[1].num))
|
||||||
else
|
else
|
||||||
@ -119,7 +119,7 @@ function BoxLevelUpUI:refresh()
|
|||||||
self.box2Add1ItemCell:refreshByCfg(reward2[1].id, 0)
|
self.box2Add1ItemCell:refreshByCfg(reward2[1].id, 0)
|
||||||
self.box2Add1ItemCell:setNum("")
|
self.box2Add1ItemCell:setNum("")
|
||||||
self.box2Add1ItemCell:addClickListener(function()
|
self.box2Add1ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward2[1].id, self.box2Add1ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward2[1].id, GConst.REWARD_TYPE.ITEM, self.box2Add1ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box2Add1Text:setText("+" .. tostring(reward2[1].num))
|
self.box2Add1Text:setText("+" .. tostring(reward2[1].num))
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ function BoxLevelUpUI:refresh()
|
|||||||
self.box2Add2ItemCell:refreshByCfg(reward2[2].id, 0)
|
self.box2Add2ItemCell:refreshByCfg(reward2[2].id, 0)
|
||||||
self.box2Add2ItemCell:setNum("")
|
self.box2Add2ItemCell:setNum("")
|
||||||
self.box2Add2ItemCell:addClickListener(function()
|
self.box2Add2ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward2[2].id, self.box2Add2ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward2[2].id, GConst.REWARD_TYPE.ITEM, self.box2Add2ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box2Add2Text:setText("+" .. tostring(reward2[2].num))
|
self.box2Add2Text:setText("+" .. tostring(reward2[2].num))
|
||||||
end
|
end
|
||||||
@ -138,7 +138,7 @@ function BoxLevelUpUI:refresh()
|
|||||||
self.box3Add1ItemCell:refreshByCfg(reward3[1].id, 0)
|
self.box3Add1ItemCell:refreshByCfg(reward3[1].id, 0)
|
||||||
self.box3Add1ItemCell:setNum("")
|
self.box3Add1ItemCell:setNum("")
|
||||||
self.box3Add1ItemCell:addClickListener(function()
|
self.box3Add1ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward3[1].id, self.box3Add1ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward3[1].id, GConst.REWARD_TYPE.ITEM, self.box3Add1ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box3Add1Text:setText("+" .. tostring(reward3[1].num))
|
self.box3Add1Text:setText("+" .. tostring(reward3[1].num))
|
||||||
else
|
else
|
||||||
@ -146,7 +146,7 @@ function BoxLevelUpUI:refresh()
|
|||||||
self.box3Add1ItemCell:refreshByCfg(reward3[1].id, 0)
|
self.box3Add1ItemCell:refreshByCfg(reward3[1].id, 0)
|
||||||
self.box3Add1ItemCell:setNum("")
|
self.box3Add1ItemCell:setNum("")
|
||||||
self.box3Add1ItemCell:addClickListener(function()
|
self.box3Add1ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward3[1].id, self.box3Add1ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward3[1].id, GConst.REWARD_TYPE.ITEM, self.box3Add1ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box3Add1Text:setText("+" .. tostring(reward3[1].num))
|
self.box3Add1Text:setText("+" .. tostring(reward3[1].num))
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ function BoxLevelUpUI:refresh()
|
|||||||
self.box3Add2ItemCell:refreshByCfg(reward3[2].id, 0)
|
self.box3Add2ItemCell:refreshByCfg(reward3[2].id, 0)
|
||||||
self.box3Add2ItemCell:setNum("")
|
self.box3Add2ItemCell:setNum("")
|
||||||
self.box3Add2ItemCell:addClickListener(function()
|
self.box3Add2ItemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(reward3[2].id, self.box3Add2ItemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(reward3[2].id, GConst.REWARD_TYPE.ITEM, self.box3Add2ItemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.box3Add2Text:setText("+" .. tostring(reward3[2].num))
|
self.box3Add2Text:setText("+" .. tostring(reward3[2].num))
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,14 +1,26 @@
|
|||||||
local BoxOpenUI = class("BoxOpenUI", BaseUI)
|
local BoxOpenUI = class("BoxOpenUI", BaseUI)
|
||||||
|
|
||||||
local ICON_NAME = {
|
local SUMMON_ICON_NAME = {
|
||||||
[GConst.SummonConst.SUMMON_TYPE.LV_1] = "shop_chest_1",
|
[GConst.SummonConst.SUMMON_TYPE.LV_1] = "shop_chest_1",
|
||||||
[GConst.SummonConst.SUMMON_TYPE.LV_2] = "shop_chest_2",
|
[GConst.SummonConst.SUMMON_TYPE.LV_2] = "shop_chest_2",
|
||||||
[GConst.SummonConst.SUMMON_TYPE.LV_3] = "shop_chest_3"
|
[GConst.SummonConst.SUMMON_TYPE.LV_3] = "shop_chest_3"
|
||||||
}
|
}
|
||||||
|
local BOUNTY_ICON_NAME = {
|
||||||
|
[GConst.ItemConst.ITEM_ID_BOX_LV_1] = "shop_chest_2",
|
||||||
|
[GConst.ItemConst.ITEM_ID_BOX_LV_2] = "shop_chest_2",
|
||||||
|
[GConst.ItemConst.ITEM_ID_BOX_LV_3] = "shop_chest_3",
|
||||||
|
[GConst.ItemConst.ITEM_ID_BOX_LV_4] = "shop_chest_3",
|
||||||
|
}
|
||||||
|
|
||||||
function BoxOpenUI:ctor(params)
|
function BoxOpenUI:ctor(params)
|
||||||
self.params = params or {} -- 将信息传递给下一个界面
|
self.params = params or {} -- 将信息传递给下一个界面
|
||||||
self.summonType = self.params.type or GConst.SummonConst.SUMMON_TYPE.LV_1
|
self.type = self.params and self.params.type
|
||||||
|
self.iconName = "shop_chest_1" -- 默认图标
|
||||||
|
if self.type == GConst.ShopConst.BOX_REWARD_TYPE.SUMMON then
|
||||||
|
self.iconName = SUMMON_ICON_NAME[self.params.params or GConst.SummonConst.SUMMON_TYPE.LV_1]
|
||||||
|
elseif self.type == GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY then
|
||||||
|
self.iconName = BOUNTY_ICON_NAME[self.params.params or GConst.ItemConst.ITEM_ID_BOX_KEY_LV_1]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BoxOpenUI:isFullScreen()
|
function BoxOpenUI:isFullScreen()
|
||||||
@ -27,13 +39,19 @@ function BoxOpenUI:onLoadRootComplete()
|
|||||||
self.openBtn = self.uiMap["box_open_ui.open_btn"]
|
self.openBtn = self.uiMap["box_open_ui.open_btn"]
|
||||||
self.btnText = self.uiMap["box_open_ui.open_btn.text"]
|
self.btnText = self.uiMap["box_open_ui.open_btn.text"]
|
||||||
|
|
||||||
self.boxImg:setSprite(GConst.ATLAS_PATH.SHOP, ICON_NAME[self.summonType])
|
self.boxImg:setSprite(GConst.ATLAS_PATH.SHOP, self.iconName)
|
||||||
self.btnText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_7)) -- 立即打开
|
self.btnText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_7)) -- 立即打开
|
||||||
|
|
||||||
self.openBtn:addClickListener(function()
|
self.openBtn:addClickListener(function()
|
||||||
ModuleManager.ShopManager:showBoxRewardUI(self.params)
|
ModuleManager.ShopManager:showBoxRewardUI(self.params)
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- 奖励界面打开时 关闭此界面
|
||||||
|
self:addEventListener(EventManager.CUSTOM_EVENT.CLOSE_BOX_OPEN_UI, function()
|
||||||
self:closeUI()
|
self:closeUI()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.CLOSE_BOX_HERO_UI)
|
||||||
end
|
end
|
||||||
|
|
||||||
return BoxOpenUI
|
return BoxOpenUI
|
||||||
@ -3,7 +3,7 @@ local BOX_HERO_CELL = "app/ui/shop/cell/box_hero_cell"
|
|||||||
|
|
||||||
function BoxRewardUI:ctor(params)
|
function BoxRewardUI:ctor(params)
|
||||||
self.params = params or {}
|
self.params = params or {}
|
||||||
self.rewards = params.rewards or DataManager.SummonData:getLastSummonRewards() -- 目前从缓存里拿
|
self.rewards = params.rewards or {}
|
||||||
|
|
||||||
self.fragmentRewards = {}
|
self.fragmentRewards = {}
|
||||||
self.coinNum = 0
|
self.coinNum = 0
|
||||||
@ -71,6 +71,9 @@ function BoxRewardUI:onLoadRootComplete()
|
|||||||
ModuleManager.ShopManager:showBoxLevelUpUI()
|
ModuleManager.ShopManager:showBoxLevelUpUI()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- 关闭上一个界面
|
||||||
|
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.CLOSE_BOX_OPEN_UI)
|
||||||
end
|
end
|
||||||
|
|
||||||
return BoxRewardUI
|
return BoxRewardUI
|
||||||
@ -11,7 +11,12 @@ function BoxHeroCell:refresh(data)
|
|||||||
local id = data.id
|
local id = data.id
|
||||||
local num = data.count
|
local num = data.count
|
||||||
|
|
||||||
|
local heroEntity = DataManager.HeroData:getHeroById(id)
|
||||||
|
if heroEntity then
|
||||||
|
self.heroCell:refresh(heroEntity)
|
||||||
|
else
|
||||||
self.heroCell:refreshWithCfgId(id)
|
self.heroCell:refreshWithCfgId(id)
|
||||||
|
end
|
||||||
self.heroNumText:setText("X" .. tostring(num))
|
self.heroNumText:setText("X" .. tostring(num))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@ function PopRewardCell:refresh(id, num, showBg)
|
|||||||
|
|
||||||
self.popHeroCell:refreshWithCfgId(id, num)
|
self.popHeroCell:refreshWithCfgId(id, num)
|
||||||
self.popHeroCell:addClickListener(function()
|
self.popHeroCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(id, self.popHeroCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(id, GConst.REWARD_TYPE.ITEM, self.popHeroCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.descTx:setText(ModuleManager.HeroManager:getHeroName(id))
|
self.descTx:setText(ModuleManager.HeroManager:getHeroName(id))
|
||||||
else -- 通用道具
|
else -- 通用道具
|
||||||
@ -32,7 +32,7 @@ function PopRewardCell:refresh(id, num, showBg)
|
|||||||
self.itemCell:refreshByCfg(id, 0)
|
self.itemCell:refreshByCfg(id, 0)
|
||||||
self.itemCell:setNum("")
|
self.itemCell:setNum("")
|
||||||
self.itemCell:addClickListener(function()
|
self.itemCell:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showItemTips(id, self.itemCell:getBaseObject())
|
ModuleManager.TipsManager:showRewardTips(id, GConst.REWARD_TYPE.ITEM, self.itemCell:getBaseObject())
|
||||||
end)
|
end)
|
||||||
self.descTx:setText(num)
|
self.descTx:setText(num)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -79,12 +79,11 @@ function SummonData:getSummonRewardByLv(summonType, level)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function SummonData:getSummonTotalRewardByLv(summonType, level)
|
function SummonData:getSummonTotalRewardByLv(summonType, level)
|
||||||
|
|
||||||
level = level or self:getSummonLevel()
|
level = level or self:getSummonLevel()
|
||||||
local rewards = {}
|
local rewards = self:getSummonRewardByLv(summonType, 1) -- 基础奖励
|
||||||
for lv = 1, level do
|
if level > 1 then
|
||||||
local lvRewards = self:getSummonRewardByLv(summonType, lv)
|
local addRewards = self:getSummonRewardByLv(summonType, level)
|
||||||
for _, reward in ipairs(lvRewards) do
|
for _, reward in ipairs(addRewards) do
|
||||||
table.insert(rewards, reward)
|
table.insert(rewards, reward)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -108,16 +107,6 @@ function SummonData:getSummonMaxExp(level)
|
|||||||
return cfg[#cfg].exp or 0
|
return cfg[#cfg].exp or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 缓存上次抽宝箱的奖励
|
|
||||||
function SummonData:cacheSummonRewards(rewards)
|
|
||||||
self.summonRewards = rewards
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 获取缓存的数据
|
|
||||||
function SummonData:getLastSummonRewards()
|
|
||||||
return self.summonRewards or {}
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 如果宝箱等级提升了 则标记
|
-- 如果宝箱等级提升了 则标记
|
||||||
function SummonData:markNeedPopBoxLvUpUI()
|
function SummonData:markNeedPopBoxLvUpUI()
|
||||||
self.needPopBoxLvUpUI = true
|
self.needPopBoxLvUpUI = true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user