@chiyou/minigame-framework 1.0.0 → 1.0.2
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.
- package/assets/AssetsPackage/GUI/Images/Block.png +0 -0
- package/assets/AssetsPackage/GUI/Images/Block.png.meta +134 -0
- package/assets/AssetsPackage/GUI/Images.meta +9 -0
- package/assets/AssetsPackage/GUI/UIPrefabs/ChessBoard_Card.prefab +509 -0
- package/assets/AssetsPackage/GUI/UIPrefabs/ChessBoard_Card.prefab.meta +13 -0
- package/assets/AssetsPackage/GUI/UIPrefabs.meta +9 -0
- package/assets/AssetsPackage/GUI.meta +11 -0
- package/assets/AssetsPackage/SpriteAtlas/Card_Pattern.plist +1106 -0
- package/assets/AssetsPackage/SpriteAtlas/Card_Pattern.plist.meta +3329 -0
- package/assets/AssetsPackage/SpriteAtlas/Card_Pattern.png +0 -0
- package/assets/AssetsPackage/SpriteAtlas/Card_Pattern.png.meta +134 -0
- package/assets/AssetsPackage/SpriteAtlas/SA_Card.plist +1196 -0
- package/assets/AssetsPackage/SpriteAtlas/SA_Card.plist.meta +3605 -0
- package/assets/AssetsPackage/SpriteAtlas/SA_Card.png +0 -0
- package/assets/AssetsPackage/SpriteAtlas/SA_Card.png.meta +134 -0
- package/assets/AssetsPackage/SpriteAtlas.meta +11 -0
- package/assets/AssetsPackage/SpriteFrame/Card_PatternType_Back.png +0 -0
- package/assets/AssetsPackage/SpriteFrame/Card_PatternType_Back.png.meta +134 -0
- package/assets/AssetsPackage/SpriteFrame/Card_TowardType_Back_BG.png +0 -0
- package/assets/AssetsPackage/SpriteFrame/Card_TowardType_Back_BG.png.meta +134 -0
- package/assets/AssetsPackage/SpriteFrame/Card_TowardType_Back_FG.png +0 -0
- package/assets/AssetsPackage/SpriteFrame/Card_TowardType_Back_FG.png.meta +134 -0
- package/assets/AssetsPackage/SpriteFrame/Card_TowardType_Front_BG.png +0 -0
- package/assets/AssetsPackage/SpriteFrame/Card_TowardType_Front_BG.png.meta +134 -0
- package/assets/AssetsPackage/SpriteFrame/Card_TowardType_Front_FG.png +0 -0
- package/assets/AssetsPackage/SpriteFrame/Card_TowardType_Front_FG.png.meta +134 -0
- package/assets/AssetsPackage/SpriteFrame.meta +11 -0
- package/assets/AssetsPackage.meta +9 -0
- package/assets/Scenes/Game.scene +831 -0
- package/assets/Scenes/Game.scene.meta +11 -0
- package/assets/Scenes.meta +9 -0
- package/assets/Scripts/Biz.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AbsAdAdapter.ts +312 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AbsAdAdapter.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterBilibili.ts +294 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterBilibili.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterDouYin.ts +650 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterDouYin.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterHonor.ts +782 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterHonor.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterHuaWei.ts +582 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterHuaWei.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterJingDong.ts +298 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterJingDong.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterKuaiShou.ts +575 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterKuaiShou.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterOppo.ts +946 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterOppo.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterTapTap.ts +643 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterTapTap.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterVivo.ts +616 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterVivo.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterWeiXin.ts +847 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterWeiXin.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterXiaoMi.ts +747 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterXiaoMi.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterZhiFuBao.ts +579 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter/AdAdapterZhiFuBao.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/AdAdapter.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/AbsPlatformAdapter.ts +102 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/AbsPlatformAdapter.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterBilibili.ts +660 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterBilibili.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterDesktopBrowser.ts +224 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterDesktopBrowser.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterDouYin.ts +827 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterDouYin.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterHonor.ts +378 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterHonor.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterHuaWei.ts +363 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterHuaWei.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterJingDong.ts +368 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterJingDong.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterKuaiShou.ts +498 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterKuaiShou.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterOppo.ts +323 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterOppo.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterTapTap.ts +617 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterTapTap.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterVivo.ts +377 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterVivo.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterWeiXin.ts +1136 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterWeiXin.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterXiaoMi.ts +377 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterXiaoMi.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterZhiFuBao.ts +483 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter/PlatformAdapterZhiFuBao.ts.meta +9 -0
- package/assets/Scripts/Framework/Adapter/PlatformAdapter.meta +9 -0
- package/assets/Scripts/Framework/Adapter.meta +9 -0
- package/assets/Scripts/Framework/Definition/AdDefinition.ts +284 -0
- package/assets/Scripts/Framework/Definition/AdDefinition.ts.meta +9 -0
- package/assets/Scripts/Framework/Definition/FrameworkBase.ts +15 -0
- package/assets/Scripts/Framework/Definition/FrameworkBase.ts.meta +9 -0
- package/assets/Scripts/Framework/Definition/PrivacyDefinition.ts +95 -0
- package/assets/Scripts/Framework/Definition/PrivacyDefinition.ts.meta +9 -0
- package/assets/Scripts/Framework/Definition/SocialDefinition.ts +21 -0
- package/assets/Scripts/Framework/Definition/SocialDefinition.ts.meta +9 -0
- package/assets/Scripts/Framework/Definition/SystemDefinition.ts +58 -0
- package/assets/Scripts/Framework/Definition/SystemDefinition.ts.meta +9 -0
- package/assets/Scripts/Framework/Definition/UIDefinition.ts +10 -0
- package/assets/Scripts/Framework/Definition/UIDefinition.ts.meta +9 -0
- package/assets/Scripts/Framework/Definition/UserDefinition.ts +17 -0
- package/assets/Scripts/Framework/Definition/UserDefinition.ts.meta +9 -0
- package/assets/Scripts/Framework/Definition.meta +9 -0
- package/assets/Scripts/Framework/Manager/AdMgr.ts +812 -0
- package/assets/Scripts/Framework/Manager/AdMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager/AudioMgr.ts +296 -0
- package/assets/Scripts/Framework/Manager/AudioMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager/BaseMgr.ts +130 -0
- package/assets/Scripts/Framework/Manager/BaseMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager/EventMgr.ts +102 -0
- package/assets/Scripts/Framework/Manager/EventMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager/ExcelMgr.ts +188 -0
- package/assets/Scripts/Framework/Manager/ExcelMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager/LifeCycleMgr.ts +142 -0
- package/assets/Scripts/Framework/Manager/LifeCycleMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager/NodePoolMgr.ts +385 -0
- package/assets/Scripts/Framework/Manager/NodePoolMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager/PrivacyMgr.ts +189 -0
- package/assets/Scripts/Framework/Manager/PrivacyMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager/ResMgr.ts +420 -0
- package/assets/Scripts/Framework/Manager/ResMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager/SocialMgr.ts +250 -0
- package/assets/Scripts/Framework/Manager/SocialMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager/SystemMgr.ts +264 -0
- package/assets/Scripts/Framework/Manager/SystemMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager/TimerMgr.ts +80 -0
- package/assets/Scripts/Framework/Manager/TimerMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager/UIMgr.ts +267 -0
- package/assets/Scripts/Framework/Manager/UIMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager/UserMgr.ts +162 -0
- package/assets/Scripts/Framework/Manager/UserMgr.ts.meta +9 -0
- package/assets/Scripts/Framework/Manager.meta +9 -0
- package/assets/Scripts/Framework/Utils/BezierUtils.ts +273 -0
- package/assets/Scripts/Framework/Utils/BezierUtils.ts.meta +9 -0
- package/assets/Scripts/Framework/Utils/CSVUtils.ts +396 -0
- package/assets/Scripts/Framework/Utils/CSVUtils.ts.meta +9 -0
- package/assets/Scripts/Framework/Utils/LogUtils.ts +32 -0
- package/assets/Scripts/Framework/Utils/LogUtils.ts.meta +9 -0
- package/assets/Scripts/Framework/Utils/NumberUtils.ts +51 -0
- package/assets/Scripts/Framework/Utils/NumberUtils.ts.meta +9 -0
- package/assets/Scripts/Framework/Utils/TaskUtils.ts +27 -0
- package/assets/Scripts/Framework/Utils/TaskUtils.ts.meta +9 -0
- package/assets/Scripts/Framework/Utils/TimeUtils.ts +38 -0
- package/assets/Scripts/Framework/Utils/TimeUtils.ts.meta +9 -0
- package/assets/Scripts/Framework/Utils/WXBizDataCryptUtils.ts +54 -0
- package/assets/Scripts/Framework/Utils/WXBizDataCryptUtils.ts.meta +9 -0
- package/assets/Scripts/Framework/Utils.meta +9 -0
- package/assets/Scripts/Framework.meta +9 -0
- package/assets/Scripts/index.ts +39 -0
- package/assets/Scripts.meta +9 -0
- package/package.json +2 -4
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { PlatformID } from "./SystemDefinition";
|
|
2
|
+
|
|
3
|
+
export enum AdType {
|
|
4
|
+
Type_Banner = 0,
|
|
5
|
+
Type_Custom = 1,
|
|
6
|
+
Type_Interstitial = 2,
|
|
7
|
+
Type_RewardedVideo = 3,
|
|
8
|
+
Type_Portal = 4,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type InterstitialAd_Scene = string;
|
|
12
|
+
export type RewardedVideoAd_Scene = string;
|
|
13
|
+
|
|
14
|
+
export class AdCallback {
|
|
15
|
+
callback: Function;
|
|
16
|
+
target: any;
|
|
17
|
+
|
|
18
|
+
constructor(callback: Function, target: any) {
|
|
19
|
+
this.callback = callback;
|
|
20
|
+
this.target = target;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class RewardedVideoAd_Record {
|
|
25
|
+
clickCount: number;
|
|
26
|
+
viewCount: number;
|
|
27
|
+
completeCount: number;
|
|
28
|
+
giveupCount: number;
|
|
29
|
+
errorCount: number;
|
|
30
|
+
|
|
31
|
+
constructor() {
|
|
32
|
+
this.clickCount = 0;
|
|
33
|
+
this.viewCount = 0;
|
|
34
|
+
this.completeCount = 0;
|
|
35
|
+
this.giveupCount = 0;
|
|
36
|
+
this.errorCount = 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class InterstitialAd_Record {
|
|
41
|
+
viewCount: number;
|
|
42
|
+
completeCount: number;
|
|
43
|
+
errorCount: number;
|
|
44
|
+
|
|
45
|
+
constructor() {
|
|
46
|
+
this.viewCount = 0;
|
|
47
|
+
this.completeCount = 0;
|
|
48
|
+
this.errorCount = 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export class Ad_Record {
|
|
53
|
+
intersitialAdRecord: Map<InterstitialAd_Scene, InterstitialAd_Record>;
|
|
54
|
+
rewardedVideoAdRecord: Map<InterstitialAd_Scene, RewardedVideoAd_Record>;
|
|
55
|
+
|
|
56
|
+
constructor() {
|
|
57
|
+
this.intersitialAdRecord = new Map<InterstitialAd_Scene, InterstitialAd_Record>();
|
|
58
|
+
this.rewardedVideoAdRecord = new Map<InterstitialAd_Scene, RewardedVideoAd_Record>();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export enum InterstitialAd_Callback_Status {
|
|
63
|
+
Status_NotSupport = -2,
|
|
64
|
+
Status_Error = -1,
|
|
65
|
+
Status_Close = 0,
|
|
66
|
+
Status_Watching = 1,
|
|
67
|
+
Status_InsufficientInterval = 2,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export enum RewardedVideoAd_Callback_Status {
|
|
71
|
+
Status_NotSupport = -2,
|
|
72
|
+
Status_Error = -1,
|
|
73
|
+
Status_Complete = 0,
|
|
74
|
+
Status_Giveup = 1,
|
|
75
|
+
Status_Watching = 2,
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export enum AdSwitchType {
|
|
79
|
+
Off = 0,
|
|
80
|
+
On_Debug = 1,
|
|
81
|
+
On_Release = 2,
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type AdPlatformUnitInfo = {
|
|
85
|
+
switchType: AdSwitchType;
|
|
86
|
+
intersitialAd: string;
|
|
87
|
+
rewardedVideoAd: string;
|
|
88
|
+
bannerAd: string;
|
|
89
|
+
customAd: string;
|
|
90
|
+
portalAd: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type AdPlatformSettingInfo = {
|
|
94
|
+
launchNoAdInterval_permanentAd: number;
|
|
95
|
+
launchNoAdInterval_interstitialAd: number;
|
|
96
|
+
registerUser_interstitialAd_IntervalBase: number;
|
|
97
|
+
retainUser_interstitialAd_IntervalBase: number;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
//BannerAd
|
|
101
|
+
export enum BannerAd_XPosition {
|
|
102
|
+
Center = 0,
|
|
103
|
+
Left = 1,
|
|
104
|
+
Right = 2,
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export enum BannerAd_YPosition {
|
|
108
|
+
Center = 0,
|
|
109
|
+
Top = 1,
|
|
110
|
+
Bottom = 2,
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type BannerAd_Info = {
|
|
114
|
+
xPosition: BannerAd_XPosition;
|
|
115
|
+
yPosition: BannerAd_YPosition;
|
|
116
|
+
shouldShow: boolean;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export type BannerAd_PlatformInfo = {
|
|
120
|
+
xMargin: number;
|
|
121
|
+
yMargin: number;
|
|
122
|
+
width: number;
|
|
123
|
+
height: number;
|
|
124
|
+
scaleRatio: number;
|
|
125
|
+
canAutoRefresh: boolean;
|
|
126
|
+
refreshInterval: number;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// CustomAd
|
|
130
|
+
export enum CustomAd_XPosition {
|
|
131
|
+
Center = 0,
|
|
132
|
+
Left = 1,
|
|
133
|
+
Right = 2,
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export enum CustomAd_YPosition {
|
|
137
|
+
Center = 0,
|
|
138
|
+
Top = 1,
|
|
139
|
+
Bottom = 2,
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export type CustomAd_Info = {
|
|
143
|
+
xPostion: CustomAd_XPosition;
|
|
144
|
+
yPostion: CustomAd_YPosition;
|
|
145
|
+
shouldShow: boolean;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export type CustomAd_PlatformInfo = {
|
|
149
|
+
xMargin: number;
|
|
150
|
+
yMargin: number;
|
|
151
|
+
width: number;
|
|
152
|
+
height: number;
|
|
153
|
+
scaleRatio: number;
|
|
154
|
+
canAutoRefresh: boolean;
|
|
155
|
+
refreshInterval: number;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// PortalAd
|
|
159
|
+
export type PortalAd_PlatformInfo = {
|
|
160
|
+
width: number;
|
|
161
|
+
height: number;
|
|
162
|
+
scaleRatio: number;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export class AdDefinition {
|
|
166
|
+
static readonly AdInfoConfig = class {
|
|
167
|
+
static CustomAd_Info: CustomAd_Info = {
|
|
168
|
+
xPostion: CustomAd_XPosition.Center,
|
|
169
|
+
yPostion: CustomAd_YPosition.Top,
|
|
170
|
+
shouldShow: true,
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
static BannerAd_Info: BannerAd_Info = {
|
|
174
|
+
xPosition: BannerAd_XPosition.Center,
|
|
175
|
+
yPosition: BannerAd_YPosition.Bottom,
|
|
176
|
+
shouldShow: true,
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
static readonly CustomAdStyleConfig: Map<PlatformID, CustomAd_PlatformInfo> = new Map<PlatformID, CustomAd_PlatformInfo>([
|
|
181
|
+
[PlatformID.ID_MiniGame_WeiXin, {
|
|
182
|
+
xMargin: 0,
|
|
183
|
+
yMargin: 0,
|
|
184
|
+
width: 360,
|
|
185
|
+
height: 106,
|
|
186
|
+
scaleRatio: 0.8,
|
|
187
|
+
canAutoRefresh: true,
|
|
188
|
+
refreshInterval: 30,
|
|
189
|
+
}],
|
|
190
|
+
]);
|
|
191
|
+
|
|
192
|
+
static readonly BannerAdStyleConfig: Map<PlatformID, BannerAd_PlatformInfo> = new Map<PlatformID, BannerAd_PlatformInfo>([
|
|
193
|
+
[PlatformID.ID_MiniGame_WeiXin, {
|
|
194
|
+
xMargin: 0,
|
|
195
|
+
yMargin: 0,
|
|
196
|
+
width: 300,
|
|
197
|
+
height: 99.2,
|
|
198
|
+
scaleRatio: 1,
|
|
199
|
+
canAutoRefresh: false,
|
|
200
|
+
refreshInterval: 30,
|
|
201
|
+
}],
|
|
202
|
+
[PlatformID.ID_MiniGame_KuaiShou, {
|
|
203
|
+
xMargin: 4,
|
|
204
|
+
yMargin: 4,
|
|
205
|
+
width: 308,
|
|
206
|
+
height: 76,
|
|
207
|
+
scaleRatio: 1,
|
|
208
|
+
canAutoRefresh: true,
|
|
209
|
+
refreshInterval: 30,
|
|
210
|
+
}],
|
|
211
|
+
[PlatformID.ID_MiniGame_TapTap, {
|
|
212
|
+
xMargin: 0,
|
|
213
|
+
yMargin: 0,
|
|
214
|
+
width: 300,
|
|
215
|
+
height: 105,
|
|
216
|
+
scaleRatio: 1,
|
|
217
|
+
canAutoRefresh: true,
|
|
218
|
+
refreshInterval: 30,
|
|
219
|
+
}],
|
|
220
|
+
[PlatformID.ID_QuickGame_XiaoMi, {
|
|
221
|
+
xMargin: 0,
|
|
222
|
+
yMargin: 0,
|
|
223
|
+
width: 314,
|
|
224
|
+
height: 91,
|
|
225
|
+
scaleRatio: 1,
|
|
226
|
+
canAutoRefresh: true,
|
|
227
|
+
refreshInterval: 30,
|
|
228
|
+
}],
|
|
229
|
+
[PlatformID.ID_QuickGame_Oppo, {
|
|
230
|
+
xMargin: 0,
|
|
231
|
+
yMargin: 0,
|
|
232
|
+
width: 1000,
|
|
233
|
+
height: 340,
|
|
234
|
+
scaleRatio: 0,
|
|
235
|
+
canAutoRefresh: false,
|
|
236
|
+
refreshInterval: 45,
|
|
237
|
+
}],
|
|
238
|
+
[PlatformID.ID_QuickGame_Vivo, {
|
|
239
|
+
xMargin: 0,
|
|
240
|
+
yMargin: 0,
|
|
241
|
+
width: 720,
|
|
242
|
+
height: 113,
|
|
243
|
+
scaleRatio: 1,
|
|
244
|
+
canAutoRefresh: true,
|
|
245
|
+
refreshInterval: 30,
|
|
246
|
+
}],
|
|
247
|
+
[PlatformID.ID_QuickGame_Honor, {
|
|
248
|
+
xMargin: 0,
|
|
249
|
+
yMargin: 0,
|
|
250
|
+
width: 600,
|
|
251
|
+
height: 120,
|
|
252
|
+
scaleRatio: 1,
|
|
253
|
+
canAutoRefresh: false,
|
|
254
|
+
refreshInterval: 30,
|
|
255
|
+
}],
|
|
256
|
+
[PlatformID.ID_QuickGame_HuaWei, {
|
|
257
|
+
xMargin: 0,
|
|
258
|
+
yMargin: 0,
|
|
259
|
+
width: 360,
|
|
260
|
+
height: 57,
|
|
261
|
+
scaleRatio: 1,
|
|
262
|
+
canAutoRefresh: true,
|
|
263
|
+
refreshInterval: 30,
|
|
264
|
+
}],
|
|
265
|
+
]);
|
|
266
|
+
|
|
267
|
+
static readonly PortalAdStyleConfig: Map<PlatformID, PortalAd_PlatformInfo> = new Map<PlatformID, PortalAd_PlatformInfo>([
|
|
268
|
+
[PlatformID.ID_MiniGame_WeiXin, {
|
|
269
|
+
width: 360,
|
|
270
|
+
height: 434,
|
|
271
|
+
scaleRatio: 0.8,
|
|
272
|
+
}],
|
|
273
|
+
[PlatformID.ID_QuickGame_Oppo, {
|
|
274
|
+
width: 0,
|
|
275
|
+
height: 0,
|
|
276
|
+
scaleRatio: 1.0,
|
|
277
|
+
}],
|
|
278
|
+
[PlatformID.ID_QuickGame_Honor, {
|
|
279
|
+
width: 0,
|
|
280
|
+
height: 0,
|
|
281
|
+
scaleRatio: 1.0,
|
|
282
|
+
}],
|
|
283
|
+
]);
|
|
284
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class FrameworkBase {
|
|
2
|
+
|
|
3
|
+
static readonly LocalStorage = class {
|
|
4
|
+
static readonly Key_AudioMgr_EffectSwitch = "AudioMgr_EffectSwitch";
|
|
5
|
+
static readonly Key_AudioMgr_MusicSwitch = "AudioMgr_MusicSwitch";
|
|
6
|
+
static readonly Key_Settings_EffectSwitch: string = "Settings_EffectSwitch"; // old key
|
|
7
|
+
static readonly Key_Settings_MusicSwitch: string = "Settings_MusicSwitch"; // old key
|
|
8
|
+
|
|
9
|
+
static readonly Key_UserMgr_NewUser = "UserMgr_NewUser";
|
|
10
|
+
static readonly Key_UserInfo_NewUser = "UserInfo_NewUser"; //old key
|
|
11
|
+
|
|
12
|
+
static readonly Key_PrivacyManager_KindReminder_AgreeVersion: string = "PrivacyManager_KindReminder_AgreeVersion";
|
|
13
|
+
static readonly Key_KindReminder_AgreeVersion: string = "KindReminder_AgreeVersion"; // old key
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { PlatformID } from "./SystemDefinition";
|
|
2
|
+
|
|
3
|
+
export enum PrivacyType {
|
|
4
|
+
PrivacyType_FriendInteraction = 1,
|
|
5
|
+
PrivacyType_GameClub = 2,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export enum QueryPrivacyResult {
|
|
9
|
+
Result_Invalid = 0,
|
|
10
|
+
Result_Agree = 1,
|
|
11
|
+
Result_Continue = 2, // 部分平台不支持授权权限,直接调用具体行为方法
|
|
12
|
+
Result_PrivacyReject = 3,
|
|
13
|
+
Result_ScopeDisable = 4,
|
|
14
|
+
Result_AuthorizeReject = 5,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum GetSettingResult {
|
|
18
|
+
Result_SettingNotAvailable = -2, // -2 无设置
|
|
19
|
+
Result_Rejected = -1, // -1 表示已拒绝,引导在设置里打开
|
|
20
|
+
Result_NotExist_AuthorizeAvailable = 0, // 0 表示不存在(历史未操作过),执行authorize
|
|
21
|
+
Result_Authorized = 1, // 1 表示已授权,成功
|
|
22
|
+
Result_NotExist_AuthorizeNotAvailable = 2, // 2 表示不存在(历史未操作过),无authorize,直接调用操作
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export enum AuthorizeResult {
|
|
26
|
+
Result_AuthorizeNotAvailable = -1, // -1 无授权
|
|
27
|
+
Result_Rejected = 0, // 0 已拒绝
|
|
28
|
+
Result_Authorized = 1, // 1 已授权,成功
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type PrivacyInfo = {
|
|
32
|
+
privacyPlatformMap: Map<PlatformID, PrivacyPlatformInfo>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type PrivacyPlatformInfo = {
|
|
36
|
+
scopeDescription: string,
|
|
37
|
+
scopeDisable: boolean,
|
|
38
|
+
needAuthorize: boolean,
|
|
39
|
+
scopeName: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export enum KindReminderType {
|
|
43
|
+
Type_UserAgreement = 1,
|
|
44
|
+
Type_PrivacyPolicy = 2,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type KindRemindItemContent = {
|
|
48
|
+
mainContent: string[][];
|
|
49
|
+
supplementaryContent: Map<PlatformID, string[][]>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type KindReminder = {
|
|
53
|
+
latestVersion: string;
|
|
54
|
+
shouldShowPlatform: Set<PlatformID>;
|
|
55
|
+
userAgreement: KindRemindItemContent;
|
|
56
|
+
privacyPolicy: KindRemindItemContent;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export class PrivacyDefinition {
|
|
60
|
+
|
|
61
|
+
static readonly PrivacyConfig: Map<PrivacyType, PrivacyInfo> = new Map<PrivacyType, PrivacyInfo>([
|
|
62
|
+
[PrivacyType.PrivacyType_FriendInteraction, {
|
|
63
|
+
privacyPlatformMap: new Map([
|
|
64
|
+
[PlatformID.ID_H5_DesktopBrowser, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
65
|
+
[PlatformID.ID_MiniGame_WeiXin, { scopeDescription: "用户信息", scopeDisable: false, needAuthorize: false, scopeName: "scope.WxFriendInteraction" }],
|
|
66
|
+
[PlatformID.ID_MiniGame_DouYin, { scopeDescription: "用户信息", scopeDisable: false, needAuthorize: false, scopeName: "" }],
|
|
67
|
+
[PlatformID.ID_MiniGame_KuaiShou, { scopeDescription: "用户信息", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
68
|
+
[PlatformID.ID_MiniGame_ZhiFuBao, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
69
|
+
[PlatformID.ID_MiniGame_Bilibili, { scopeDescription: "用户信息", scopeDisable: false, needAuthorize: false, scopeName: "" }],
|
|
70
|
+
[PlatformID.ID_MiniGame_TapTap, { scopeDescription: "用户信息", scopeDisable: false, needAuthorize: true, scopeName: "scope.friendInteraction" }],
|
|
71
|
+
[PlatformID.ID_MiniGame_JingDong, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
72
|
+
[PlatformID.ID_QuickGame_XiaoMi, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
73
|
+
[PlatformID.ID_QuickGame_Oppo, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
74
|
+
[PlatformID.ID_QuickGame_Honor, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
75
|
+
[PlatformID.ID_QuickGame_Vivo, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
76
|
+
]),
|
|
77
|
+
}],
|
|
78
|
+
[PrivacyType.PrivacyType_GameClub, {
|
|
79
|
+
privacyPlatformMap: new Map([
|
|
80
|
+
[PlatformID.ID_H5_DesktopBrowser, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
81
|
+
[PlatformID.ID_MiniGame_WeiXin, { scopeDescription: "游戏圈数据", scopeDisable: false, needAuthorize: true, scopeName: "scope.gameClubData" }],
|
|
82
|
+
[PlatformID.ID_MiniGame_DouYin, { scopeDescription: "游戏站数据", scopeDisable: false, needAuthorize: true, scopeName: "scope.gameClub" }],
|
|
83
|
+
[PlatformID.ID_MiniGame_KuaiShou, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
84
|
+
[PlatformID.ID_MiniGame_ZhiFuBao, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
85
|
+
[PlatformID.ID_MiniGame_Bilibili, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
86
|
+
[PlatformID.ID_MiniGame_TapTap, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
87
|
+
[PlatformID.ID_MiniGame_JingDong, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
88
|
+
[PlatformID.ID_QuickGame_XiaoMi, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
89
|
+
[PlatformID.ID_QuickGame_Oppo, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
90
|
+
[PlatformID.ID_QuickGame_Honor, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
91
|
+
[PlatformID.ID_QuickGame_Vivo, { scopeDescription: "", scopeDisable: true, needAuthorize: false, scopeName: "" }],
|
|
92
|
+
]),
|
|
93
|
+
}],
|
|
94
|
+
]);
|
|
95
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PlatformID } from "./SystemDefinition";
|
|
2
|
+
|
|
3
|
+
export type ShareDefaultInfo = {
|
|
4
|
+
title: string;
|
|
5
|
+
desc: string;
|
|
6
|
+
imageUrl: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type ShareTemplateInfo = {
|
|
10
|
+
templateId: string;
|
|
11
|
+
imageUrl: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type ShareInfo = {
|
|
15
|
+
defaultInfo: ShareDefaultInfo;
|
|
16
|
+
templateInfoMap: Map<PlatformID, ShareTemplateInfo>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class SocialDefinition {
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export enum PlatformID {
|
|
2
|
+
ID_UNKNOWN = -1,
|
|
3
|
+
ID_H5_DesktopBrowser = 0, //DESKTOP_BROWSER
|
|
4
|
+
|
|
5
|
+
ID_MiniGame_WeiXin = 1, //WECHAT_GAME
|
|
6
|
+
ID_MiniGame_DouYin = 2, //BYTEDANCE_MINI_GAME
|
|
7
|
+
ID_MiniGame_KuaiShou = 3, //Transfer From WECHAT_GAME
|
|
8
|
+
ID_MiniGame_QQ = 4, //Transfer From WECHAT_GAME
|
|
9
|
+
ID_MiniGame_ZhiFuBao = 5, //ALIPAY_MINI_GAME
|
|
10
|
+
ID_MiniGame_Bilibili = 6, //Transfer From WECHAT_GAME
|
|
11
|
+
ID_MiniGame_TapTap = 7, //Transfer From WECHAT_GAME
|
|
12
|
+
ID_MiniGame_JingDong = 8, //Transfer From WECHAT_GAME
|
|
13
|
+
|
|
14
|
+
ID_QuickGame_XiaoMi = 101, //XIAOMI_QUICK_GAME
|
|
15
|
+
ID_QuickGame_Oppo = 102, //OPPO_MINI_GAME
|
|
16
|
+
ID_QuickGame_Honor = 103, //HONOR_MINI_GAME
|
|
17
|
+
ID_QuickGame_Vivo = 104, //VIVO_MINI_GAME
|
|
18
|
+
ID_QuickGame_HuaWei = 105, //HUAWEI_QUICK_GAME
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type AppItem = {
|
|
22
|
+
appIndex: number;
|
|
23
|
+
appName: string;
|
|
24
|
+
appLogo_SpriteAtlas: string;
|
|
25
|
+
appLogo_SpriteFrame: string;
|
|
26
|
+
appIDMap: Map<PlatformID, string>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export class ScreenInfo {
|
|
30
|
+
windowWidth: number;
|
|
31
|
+
windowHeight: number;
|
|
32
|
+
screenWidth: number;
|
|
33
|
+
screenHeight: number;
|
|
34
|
+
|
|
35
|
+
constructor(windowWidth: number, windowHeight: number, screenWidth: number, screenHeight: number) {
|
|
36
|
+
this.windowWidth = windowWidth;
|
|
37
|
+
this.windowHeight = windowHeight;
|
|
38
|
+
this.screenWidth = screenWidth;
|
|
39
|
+
this.screenHeight = screenHeight;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type ICPItem = {
|
|
44
|
+
icpSubject: string;
|
|
45
|
+
icpNumber: string;
|
|
46
|
+
isLocalGame: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type CopyrightInfo = {
|
|
50
|
+
copyrightSubject: string;
|
|
51
|
+
copyrightNumber: string;
|
|
52
|
+
icpMap: Map<PlatformID, ICPItem>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export class SystemDefinition {
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export enum LoginResultType {
|
|
2
|
+
Type_SessionAvailable = 0,
|
|
3
|
+
Type_LoginSuccess_Auth_Code = 1,
|
|
4
|
+
Type_LoginSuccess_Auth_AccountID = 2,
|
|
5
|
+
Type_LoginFail_ContinueGame = 3,
|
|
6
|
+
Type_LoginFail_ExitGame = 4,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type LoginResult = {
|
|
10
|
+
type: LoginResultType;
|
|
11
|
+
code: string;
|
|
12
|
+
accountId: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class UserDefinition {
|
|
16
|
+
|
|
17
|
+
}
|