|
@@ -4,6 +4,7 @@ import { EventDispatcher } from 'db://assets/core_tgx/easy_ui_framework/EventDis
|
|
import { GlobalConfig } from 'db://assets/start/Config/GlobalConfig';
|
|
import { GlobalConfig } from 'db://assets/start/Config/GlobalConfig';
|
|
import { AdvertMgr } from 'db://assets/core_tgx/base/ad/AdvertMgr';
|
|
import { AdvertMgr } from 'db://assets/core_tgx/base/ad/AdvertMgr';
|
|
import { TYPE_ITEM } from '../TakeGobletGlobalInstance';
|
|
import { TYPE_ITEM } from '../TakeGobletGlobalInstance';
|
|
|
|
+import { tgxUIAlert } from 'db://assets/core_tgx/tgx';
|
|
const { ccclass, property } = _decorator;
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -27,31 +28,36 @@ export class ButtonComponent extends Component {
|
|
|
|
|
|
private onClickHandler(type: TYPE_ITEM): void {
|
|
private onClickHandler(type: TYPE_ITEM): void {
|
|
// CarUnscrewAudioMgr.playOneShot(CarUnscrewAudioMgr.getMusicIdName(3), 1.0);
|
|
// CarUnscrewAudioMgr.playOneShot(CarUnscrewAudioMgr.getMusicIdName(3), 1.0);
|
|
- if (type == TYPE_ITEM.FillUp) {
|
|
|
|
- if (!GlobalConfig.isDebug) {
|
|
|
|
- AdvertMgr.instance.showReawardVideo(() => {
|
|
|
|
- EventDispatcher.instance.emit(GameEvent.EVENT_FILL_UP);
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- EventDispatcher.instance.emit(GameEvent.EVENT_FILL_UP);
|
|
|
|
|
|
+ const options = tgxUIAlert.show("提示", true);
|
|
|
|
+ options.onClick((ok: boolean) => {
|
|
|
|
+ if (ok) {
|
|
|
|
+ if (type == TYPE_ITEM.FillUp) {
|
|
|
|
+ if (!GlobalConfig.isDebug) {
|
|
|
|
+ AdvertMgr.instance.showReawardVideo(() => {
|
|
|
|
+ EventDispatcher.instance.emit(GameEvent.EVENT_FILL_UP);
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ EventDispatcher.instance.emit(GameEvent.EVENT_FILL_UP);
|
|
|
|
+ }
|
|
|
|
+ } else if (type == TYPE_ITEM.MoveOut) {
|
|
|
|
+ if (!GlobalConfig.isDebug) {
|
|
|
|
+ AdvertMgr.instance.showReawardVideo(() => {
|
|
|
|
+ EventDispatcher.instance.emit(GameEvent.EVENT_MOVE_OUT);
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ EventDispatcher.instance.emit(GameEvent.EVENT_MOVE_OUT);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (!GlobalConfig.isDebug) {
|
|
|
|
+ AdvertMgr.instance.showReawardVideo(() => {
|
|
|
|
+ EventDispatcher.instance.emit(GameEvent.EVENT_REFRESH_COLOR);
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ EventDispatcher.instance.emit(GameEvent.EVENT_REFRESH_COLOR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- } else if (type == TYPE_ITEM.MoveOut) {
|
|
|
|
- if (!GlobalConfig.isDebug) {
|
|
|
|
- AdvertMgr.instance.showReawardVideo(() => {
|
|
|
|
- EventDispatcher.instance.emit(GameEvent.EVENT_MOVE_OUT);
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- EventDispatcher.instance.emit(GameEvent.EVENT_MOVE_OUT);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (!GlobalConfig.isDebug) {
|
|
|
|
- AdvertMgr.instance.showReawardVideo(() => {
|
|
|
|
- EventDispatcher.instance.emit(GameEvent.EVENT_REFRESH_COLOR);
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- EventDispatcher.instance.emit(GameEvent.EVENT_REFRESH_COLOR);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|