woso_javan hace 3 meses
padre
commit
a6bf819488
Se han modificado 1 ficheros con 30 adiciones y 24 borrados
  1. 30 24
      assets/module_take_goblet/Script/Component/ButtonComponent.ts

+ 30 - 24
assets/module_take_goblet/Script/Component/ButtonComponent.ts

@@ -4,6 +4,7 @@ import { EventDispatcher } from 'db://assets/core_tgx/easy_ui_framework/EventDis
 import { GlobalConfig } from 'db://assets/start/Config/GlobalConfig';
 import { AdvertMgr } from 'db://assets/core_tgx/base/ad/AdvertMgr';
 import { TYPE_ITEM } from '../TakeGobletGlobalInstance';
+import { tgxUIAlert } from 'db://assets/core_tgx/tgx';
 const { ccclass, property } = _decorator;
 
 /**
@@ -27,31 +28,36 @@ export class ButtonComponent extends Component {
 
     private onClickHandler(type: TYPE_ITEM): void {
         // 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);
-            }
-        }
+        })
     }
 
 }