diff --git a/lua/app/game.lua b/lua/app/game.lua index 4a659c01..06e3b69e 100644 --- a/lua/app/game.lua +++ b/lua/app/game.lua @@ -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 diff --git a/lua/app/ui/battle/battle_skill_select_comp.lua b/lua/app/ui/battle/battle_skill_select_comp.lua index 153d6457..2d6cb7fb 100644 --- a/lua/app/ui/battle/battle_skill_select_comp.lua +++ b/lua/app/ui/battle/battle_skill_select_comp.lua @@ -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 diff --git a/lua/app/ui/shop/box_open_ui.lua b/lua/app/ui/shop/box_open_ui.lua index 8aebc8f3..3e473818 100644 --- a/lua/app/ui/shop/box_open_ui.lua +++ b/lua/app/ui/shop/box_open_ui.lua @@ -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 diff --git a/lua/app/ui/shop/box_reward_ui.lua b/lua/app/ui/shop/box_reward_ui.lua index 72c8970c..cafc8b8a 100644 --- a/lua/app/ui/shop/box_reward_ui.lua +++ b/lua/app/ui/shop/box_reward_ui.lua @@ -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 diff --git a/lua/app/ui/shop/cell/box_hero_cell.lua b/lua/app/ui/shop/cell/box_hero_cell.lua index c524b0ce..f244dfda 100644 --- a/lua/app/ui/shop/cell/box_hero_cell.lua +++ b/lua/app/ui/shop/cell/box_hero_cell.lua @@ -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 diff --git a/lua/app/ui/shop/gift_pop_ui.lua b/lua/app/ui/shop/gift_pop_ui.lua index 5741d480..f6ef6b59 100644 --- a/lua/app/ui/shop/gift_pop_ui.lua +++ b/lua/app/ui/shop/gift_pop_ui.lua @@ -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 diff --git a/lua/app/userdata/shop/shop_data.lua b/lua/app/userdata/shop/shop_data.lua index 01824d29..16e85187 100644 --- a/lua/app/userdata/shop/shop_data.lua +++ b/lua/app/userdata/shop/shop_data.lua @@ -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