refactor(map): 统一使用事件驱动的小提示替代硬编码toast

将多处分散的金币不足、英雄已满等提示逻辑,统一替换为通过GameEvent.ShowSmallTip事件触发的通用小提示组件,替换原有的oops.gui.toast调用,新增通用提示显示逻辑与事件监听
This commit is contained in:
panFD
2026-06-17 22:47:45 +08:00
parent 575b9cf4d3
commit e6395ba018
4 changed files with 45 additions and 6 deletions

View File

@@ -96,7 +96,7 @@ export class SCardComp extends CCComp {
const success = MissionEconomy.spendCoin(cardCost);
if (!success) {
oops.gui.toast(`金币不足,需要${cardCost}`);
oops.message.dispatchEvent(GameEvent.ShowSmallTip, "buy_coin");
this.playReboundAnim();
return null;
}