refactor(map): 统一使用事件驱动的小提示替代硬编码toast
将多处分散的金币不足、英雄已满等提示逻辑,统一替换为通过GameEvent.ShowSmallTip事件触发的通用小提示组件,替换原有的oops.gui.toast调用,新增通用提示显示逻辑与事件监听
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user