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
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 idx = ModuleManager.DevToolManager.set_board_info.idx or 0
if not configName then

View File

@ -20,7 +20,7 @@ end
function BattleSkillSelectComp:_display()
local uiMap = self:getUIMap()
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"]
if ModuleManager.BattleManager.battleController then
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.alpha = 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)
if eventType == GConst.TOUCH_EVENT.DOWN or eventType == GConst.TOUCH_EVENT.DRAG then
self.canvasGroup.alpha = 0.3
self.bg:setVisible(false)
self.bg2:setVisible(false)
else
self.canvasGroup.alpha = 1
self.bg:setVisible(true)
self.bg2:setVisible(true)
end
end)
end

View File

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

View File

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

View File

@ -4,6 +4,11 @@ function BoxHeroCell:init()
local uiMap = self.baseObject:genAllChildren()
self.heroCell = CellManager:addCellComp(uiMap["cell.hero_cell"], GConst.TYPEOF_LUA_CLASS.HERO_CELL)
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
function BoxHeroCell:refresh(data)
@ -20,6 +25,32 @@ function BoxHeroCell:refresh(data)
self.heroNumText:setText("X" .. tostring(num))
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)
self.heroCell:setSpineVisible(visible)
end

View File

@ -12,13 +12,13 @@ local GIFT_BG_NAME = {
}
local GIFT_TITLE_TEXT = {
[PayManager.PURCHARSE_TYPE.ACT_GIFT] = {
[PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_9),
[PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_11),
[PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_12),
[PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_14),
[PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = I18N.GlobalConst.SHOP_DESC_9,
[PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT] = I18N.GlobalConst.SHOP_DESC_11,
[PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = I18N.GlobalConst.SHOP_DESC_12,
[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.GROW_UP_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_13),
[PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = I18N.GlobalConst.SHOP_DESC_10,
[PayManager.PURCHARSE_TYPE.GROW_UP_GIFT] = I18N.GlobalConst.SHOP_DESC_13,
}
local MAX_ITEM_NUM = 4
@ -101,10 +101,10 @@ function GiftPopUI:refresh(needCheck)
end
if self.actType == PayManager.PURCHARSE_TYPE.ACT_GIFT then
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])
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])
end

View File

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