|
@@ -2,7 +2,7 @@ import { _decorator, Component, Label, Node } from 'cc';
|
|
|
import { UserManager } from './Manager/UserMgr';
|
|
|
import { GameUtil } from './GameUtil';
|
|
|
import { tgxUIMgr } from '../../core_tgx/tgx';
|
|
|
-import { UI_BattleGambit } from '../../scripts/UIDef';
|
|
|
+import { UI_BattleGambit, UI_PowerUp } from '../../scripts/UIDef';
|
|
|
import { EventDispatcher } from '../../core_tgx/easy_ui_framework/EventDispatcher';
|
|
|
import { GameEvent } from './Enum/GameEvent';
|
|
|
import { GlobalConfig } from '../../start/Config/GlobalConfig';
|
|
@@ -74,6 +74,9 @@ export class HomeUI extends Component {
|
|
|
|
|
|
private registerListener() {
|
|
|
EventDispatcher.instance.on(GameEvent.EVENT_REFRESH_PLAYER_INFO,this.updatePowerUI,this);
|
|
|
+
|
|
|
+ const btnPowerUp = this.node.getChildByPath('HomeUI/Power/BtnPowerUp')!;
|
|
|
+ btnPowerUp.on(Node.EventType.TOUCH_END, this.onClickPowerUp,this);
|
|
|
}
|
|
|
|
|
|
update(deltaTime: number) {
|
|
@@ -103,6 +106,13 @@ export class HomeUI extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private onClickPowerUp() {
|
|
|
+ const match = tgxUIMgr.inst.isShowing(UI_PowerUp);
|
|
|
+ if (!match) {
|
|
|
+ tgxUIMgr.inst.showUI(UI_PowerUp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private unregisterListener() {
|
|
|
EventDispatcher.instance.off(GameEvent.EVENT_REFRESH_PLAYER_INFO,this.updatePowerUI,this);
|
|
|
}
|