Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev

This commit is contained in:
chenxi 2023-06-05 20:32:16 +08:00
commit 507a696e08
7 changed files with 90 additions and 28 deletions

View File

@ -401,6 +401,10 @@ if NOT_PUBLISH then
end end
if (Input.GetKeyDown(KeyCode.RightArrow) or Input.GetKeyDown(KeyCode.LeftArrow)) and Input.GetKey(KeyCode.LeftControl) then if (Input.GetKeyDown(KeyCode.RightArrow) or Input.GetKeyDown(KeyCode.LeftArrow)) and Input.GetKey(KeyCode.LeftControl) then
if not ModuleManager.DevToolManager.set_board_info then
Logger.logHighlight("请先去gm面板设置浏览的棋盘信息!")
return
end
local configName = ModuleManager.DevToolManager.set_board_info.config local configName = ModuleManager.DevToolManager.set_board_info.config
local idx = ModuleManager.DevToolManager.set_board_info.idx or 0 local idx = ModuleManager.DevToolManager.set_board_info.idx or 0
if not configName then if not configName then

View File

@ -20,7 +20,7 @@ end
function BattleSkillSelectComp:_display() function BattleSkillSelectComp:_display()
local uiMap = self:getUIMap() local uiMap = self:getUIMap()
local bg2 = uiMap["battle_select_skill_comp.bg_2"] local bg2 = uiMap["battle_select_skill_comp.bg_2"]
bg2:setVisible(self.onlyCommonSkill) bg2:setActive(self.onlyCommonSkill)
local bg = uiMap["battle_select_skill_comp.bg_1"] local bg = uiMap["battle_select_skill_comp.bg_1"]
if ModuleManager.BattleManager.battleController then if ModuleManager.BattleManager.battleController then
bg:setVisible(false) bg:setVisible(false)
@ -58,13 +58,16 @@ function BattleSkillSelectComp:_addListeners()
self.canvasGroup = uiMap["battle_select_skill_comp.skill_node"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP) self.canvasGroup = uiMap["battle_select_skill_comp.skill_node"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
self.canvasGroup.alpha = 1 self.canvasGroup.alpha = 1
self.bg = uiMap["battle_select_skill_comp.bg_1"] self.bg = uiMap["battle_select_skill_comp.bg_1"]
self.bg2 = uiMap["battle_select_skill_comp.bg_2"]
uiMap["battle_select_skill_comp.look_btn"]:addTouchListener(function(eventType, x, y) uiMap["battle_select_skill_comp.look_btn"]:addTouchListener(function(eventType, x, y)
if eventType == GConst.TOUCH_EVENT.DOWN or eventType == GConst.TOUCH_EVENT.DRAG then if eventType == GConst.TOUCH_EVENT.DOWN or eventType == GConst.TOUCH_EVENT.DRAG then
self.canvasGroup.alpha = 0.3 self.canvasGroup.alpha = 0.3
self.bg:setVisible(false) self.bg:setVisible(false)
self.bg2:setVisible(false)
else else
self.canvasGroup.alpha = 1 self.canvasGroup.alpha = 1
self.bg:setVisible(true) self.bg:setVisible(true)
self.bg2:setVisible(true)
end end
end) end)
end end

View File

@ -40,9 +40,6 @@ function BoxOpenUI:onLoadRootComplete()
-- 播放spine表现 播放完毕后打开奖励UI -- 播放spine表现 播放完毕后打开奖励UI
self.spineObj = self.uiMap["box_open_ui.ui_spine_obj"] self.spineObj = self.uiMap["box_open_ui.ui_spine_obj"]
local spineName local spineName
Logger.logHighlight("type:%s index:%s", self.type, self.index)
if self.type == GConst.ShopConst.BOX_REWARD_TYPE.SUMMON then if self.type == GConst.ShopConst.BOX_REWARD_TYPE.SUMMON then
spineName = SUMMON_SPINE_NAME[self.index] spineName = SUMMON_SPINE_NAME[self.index]
elseif self.type == GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY then elseif self.type == GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY then

View File

@ -159,6 +159,7 @@ function BoxRewardUI:onLoadRootComplete()
if i <= rewardCount then if i <= rewardCount then
self.rewardCells[i]:setVisible(true) self.rewardCells[i]:setVisible(true)
self.rewardCells[i]:refresh(self.fragmentRewards[i]) self.rewardCells[i]:refresh(self.fragmentRewards[i])
self.rewardCells[i]:disableAllEffect()
else else
self.rewardCells[i]:setVisible(false) self.rewardCells[i]:setVisible(false)
end end
@ -203,15 +204,23 @@ function BoxRewardUI:playCellAction(cell, idx)
local seq = cell.baseObject:createBindTweenSequence() local seq = cell.baseObject:createBindTweenSequence()
table.insert(self.cellSeqs, seq) table.insert(self.cellSeqs, seq)
local tween = canvasGroup:DOFade(1, FADE_TIME) -- local tween = canvasGroup:DOFade(1, FADE_TIME)
seq:AppendInterval(delayTime) seq:AppendInterval(delayTime)
tween:SetEase(CS.DG.Tweening.Ease.InOutSine) -- tween:SetEase(CS.DG.Tweening.Ease.InOutSine)
seq:AppendCallback(function() seq:AppendCallback(function()
cell:setSpineVisible(false) -- 防止spine因透明度变化导致的闪白 cell:setSpineVisible(false) -- 防止spine因透明度变化导致的闪白
end) end)
seq:Append(tween) -- seq:Append(tween)
seq:AppendCallback(function() seq:AppendCallback(function()
if not self:isClosed() then if not self:isClosed() then
-- 恢复显示
canvasGroup.alpha = 1
-- 特效
if self.isPlayAni then
cell:playEffect()
else
cell:disableAllEffect()
end
-- 如果需要spine 则显示 -- 如果需要spine 则显示
local heroEntity = DataManager.HeroData:getHeroById(self.fragmentRewards[idx].id) local heroEntity = DataManager.HeroData:getHeroById(self.fragmentRewards[idx].id)
if heroEntity and heroEntity:canLvUp() then if heroEntity and heroEntity:canLvUp() then
@ -298,6 +307,7 @@ function BoxRewardUI:jump()
canvasGroup = cell.baseObject:addComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP) canvasGroup = cell.baseObject:addComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
end end
canvasGroup.alpha = 1 canvasGroup.alpha = 1
cell:disableAllEffect()
end end
self.scrollRectContent:setAnchoredPositionY(self.maxScrollContentHeight - BASE_CONTENT_HEIGHT) self.scrollRectContent:setAnchoredPositionY(self.maxScrollContentHeight - BASE_CONTENT_HEIGHT)
self.turnIdx = self.maxIdx self.turnIdx = self.maxIdx

View File

@ -4,6 +4,11 @@ function BoxHeroCell:init()
local uiMap = self.baseObject:genAllChildren() local uiMap = self.baseObject:genAllChildren()
self.heroCell = CellManager:addCellComp(uiMap["cell.hero_cell"], GConst.TYPEOF_LUA_CLASS.HERO_CELL) self.heroCell = CellManager:addCellComp(uiMap["cell.hero_cell"], GConst.TYPEOF_LUA_CLASS.HERO_CELL)
self.heroNumText = uiMap["cell.num_tx"] self.heroNumText = uiMap["cell.num_tx"]
self.effects = {}
self.effects[2] = uiMap["cell.effect_node.sfx_ui_zhaohuan_lv_b01"]
self.effects[3] = uiMap["cell.effect_node.sfx_ui_zhaohuan_lan_b01"]
self.effects[4] = uiMap["cell.effect_node.sfx_ui_zhaohuan_zi_b01"]
self:disableAllEffect()
end end
function BoxHeroCell:refresh(data) function BoxHeroCell:refresh(data)
@ -20,6 +25,32 @@ function BoxHeroCell:refresh(data)
self.heroNumText:setText("X" .. tostring(num)) self.heroNumText:setText("X" .. tostring(num))
end end
function BoxHeroCell:playEffect()
if self.data and self.effects then
local id = self.data.id
local heroInfo = ConfigManager:getConfig("hero")[id]
if heroInfo then
local qlt = heroInfo.qlt
for key, effect in pairs(self.effects) do
if key == qlt then
effect:setActive(true)
effect:play()
else
effect:setActive(false)
end
end
end
end
end
function BoxHeroCell:disableAllEffect()
if self.effects then
for key, effect in pairs(self.effects) do
effect:setActive(false)
end
end
end
function BoxHeroCell:setSpineVisible(visible) function BoxHeroCell:setSpineVisible(visible)
self.heroCell:setSpineVisible(visible) self.heroCell:setSpineVisible(visible)
end end

View File

@ -12,13 +12,13 @@ local GIFT_BG_NAME = {
} }
local GIFT_TITLE_TEXT = { local GIFT_TITLE_TEXT = {
[PayManager.PURCHARSE_TYPE.ACT_GIFT] = { [PayManager.PURCHARSE_TYPE.ACT_GIFT] = {
[PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_9), [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = I18N.GlobalConst.SHOP_DESC_9,
[PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_11), [PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT] = I18N.GlobalConst.SHOP_DESC_11,
[PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_12), [PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = I18N.GlobalConst.SHOP_DESC_12,
[PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_14), [PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = I18N.GlobalConst.SHOP_DESC_14,
}, },
[PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_10), [PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = I18N.GlobalConst.SHOP_DESC_10,
[PayManager.PURCHARSE_TYPE.GROW_UP_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_13), [PayManager.PURCHARSE_TYPE.GROW_UP_GIFT] = I18N.GlobalConst.SHOP_DESC_13,
} }
local MAX_ITEM_NUM = 4 local MAX_ITEM_NUM = 4
@ -101,10 +101,10 @@ function GiftPopUI:refresh(needCheck)
end end
if self.actType == PayManager.PURCHARSE_TYPE.ACT_GIFT then if self.actType == PayManager.PURCHARSE_TYPE.ACT_GIFT then
local type = PayManager:getGiftConfigInfo(self.actType, self.actId).type local type = PayManager:getGiftConfigInfo(self.actType, self.actId).type
self.titleTx:setText(GIFT_TITLE_TEXT[self.actType][type]) self.titleTx:setText(I18N:getGlobalText(GIFT_TITLE_TEXT[self.actType][type]))
self.banner:setTexture(GIFT_BG_NAME[self.actType][type]) self.banner:setTexture(GIFT_BG_NAME[self.actType][type])
else else
self.titleTx:setText(GIFT_TITLE_TEXT[self.actType]) self.titleTx:setText(I18N:getGlobalText(GIFT_TITLE_TEXT[self.actType]))
self.banner:setTexture(GIFT_BG_NAME[self.actType]) self.banner:setTexture(GIFT_BG_NAME[self.actType])
end end

View File

@ -686,21 +686,25 @@ function ShopData:getValidGrowUpGifts()
-- 是否在有效范围内 -- 是否在有效范围内
local isInDurationTime = Time:getServerTime() < maxDurationTime local isInDurationTime = Time:getServerTime() < maxDurationTime
if isInDurationTime then if isInDurationTime then
-- 从通用act里找到这个礼包 如果有该礼包且购买次数未达到上限,则有效;如果没有该礼包也有效 -- 如果是最后一档 默认有效
local actGiftDetailData = self:getActGiftDetailData(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT, gift.current_grow_up_id) if cfgInfo.last then
isValid = true
if actGiftDetailData then else -- 否则从通用act里找到这个礼包 如果有该礼包且购买次数未达到上限,则有效;如果没有该礼包也有效
local buyCount = actGiftDetailData.buy_count local actGiftDetailData = self:getActGiftDetailData(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT, gift.current_grow_up_id)
local latestBuyTime = actGiftDetailData.latest_buy_at // 1000
if buyLimit > 0 then if actGiftDetailData then
if buyCount < buyLimit then local buyCount = actGiftDetailData.buy_count
local latestBuyTime = actGiftDetailData.latest_buy_at // 1000
if buyLimit > 0 then
if buyCount < buyLimit then
isValid = true
end
else
isValid = true isValid = true
end end
else else
isValid = true isValid = true
end end
else
isValid = true
end end
end end
if isValid then if isValid then
@ -724,8 +728,21 @@ end
-- 触发了成长礼包 -- 触发了成长礼包
function ShopData:onTriggerGrowUpGift(gift) function ShopData:onTriggerGrowUpGift(gift)
table.insert(self.growUpGifts, gift) local hasGift = false
if self.growUpGifts then
for _, ownGift in ipairs(self.growUpGifts) do
if ownGift.current_grow_up_id == gift.current_grow_up_id then
ownGift.trigger_at = gift.trigger_at
ownGift.hero_id = gift.hero_id
hasGift = true
break
end
end
end
if not hasGift then
table.insert(self.growUpGifts, gift)
end
self:setDirty() self:setDirty()
end end