From a039324fbc0390a2ea32b6876d53d2bf24091978 Mon Sep 17 00:00:00 2001 From: panw Date: Fri, 24 Apr 2026 09:33:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E8=B0=83=E6=95=B4=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=B8=83=E5=B1=80=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?Boss=E6=B3=A2=E6=AC=A1=E8=AE=A1=E6=97=B6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整 role_controller.prefab 中多个节点的位置、缩放和文本组件尺寸,优化界面布局 - 修改任务组件逻辑,在Boss波次时显示无限时间符号"∞"并暂停倒计时 - 更新文本字体大小、对齐方式和溢出设置,改善视觉表现 --- assets/resources/gui/role_controller.prefab | 36 ++++++++++----------- assets/script/game/map/MissionComp.ts | 29 +++++++++++++---- 2 files changed, 41 insertions(+), 24 deletions(-) diff --git a/assets/resources/gui/role_controller.prefab b/assets/resources/gui/role_controller.prefab index 284cef0b..a08dfcf3 100644 --- a/assets/resources/gui/role_controller.prefab +++ b/assets/resources/gui/role_controller.prefab @@ -190,7 +190,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": 984.915, + "y": 1166.576, "z": 0 }, "_lrot": { @@ -202,8 +202,8 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 2, - "y": 2, + "x": 1, + "y": 1, "z": 1 }, "_mobility": 0, @@ -244,7 +244,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": 82.493, + "y": 0, "z": 0 }, "_lrot": { @@ -306,8 +306,8 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 0.4, - "y": 0.5, + "x": 0.6, + "y": 0.6, "z": 1 }, "_mobility": 0, @@ -470,7 +470,7 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 94.0390625, + "width": 200, "height": 54.4 }, "_anchorPoint": { @@ -509,11 +509,11 @@ "_string": "第 1/20 波", "_horizontalAlign": 1, "_verticalAlign": 1, - "_actualFontSize": 20, - "_fontSize": 20, + "_actualFontSize": 26, + "_fontSize": 25, "_fontFamily": "Arial", "_lineHeight": 40, - "_overflow": 0, + "_overflow": 2, "_enableWrapText": true, "_font": null, "_isSystemFontUsed": true, @@ -881,7 +881,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": 54.50499999999988, + "y": -33.797, "z": 0 }, "_lrot": { @@ -921,8 +921,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 26.24609375, - "height": 104.8 + "width": 200, + "height": 54.4 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -960,11 +960,11 @@ "_string": "30", "_horizontalAlign": 1, "_verticalAlign": 1, - "_actualFontSize": 20, - "_fontSize": 20, + "_actualFontSize": 26, + "_fontSize": 25, "_fontFamily": "Arial", - "_lineHeight": 80, - "_overflow": 0, + "_lineHeight": 40, + "_overflow": 2, "_enableWrapText": true, "_font": null, "_isSystemFontUsed": true, @@ -1060,7 +1060,7 @@ "_target": null, "_left": 0, "_right": 0, - "_top": 195.08499999999992, + "_top": 63.42399999999998, "_bottom": 0, "_horizontalCenter": 0, "_verticalCenter": 0, diff --git a/assets/script/game/map/MissionComp.ts b/assets/script/game/map/MissionComp.ts index 93c7c619..6ead39dc 100644 --- a/assets/script/game/map/MissionComp.ts +++ b/assets/script/game/map/MissionComp.ts @@ -160,6 +160,8 @@ export class MissionComp extends CCComp { private monsterCountSyncTimer: number = 0; /** 当前波数 */ private currentWave: number = 0; + /** 是否为Boss波次 */ + private isBossWave: boolean = false; /** 上一次发放金币奖励的波数(防止重复发放) */ private lastPrepareCoinWave: number = 0; /** 当前任务阶段 */ @@ -216,13 +218,15 @@ export class MissionComp extends CCComp { this.syncMonsterSpawnState(dt) if(smc.mission.stop_mon_action) return smc.vmdata.mission_data.fight_time+=dt - this.FightTime-=dt - this.update_time(); - if (this.FightTime <= 0) { - // 时间到了,自动结束战斗进入准备阶段 - this.FightTime = FightSet.FiIGHT_TIME; - oops.message.dispatchEvent("TimeUpAdvanceWave"); + if (!this.isBossWave) { + this.FightTime-=dt + if (this.FightTime <= 0) { + // 时间到了,自动结束战斗进入准备阶段 + this.FightTime = FightSet.FiIGHT_TIME; + oops.message.dispatchEvent("TimeUpAdvanceWave"); + } } + this.update_time(); } } @@ -230,6 +234,16 @@ export class MissionComp extends CCComp { /** 更新时间/波数显示(仅在秒数变化时更新以减少 Label 操作) */ update_time(){ + if (this.isBossWave) { + const str = "∞"; + if (str != this.lastTimeStr) { + this.time_node.getChildByName("time").getComponent(Label).string = str; + this.lastTimeStr = str; + this.lastTimeSecond = -1; + } + return; + } + const time = Math.max(0, this.FightTime); const remainSecond = Math.floor(time); if (remainSecond === this.lastTimeSecond) return; @@ -651,6 +665,7 @@ export class MissionComp extends CCComp { smc.vmdata.mission_data.mon_max = Math.max(1, Math.floor(this.maxMonsterCount)) this.currentPhase = MissionPhase.None; this.currentWave = 1; + this.isBossWave = false; this.FightTime=FightSet.FiIGHT_TIME this.rewards=[] this.revive_times = 1; @@ -686,6 +701,8 @@ export class MissionComp extends CCComp { const wave = Number(data?.wave ?? 0); if (wave <= 0) return; + this.isBossWave = !!data?.bossWave; + // 在新一波到来时,先进入 BattleEnd,触发上一波的战斗结束技能 (fend),2秒后自动进入下一波的准备阶段 this.changePhase(MissionPhase.BattleEnd);