From 9c5492c5b597ef3b54da6820e9b3aec8c8e7c0cb Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Fri, 7 Nov 2025 16:11:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E6=8A=80=E5=9C=BA=E5=8F=96=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/arena/arena_manager.lua | 5 +++- lua/app/ui/battle/battle_ui_pvp.lua | 37 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/lua/app/module/arena/arena_manager.lua b/lua/app/module/arena/arena_manager.lua index d0b0e20d..dc9187e3 100644 --- a/lua/app/module/arena/arena_manager.lua +++ b/lua/app/module/arena/arena_manager.lua @@ -252,7 +252,10 @@ function ArenaManager:rspAdBoxReward(result) if result.err_code == GConst.ERROR_STR.SUCCESS then self.willShowAdBoxState = nil local idx = result.reqData.win and 2 or 1 - ModuleManager.ShopManager:showBoxOpenUI({type = GConst.ShopConst.BOX_REWARD_TYPE.ARENA_AD_BOX, params = idx, rewards = result.rewards}) + -- ModuleManager.ShopManager:showBoxOpenUI({type = GConst.ShopConst.BOX_REWARD_TYPE.ARENA_AD_BOX, params = idx, rewards = result.rewards}) + if result.rewards then + GFunc.showRewardBox(result.rewards) + end EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.ARENA_AD_BOX_SUCCESS) end end diff --git a/lua/app/ui/battle/battle_ui_pvp.lua b/lua/app/ui/battle/battle_ui_pvp.lua index aaf1e59c..138f06d3 100644 --- a/lua/app/ui/battle/battle_ui_pvp.lua +++ b/lua/app/ui/battle/battle_ui_pvp.lua @@ -5,6 +5,7 @@ local DEFAULT_X = 10000 local ALPHA_COLOR = BF.Color(1, 1, 1, 0) local BLACK_ALPHA_COLOR = BF.Color(0, 0, 0, 0) local TIPS_BG = {"battle_bg_6", "battle_bg_14"} +local ELIMINATION_TOUCH_EVENT = GConst.ELIMINATION_TOUCH_EVENT ---------------------------------必须重写的方法---------------------------------- function BattleUIPVP:initBaseInfo() @@ -154,6 +155,42 @@ function BattleUIPVP:initCounterAttack() self.counterAttackNode:setVisible(false) end +function BattleUIPVP:initTouchCancel() + local uiMap = self.root:genAllChildren() + local touchCancelNode = uiMap["battle_ui_pvp.board_root_node.board_center_node.touch_cancel_node"] + touchCancelNode:setVisible(false) + touchCancelNode:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_ELIMINATION_TOUCH_EVENT):AddTouchEventListener(function(eventType) + if eventType == ELIMINATION_TOUCH_EVENT.ENTER then -- 取消链接 + self.battleController:clearGridSequence() + AudioManager:playEffect(AudioManager.EFFECT_ID.LINK_CANCEL) + end + end) + -- local w, h = GFunc.getUIExpandScreenSize() + -- local addW = h - CS.BF.GameConst.DESIGN_RESOLUTION_HEIGHT + -- touchCancelNode:setSizeDeltaY(509 + addW) + local allImg = uiMap["battle_ui_pvp.board_root_node.board_center_node.touch_cancel_node.all_img"] + allImg:setVisible(false) + uiMap["battle_ui_pvp.board_root_node.board_center_node.touch_cancel_node.all_img.tips_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_13)) +end + +function BattleUIPVP:showTouchCancel() + if self.battleController.curActionSide ~= GConst.BattleConst.SIDE_ATK then + return + end + local uiMap = self.root:genAllChildren() + local touchCancelNode = uiMap["battle_ui_pvp.board_root_node.board_center_node.touch_cancel_node"] + touchCancelNode:setVisible(true) + + -- 判断是否显示提示框 + local allImg = uiMap["battle_ui_pvp.board_root_node.board_center_node.touch_cancel_node.all_img"] + allImg:setVisible(true) +end + +function BattleUIPVP:hideTouchCancel() + local uiMap = self.root:genAllChildren() + local touchCancelNode = uiMap["battle_ui_pvp.board_root_node.board_center_node.touch_cancel_node"] + touchCancelNode:setVisible(false) +end --------------------------------end必须重写的方法-------------------------------- function BattleUIPVP:getBGMId()