keytops-game-framework 1.0.19 → 1.0.20

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.
@@ -29,6 +29,7 @@ export declare class ViewManager {
29
29
  private _currentStack;
30
30
  private _viewCache;
31
31
  private _currentMaskView;
32
+ private _defaultMaskViewConfig;
32
33
  private _touchLocks;
33
34
  private _viewEvent;
34
35
  private static created;
@@ -47,6 +48,13 @@ export declare class ViewManager {
47
48
  * @param config 视图配置
48
49
  */
49
50
  registerView(viewName: string, config: ViewConfig): void;
51
+ /**
52
+ * 注册closeTouch默认遮罩视图
53
+ * @param config 视图配置|Class|名称
54
+ */
55
+ registerMaskView(config: {
56
+ prototype: IView;
57
+ } | ViewConfig | string): void;
50
58
  /**
51
59
  * 获取视图配置
52
60
  * @param config
package/dist/index.js CHANGED
@@ -6873,6 +6873,17 @@ class ViewManager {
6873
6873
  }
6874
6874
  this._viewConfigMap.set(viewName, config);
6875
6875
  }
6876
+ /**
6877
+ * 注册closeTouch默认遮罩视图
6878
+ * @param config 视图配置|Class|名称
6879
+ */
6880
+ registerMaskView(config) {
6881
+ let viewConfig = this._getViewConfig(config);
6882
+ if (!viewConfig) {
6883
+ throw new Error(`未获取到默认遮罩视图${config}的配置`);
6884
+ }
6885
+ this._defaultMaskViewConfig = viewConfig;
6886
+ }
6876
6887
  getViewConfig(config) {
6877
6888
  return Object.assign({}, this._getViewConfig(config));
6878
6889
  }
@@ -6986,7 +6997,7 @@ class ViewManager {
6986
6997
  closeTouch(maskViewConfig = null, delay = 200) {
6987
6998
  return __awaiter(this, void 0, void 0, function* () {
6988
6999
  const token = this._lockTouch();
6989
- let config = maskViewConfig && this._getViewConfig(maskViewConfig);
7000
+ let config = maskViewConfig == null ? this._defaultMaskViewConfig : this._getViewConfig(maskViewConfig);
6990
7001
  if (!config) {
6991
7002
  return token;
6992
7003
  }
@@ -8865,6 +8876,18 @@ function viewClass(data) {
8865
8876
  viewManager.registerView(data.name, data);
8866
8877
  };
8867
8878
  }
8879
+ /**
8880
+ * 注册closeTouch默认遮罩视图
8881
+ * @param data 视图配置
8882
+ */
8883
+ function maskView(data) {
8884
+ return function (target, propertyKey) {
8885
+ data.cache = true;
8886
+ data.zIndex = ViewLevel.TOPUP;
8887
+ viewClass(data)(target, propertyKey);
8888
+ viewManager.registerMaskView(data);
8889
+ };
8890
+ }
8868
8891
  /**
8869
8892
  * cocos 默认视图加载器(Prefab)
8870
8893
  */
@@ -15069,4 +15092,4 @@ TipsView = __decorate([
15069
15092
  menu("基础视图/TipsView")
15070
15093
  ], TipsView);
15071
15094
 
15072
- export { ADAnalyticsAble, ADBehaviorReporter, ADEvent, ADType, AD_METRIC_ORDER_V1, ALiAnalyticsSender, AdDimension, AnalyticsAble, App, Application, Async, AudioBusiness, BaseDimension, BaseOnlineConfig, BaseProtocolHelper, BusinessCenter, ByteView, CCPViewLoader, CCSceneLoader, CocosNativeHelper, CocosStorageUtils, CocosViewManager, Component, ConfigHelper, DEFAULT_GAME_FLAG, Dictionary, DimensionType, ECS, EffectAudioSourceProxy, EmptyAnalyticsSender, EmptyLink, EnterOptionParser, Event$2 as Event, EventDispatcher, Fsm, FsmBase, GameDimension, GameLeaveType, GeometryUtils, Handler, HttpNode, HttpRequest, IADAble, IDevice, IGameUpdateAble, ILoginAble, INTERNAL_METHODS, INativeHelper, IPayAble, IPublisher, IPublisherManager, IRecordAble, IShareAble, IViewLoader, Injector, Json, KKTServer, KSAd, KSDevice, KSLogin, KSPublisher, KSRecorder, KSShare, KeytopsAnalyticsSender, LEVEL_STATS_METRIC_ORDER_V1, LaunchAnalyticsAble, LevelAnalyticsAble, LevelBehaviorReporter, LevelOnlineConfig, LevelStatsDimension, Link, List, LogType, Logger, MYAd, MYDevice, MYLogin, MYPublisher, Mask, MathUtils, MemeryStorage, NativeAd, NativeAnalyticsSender, NativeDevice, NativeHelper, NativeLogin, NativePay, NativePublisher, NativeRecorder, NativeShare, NativeUtils, NetManager, NoRequestServer, PLAYER_ABILITY_METRIC_ORDER_V1, PlayerAbilityDimension, Pool, PromiseUtils, PropSupport, PublisherManager, RemoteConfigService, RemoteConfigStore, ResourceManager, RewardVideoMaskBusiness, RuntimeApplicationImpl, Scene, Server, SessionAnalyticsAble, SessionDimension, SocialAnalyticsAble, SocialDimension, Socket, SocketLogType, SocketNode, Storage, StorageImpl, StringUtils, System, SystemOnlineConfig, TKAd, TKAnalyticsSender, TKDevice, TKLogin, TKPublisher, TTAd, TTAnalyticsSender, TTDevice, TTGameUpdater, TTLogin, TTPay, TTPublisher, TTRecorder, TTShare, Task, TaskQueue, TaskSequence, Timer, TimerImpl, TipsType, TipsView, View, ViewControl, ViewLevel, ViewManager, WXAd, WXAnalyticsSender, WXDevice, WXGameUpdater, WXLogin, WXPay, WXPublisher, WXShare, ab, analytics, audio, bidding, businessCenter, cmd, component, eventCenter, fsmManager, manager, md5, net, publisher, remoteConfig, remoteConfigService, res, server, storage, system, timer, version, viewAnalytics, viewClass, viewManager };
15095
+ export { ADAnalyticsAble, ADBehaviorReporter, ADEvent, ADType, AD_METRIC_ORDER_V1, ALiAnalyticsSender, AdDimension, AnalyticsAble, App, Application, Async, AudioBusiness, BaseDimension, BaseOnlineConfig, BaseProtocolHelper, BusinessCenter, ByteView, CCPViewLoader, CCSceneLoader, CocosNativeHelper, CocosStorageUtils, CocosViewManager, Component, ConfigHelper, DEFAULT_GAME_FLAG, Dictionary, DimensionType, ECS, EffectAudioSourceProxy, EmptyAnalyticsSender, EmptyLink, EnterOptionParser, Event$2 as Event, EventDispatcher, Fsm, FsmBase, GameDimension, GameLeaveType, GeometryUtils, Handler, HttpNode, HttpRequest, IADAble, IDevice, IGameUpdateAble, ILoginAble, INTERNAL_METHODS, INativeHelper, IPayAble, IPublisher, IPublisherManager, IRecordAble, IShareAble, IViewLoader, Injector, Json, KKTServer, KSAd, KSDevice, KSLogin, KSPublisher, KSRecorder, KSShare, KeytopsAnalyticsSender, LEVEL_STATS_METRIC_ORDER_V1, LaunchAnalyticsAble, LevelAnalyticsAble, LevelBehaviorReporter, LevelOnlineConfig, LevelStatsDimension, Link, List, LogType, Logger, MYAd, MYDevice, MYLogin, MYPublisher, Mask, MathUtils, MemeryStorage, NativeAd, NativeAnalyticsSender, NativeDevice, NativeHelper, NativeLogin, NativePay, NativePublisher, NativeRecorder, NativeShare, NativeUtils, NetManager, NoRequestServer, PLAYER_ABILITY_METRIC_ORDER_V1, PlayerAbilityDimension, Pool, PromiseUtils, PropSupport, PublisherManager, RemoteConfigService, RemoteConfigStore, ResourceManager, RewardVideoMaskBusiness, RuntimeApplicationImpl, Scene, Server, SessionAnalyticsAble, SessionDimension, SocialAnalyticsAble, SocialDimension, Socket, SocketLogType, SocketNode, Storage, StorageImpl, StringUtils, System, SystemOnlineConfig, TKAd, TKAnalyticsSender, TKDevice, TKLogin, TKPublisher, TTAd, TTAnalyticsSender, TTDevice, TTGameUpdater, TTLogin, TTPay, TTPublisher, TTRecorder, TTShare, Task, TaskQueue, TaskSequence, Timer, TimerImpl, TipsType, TipsView, View, ViewControl, ViewLevel, ViewManager, WXAd, WXAnalyticsSender, WXDevice, WXGameUpdater, WXLogin, WXPay, WXPublisher, WXShare, ab, analytics, audio, bidding, businessCenter, cmd, component, eventCenter, fsmManager, manager, maskView, md5, net, publisher, remoteConfig, remoteConfigService, res, server, storage, system, timer, version, viewAnalytics, viewClass, viewManager };
@@ -55,6 +55,11 @@ export type CCPViewConfig = {
55
55
  * ```
56
56
  */
57
57
  export declare function viewClass(data: CCPViewConfig): any;
58
+ /**
59
+ * 注册closeTouch默认遮罩视图
60
+ * @param data 视图配置
61
+ */
62
+ export declare function maskView(data: CCPViewConfig): any;
58
63
  /**
59
64
  * cocos 默认视图加载器(Prefab)
60
65
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keytops-game-framework",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "cocos creator game framework library",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",