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