fix(ui): 调整任务界面布局并优化Boss波次计时显示
- 调整 role_controller.prefab 中多个节点的位置、缩放和文本组件尺寸,优化界面布局 - 修改任务组件逻辑,在Boss波次时显示无限时间符号"∞"并暂停倒计时 - 更新文本字体大小、对齐方式和溢出设置,改善视觉表现
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user