fix(map): 统一英雄相关提示的弹窗逻辑与文案
1. 调整出售英雄时的提示方式,复用smalltip气泡弹窗而非独立toast 2. 优化MissionCardComp的smalltip提示方法,支持自定义文案和多负载格式 3. 补充英雄满员提示的自定义文案,与出售限制提示保持统一提示样式
This commit is contained in:
@@ -189,9 +189,9 @@ export class HeroBoxComp extends CCComp {
|
||||
*/
|
||||
private onSellHeroClick() {
|
||||
if (!this.eid || !this.model) return;
|
||||
// 场上仅剩 1 个英雄时不允许出售(至少保留一个作战单位)
|
||||
// 场上仅剩 1 个英雄时不允许出售:复用英雄栏 smalltip 气泡提示(与满员同一挂载点)
|
||||
if (HeroBoxComp.getAliveHeroCount() <= 1) {
|
||||
oops.gui.toast("至少保留 1 个英雄");
|
||||
oops.message.dispatchEvent(GameEvent.ShowSmallTip, { type: "hero_full", text: "至少保留 1 个英雄" });
|
||||
return;
|
||||
}
|
||||
oops.audio.playEffect("music/button");
|
||||
|
||||
Reference in New Issue
Block a user