@cc-component/cc-core 1.3.8 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -32,7 +32,7 @@ export class LayerUI {
|
|
|
32
32
|
bundleName: string = "";
|
|
33
33
|
|
|
34
34
|
loading_call: { open: (finish: () => void) => void, close: () => void }
|
|
35
|
-
progess: { open: (finish: () => void) => void, close: () => void, progess: (progress: number) => void }
|
|
35
|
+
progess: { open: (finish: () => void) => void, close: () => void, progess: (progress: number, time?: number) => void }
|
|
36
36
|
|
|
37
37
|
scene: ISceneParam
|
|
38
38
|
launch: BaseLaunchComponent;
|
|
@@ -72,15 +72,24 @@ export abstract class BaseLoading extends Component {
|
|
|
72
72
|
LanguageData.path_spine = App.gui.config.language.path.spine;
|
|
73
73
|
App.language.setLanguage(App.bundleName, App.gui.config.language.default)
|
|
74
74
|
}
|
|
75
|
-
/**刷新进度
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
/**刷新进度
|
|
76
|
+
* total 总进度
|
|
77
|
+
* isReset 是否开始重置为0
|
|
78
|
+
*/
|
|
79
|
+
addProgess(progess: number, total: number): void {
|
|
80
|
+
const pro = this.getRemainingProgress(total)
|
|
81
|
+
this.pro_total += (pro * progess)
|
|
82
|
+
App.gui.progess.progess?.(this.pro_total)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
resetProgess() {
|
|
86
|
+
this.pro_total = 0
|
|
87
|
+
App.gui.progess.progess?.(this.pro_total, 0)
|
|
79
88
|
}
|
|
80
89
|
|
|
81
90
|
/**获取剩余进度 */
|
|
82
|
-
getRemainingProgress() {
|
|
83
|
-
return (
|
|
91
|
+
getRemainingProgress(total: number) {
|
|
92
|
+
return ((total) - this.pro_total / 100) * 100
|
|
84
93
|
}
|
|
85
94
|
FinishLoad() {
|
|
86
95
|
App.gui.progess.close?.()
|
|
@@ -23,9 +23,8 @@ export abstract class WindowHandler {
|
|
|
23
23
|
Object.keys(configMap).forEach(key => {
|
|
24
24
|
const cof = configMap[key];
|
|
25
25
|
if (cof.module === moduleName) {
|
|
26
|
-
(this as any)[key] = async (params: any) => {
|
|
27
|
-
|
|
28
|
-
};
|
|
26
|
+
(this as any)[key] = async (params: any) => { return await App.OpenWindow(configMap[key], params); };
|
|
27
|
+
(this as any)[`${key}Component`] = () => { return App.GetOpenWindow(configMap[key]); };
|
|
29
28
|
}
|
|
30
29
|
});
|
|
31
30
|
this._impl = null
|
|
@@ -42,7 +42,7 @@ declare global {
|
|
|
42
42
|
function InitGameConfig(param: IInitConfig): Promise<void>;
|
|
43
43
|
/**=====================================⚠️⚠️⚠️ 必须实现的监听======================= */
|
|
44
44
|
/**监听:打开场景加载进度窗口 -open 回调方法需要执行 finish() 方法 */
|
|
45
|
-
function OnProgess(param: { open: (finish: () => void) => void, close: () => void, progess: (progress: number) => void })
|
|
45
|
+
function OnProgess(param: { open: (finish: () => void) => void, close: () => void, progess: (progress: number, time?: number) => void })
|
|
46
46
|
/**监听:显示加载动画 -open 回调方法需要执行 finish() 方法 */
|
|
47
47
|
function OnLoading(param: { open: (finish: () => void) => void, close: () => void })
|
|
48
48
|
/**监听:是否打开网络接口重连窗口 -open 回调方法需要执行 finish() 方法 */
|