From ce5fda3586de6d54cfb5a33a174360be9da7ca57 Mon Sep 17 00:00:00 2001 From: panFD Date: Wed, 22 Jul 2026 22:28:35 +0800 Subject: [PATCH] =?UTF-8?q?refactor(map):=20=E7=BB=9F=E4=B8=80=E5=85=B3?= =?UTF-8?q?=E5=8D=A1=E5=8D=A1=E7=89=87=E4=BA=A4=E4=BA=92=E6=8B=A6=E6=88=AA?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除各按钮点击的前置拦截,改为统一通过nock节点阻挡未召唤英雄时的点击 --- assets/script/game/map/MissionCardComp.ts | 36 +++-------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/assets/script/game/map/MissionCardComp.ts b/assets/script/game/map/MissionCardComp.ts index 31906f34..fc4d1497 100644 --- a/assets/script/game/map/MissionCardComp.ts +++ b/assets/script/game/map/MissionCardComp.ts @@ -532,11 +532,6 @@ export class MissionCardComp extends CCComp { */ private onShowSkillsClick() { if (!this.skill_card_node || !this.skill_card_node.isValid) return; - // 未召唤英雄时阻止打开技能面板 - if (!this.hasCalledHero) { - oops.gui.toast("请先召唤一个英雄"); - return; - } oops.audio.playEffect("music/button"); const visible = !this.skill_card_node.active; if (visible) { @@ -569,11 +564,6 @@ export class MissionCardComp extends CCComp { */ private onShowShopClick() { if (!this.shopPanNode || !this.shopPanNode.isValid) return; - // 未召唤英雄时阻止打开商店面板 - if (!this.hasCalledHero) { - oops.gui.toast("请先召唤一个英雄"); - return; - } oops.audio.playEffect("music/button"); const visible = !this.shopPanNode.active; if (visible) { @@ -890,23 +880,10 @@ export class MissionCardComp extends CCComp { */ private updatePanelButtonsInteractable() { const interactable = this.hasCalledHero; - // 技能面板按钮:显示按钮但用 nock_node 阻挡点击 - if (this.showSkills && this.showSkills.isValid) { - this.showSkills.active = true; - const nock = this.showSkills.getChildByName("nock"); - if (nock) nock.active = !interactable; - } - // 装备商店按钮:显示按钮但用 nock_node 阻挡点击 - if (this.showEquips && this.showEquips.isValid) { - this.showEquips.active = true; - const nock = this.showEquips.getChildByName("nock"); - if (nock) nock.active = !interactable; - } - // 商品商店按钮:显示按钮但用 nock_node 阻挡点击 - if (this.showShop && this.showShop.isValid) { - this.showShop.active = true; - const nock = this.showShop.getChildByName("nock"); - if (nock) nock.active = !interactable; + // nock_node 是覆盖在其他按钮上的阻挡层: + // 未召唤英雄时激活(阻挡点击),召唤英雄后隐藏(允许点击) + if (this.nock_node && this.nock_node.isValid) { + this.nock_node.active = !interactable; } } @@ -997,11 +974,6 @@ export class MissionCardComp extends CCComp { */ private onShowEquipsClick() { if (!this.equipsPanNode || !this.equipsPanNode.isValid) return; - // 未召唤英雄时阻止打开装备面板 - if (!this.hasCalledHero) { - oops.gui.toast("请先召唤一个英雄"); - return; - } oops.audio.playEffect("music/button"); const visible = !this.equipsPanNode.active; if (visible) {