diff --git a/lua/app/module/battle/battle_manager.lua b/lua/app/module/battle/battle_manager.lua index f87d74d3..099e0450 100644 --- a/lua/app/module/battle/battle_manager.lua +++ b/lua/app/module/battle/battle_manager.lua @@ -18,6 +18,10 @@ function BattleManager:showBattleResultUI(rewards, combatReport, mysteryBoxIdx) UIManager:showUI("app/ui/battle/battle_result_ui", {rewards = rewards, combatReport = combatReport, mysteryBoxIdx = mysteryBoxIdx}) end +function BattleManager:showBoxOpenUI(rewards, callback) + UIManager:showUI("app/ui/battle/battle_box_open_ui", {rewards = rewards, callback = callback}) +end + function BattleManager:playBattle(battleType, params, returnFunc) params = params or {} if self.battleController then -- 同一时间只能有一场战斗 diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 22a7785a..da935111 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -1011,7 +1011,7 @@ function BattleController:dealGridBreak(posId, condition, time, breakedMap, sequ end end if entity:getEffectType() then - local list = BATTLE_GRID_EFFECT_HANDLE.gridEffectOn(posId, gridEntities, BattleConst.GRID_EFFECT_TRIGGER_TYPE.ON_GRID_BREAK, self, onlyCheck) + local succ, list = BATTLE_GRID_EFFECT_HANDLE.gridEffectOn(posId, gridEntities, BattleConst.GRID_EFFECT_TRIGGER_TYPE.ON_GRID_BREAK, self, onlyCheck) if list then aniUnit.aniPosList = {} aniUnit.overCallback = aniUnit.callback @@ -1156,7 +1156,7 @@ function BattleController:onFillBoardOver(isRoundBeginCheck) local index = table.remove(self.showMysteryBoxIndexs, 1) local boardList, _, mysteryBoxIndexMap = self:getInitBoard() local rewards = mysteryBoxIndexMap[index] - ModuleManager.TipsManager:showRewardsTips(rewards, nil, nil, function() + ModuleManager.BattleManager:showBoxOpenUI(rewards, function() self:onFillBoardOver() end) return diff --git a/lua/app/module/battle/skill/battle_grid_effect_handle.lua b/lua/app/module/battle/skill/battle_grid_effect_handle.lua index 513b984c..7495b3e0 100644 --- a/lua/app/module/battle/skill/battle_grid_effect_handle.lua +++ b/lua/app/module/battle/skill/battle_grid_effect_handle.lua @@ -12,7 +12,7 @@ local function _directionElinination(entity, gridEntities, battleController, onl end local direction = effectParams[1] local list = ModuleManager.BattleManager:getPosIdsByDirection(entity:getPosId(), direction) - return list + return true, list end local function _crossSpread(entity, gridEntities, battleController, onlyCheck) diff --git a/lua/app/ui/battle/battle_box_open_ui.lua b/lua/app/ui/battle/battle_box_open_ui.lua new file mode 100644 index 00000000..92804a65 --- /dev/null +++ b/lua/app/ui/battle/battle_box_open_ui.lua @@ -0,0 +1,35 @@ +local BattleBoxOpenUI = class("BattleBoxOpenUI", BaseUI) + +function BattleBoxOpenUI:isFullScreen() + return false +end + +function BattleBoxOpenUI:getPrefabPath() + return "assets/prefabs/ui/battle/battle_box_open_ui.prefab" +end + +function BattleBoxOpenUI:ctor(params) + self.rewards = params.rewards + self.callback = params.callback +end + +function BattleBoxOpenUI:onLoadRootComplete() + local uiMap = self.root:genAllChildren() + if not self.rewardCell then + self.rewardCell = CellManager:addCellComp(uiMap["battle_box_open_ui.reward_cell"], GConst.TYPEOF_LUA_CLASS.REWARD_CELL) + end + + local reward = self.rewards[1] + if reward then + self.rewardCell:refreshByConfig(reward) + end + + uiMap["battle_box_open_ui.mask"]:addClickListener(function() + self:closeUI() + if self.callback then + self.callback() + end + end) +end + +return BattleBoxOpenUI \ No newline at end of file diff --git a/lua/app/ui/battle/battle_box_open_ui.lua.meta b/lua/app/ui/battle/battle_box_open_ui.lua.meta new file mode 100644 index 00000000..dbb44a5d --- /dev/null +++ b/lua/app/ui/battle/battle_box_open_ui.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4a9fb63578c42f747a246e6e0c5662e7 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}