keytops-game-framework 1.0.22 → 1.0.23

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.
@@ -34,6 +34,7 @@ export interface IView {
34
34
  removeView(view: IView, destroy?: boolean): void;
35
35
  setData(...data: any[]): void;
36
36
  close(...eventParams: any[]): void;
37
+ onClose(caller: any, listener: (...args: any[]) => void, once?: boolean, ...args: any[]): void;
37
38
  removeFromParent(destroy?: boolean): void;
38
39
  allDestroy(): void;
39
40
  /**
package/dist/index.js CHANGED
@@ -7750,6 +7750,10 @@ let View = View_1 = class View extends cc.Component {
7750
7750
  close(...closeEventParams) {
7751
7751
  this.removeFromParent(!this.config.cache, ...closeEventParams);
7752
7752
  }
7753
+ onClose(caller, listener, once = true, ...args) {
7754
+ const targetView = this.config.viewClassName || this.config.viewClass || View_1.type;
7755
+ viewManager.onViewClose(targetView, caller, listener, once, ...args);
7756
+ }
7753
7757
  /**
7754
7758
  * 从父级移除视图
7755
7759
  * @param destroy 是否销毁,默认为true
@@ -8318,7 +8322,7 @@ class ViewManager {
8318
8322
  * @param once 是否只监听对应视图关闭一次。
8319
8323
  * @param args 其他参数
8320
8324
  */
8321
- onViewEvent(event, caller, listener, once = false, ...args) {
8325
+ onViewEvent(event, caller, listener, once = true, ...args) {
8322
8326
  if (!this._viewEvent) {
8323
8327
  this._viewEvent = new EventDispatcher();
8324
8328
  }
@@ -137,6 +137,7 @@ export declare class View extends cc.Component implements IView {
137
137
  * @param closeEventParams 视图close事件的参数
138
138
  */
139
139
  close(...closeEventParams: any[]): void;
140
+ onClose(caller: any, listener: (...args: any[]) => void, once?: boolean, ...args: any[]): void;
140
141
  /**
141
142
  * 从父级移除视图
142
143
  * @param destroy 是否销毁,默认为true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keytops-game-framework",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "cocos creator game framework library",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",