From 581ab1eadcb4516bf3cc9fc686dd21228db03611 Mon Sep 17 00:00:00 2001 From: dgflash Date: Sun, 5 Feb 2023 17:09:29 +0800 Subject: [PATCH] =?UTF-8?q?TipsManager=E4=B8=AD=E7=BD=91=E7=BB=9C=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=85=BC=E5=AE=B93.7=E7=89=88=E6=A1=86=E6=9E=B6API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/main.scene | 2 +- .../script/game/common/prompt/TipsManager.ts | 29 +++++++++---------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/assets/main.scene b/assets/main.scene index 7f5ca34..81d7a19 100644 --- a/assets/main.scene +++ b/assets/main.scene @@ -258,7 +258,7 @@ "_priority": 1073741824, "_fov": 45, "_fovAxis": 0, - "_orthoHeight": 381.81818181818187, + "_orthoHeight": 396.1506276150628, "_near": 1, "_far": 2000, "_color": { diff --git a/assets/script/game/common/prompt/TipsManager.ts b/assets/script/game/common/prompt/TipsManager.ts index 45ca262..09bd2e3 100644 --- a/assets/script/game/common/prompt/TipsManager.ts +++ b/assets/script/game/common/prompt/TipsManager.ts @@ -12,33 +12,30 @@ import { UIID } from "../config/GameUIConfig"; /** 提示窗口管理 */ class TipsManager { - private _timeId = "" /** 网络恢复 */ - public networkRecovery() { - if (this._timeId) { - oops.timer.unschedule(this._timeId); - this._timeId = ""; - } + networkRecovery() { + oops.timer.unschedule(this.netInstableOpen); oops.gui.remove(UIID.Netinstable); } + /** 打开网络不稳定提示 */ - public netInstableOpen() { + netInstableOpen() { if (!oops.gui.has(UIID.Netinstable)) { oops.gui.open(UIID.Netinstable); } } - public netInstableClose() { + + netInstableClose() { oops.gui.remove(UIID.Netinstable); } + /** 网络延时 */ - public networkLatency(time: number) { - if (this._timeId) { - oops.timer.unschedule(this._timeId); - } - this._timeId = oops.timer.scheduleOnce(this.netInstableOpen, time); + networkLatency(time: number) { + oops.timer.unschedule(this.netInstableOpen); + oops.timer.scheduleOnce(this.netInstableOpen, time); } - public test(callback?: Function) { + test(callback?: Function) { let operate: any = { title: 'common_prompt_title_sys', content: "common_prompt_content", @@ -55,7 +52,7 @@ class TipsManager { oops.gui.open(UIID.Window, operate, this.getPopCommonEffect()); } - public alert(content: string, cb?: Function, title?: string, okWord?: string) { + alert(content: string, cb?: Function, title?: string, okWord?: string) { let operate: any = { title: title ? title : 'common_prompt_title_sys', content: content, @@ -68,7 +65,7 @@ class TipsManager { oops.gui.open(UIID.Window, operate, tips.getPopCommonEffect()); } - public confirm(content: string, cb: Function, okWord: string = "common_prompt_ok") { + confirm(content: string, cb: Function, okWord: string = "common_prompt_ok") { let operate: any = { title: 'common_prompt_title_sys', content: content,