@babylonjs-toolkit/next 9.9.1 → 9.9.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/README.md +5 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/scenemanager.d.ts +3 -0
- package/lib/scenemanager.d.ts.map +1 -1
- package/lib/scenemanager.js +10549 -4
- package/lib/windowsplatform.d.ts +17 -0
- package/lib/windowsplatform.d.ts.map +1 -0
- package/lib/windowsplatform.js +133 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PlayerNumber } from './scenemanager';
|
|
2
|
+
export declare class WindowsPlatform {
|
|
3
|
+
static IsXboxLiveUserSignedIn(systemUser?: Windows.System.User, player?: PlayerNumber): boolean;
|
|
4
|
+
static XboxLiveUserSignIn(player?: PlayerNumber, oncomplete?: (result: Microsoft.Xbox.Services.System.SignInResult) => void, onerror?: (error: any) => void, onprogress?: (progress: any) => void): void;
|
|
5
|
+
static XboxLiveUserSilentSignIn(player?: PlayerNumber, oncomplete?: (result: Microsoft.Xbox.Services.System.SignInResult) => void, onerror?: (error: any) => void, onprogress?: (progress: any) => void): Windows.Foundation.Projections.Promise<void>;
|
|
6
|
+
static XboxLiveUserDialogSignIn(player?: PlayerNumber, oncomplete?: (result: Microsoft.Xbox.Services.System.SignInResult) => void, onerror?: (error: any) => void, onprogress?: (progress: any) => void): Windows.Foundation.Projections.Promise<void>;
|
|
7
|
+
static LoadXboxLiveUserProfile(player?: PlayerNumber, oncomplete?: (result: Microsoft.Xbox.Services.Social.XboxUserProfile) => void, onerror?: (error: any) => void, onprogress?: (progress: any) => void): Windows.Foundation.Projections.Promise<void>;
|
|
8
|
+
static GetXboxLiveUser(player?: PlayerNumber): Microsoft.Xbox.Services.System.XboxLiveUser;
|
|
9
|
+
static GetXboxLiveSystemUser(systemUser: Windows.System.User, player?: PlayerNumber): Microsoft.Xbox.Services.System.XboxLiveUser;
|
|
10
|
+
static GetXboxLiveUserContext(player?: PlayerNumber): Microsoft.Xbox.Services.XboxLiveContext;
|
|
11
|
+
static ResetXboxLiveUserContext(player?: PlayerNumber): void;
|
|
12
|
+
static GetXboxLiveContextProperty(name: any): any;
|
|
13
|
+
static SetXboxLiveContextProperty(name: any, property: any): void;
|
|
14
|
+
static ResetXboxLivePropertyContexts(): void;
|
|
15
|
+
static SetXboxLiveSignOutHandler(handler?: (result: Microsoft.Xbox.Services.System.SignOutCompletedEventArgs) => void): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=windowsplatform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windowsplatform.d.ts","sourceRoot":"","sources":["../src/windowsplatform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAyB,MAAM,gBAAgB,CAAC;AAGrE,qBAAa,eAAe;WAEN,sBAAsB,CAAC,UAAU,GAAE,OAAO,CAAC,MAAM,CAAC,IAAW,EAAE,MAAM,GAAE,YAA+B,GAAG,OAAO;WAShH,kBAAkB,CAAC,MAAM,GAAE,YAA+B,EAAE,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;WAcnN,wBAAwB,CAAC,MAAM,GAAE,YAA+B,EAAE,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAA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AAG,EAAE,QAAQ,EAAE,GAAG,GAAG,IAAI;WAM1D,6BAA6B,IAAI,IAAI;WAWrC,yBAAyB,CAAC,OAAO,GAAE,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,yBAAyB,KAAK,IAAW,GAAG,IAAI;CAK5I"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { PlayerNumber, WindowManager } from './scenemanager';
|
|
2
|
+
export class WindowsPlatform {
|
|
3
|
+
static IsXboxLiveUserSignedIn(systemUser = null, player = PlayerNumber.One) {
|
|
4
|
+
if (WindowManager.IsWindows()) {
|
|
5
|
+
let user = (systemUser != null) ? WindowsPlatform.GetXboxLiveSystemUser(systemUser, player) : WindowsPlatform.GetXboxLiveUser(player);
|
|
6
|
+
return (user != null && user.isSignedIn == true);
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
static XboxLiveUserSignIn(player = PlayerNumber.One, oncomplete, onerror, onprogress) {
|
|
13
|
+
if (WindowManager.IsWindows()) {
|
|
14
|
+
WindowsPlatform.XboxLiveUserSilentSignIn(player, (first) => {
|
|
15
|
+
if (first.status === Microsoft.Xbox.Services.System.SignInStatus.userInteractionRequired) {
|
|
16
|
+
WindowsPlatform.XboxLiveUserDialogSignIn(player, (second) => {
|
|
17
|
+
if (oncomplete)
|
|
18
|
+
oncomplete(second);
|
|
19
|
+
}, onerror, onprogress);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
if (oncomplete)
|
|
23
|
+
oncomplete(first);
|
|
24
|
+
}
|
|
25
|
+
}, onerror, onprogress);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
static XboxLiveUserSilentSignIn(player = PlayerNumber.One, oncomplete, onerror, onprogress) {
|
|
29
|
+
return (WindowManager.IsWindows()) ? WindowsPlatform.GetXboxLiveUser(player).signInSilentlyAsync(null).then(oncomplete, onerror, onprogress) : null;
|
|
30
|
+
}
|
|
31
|
+
static XboxLiveUserDialogSignIn(player = PlayerNumber.One, oncomplete, onerror, onprogress) {
|
|
32
|
+
return (WindowManager.IsWindows()) ? WindowsPlatform.GetXboxLiveUser(player).signInAsync(null).then(oncomplete, onerror, onprogress) : null;
|
|
33
|
+
}
|
|
34
|
+
static LoadXboxLiveUserProfile(player = PlayerNumber.One, oncomplete, onerror, onprogress) {
|
|
35
|
+
return (WindowManager.IsWindows()) ? WindowsPlatform.GetXboxLiveUserContext(player).profileService.getUserProfileAsync(WindowsPlatform.GetXboxLiveUser(player).xboxUserId).then(oncomplete, onerror, onprogress) : null;
|
|
36
|
+
}
|
|
37
|
+
static GetXboxLiveUser(player = PlayerNumber.One) {
|
|
38
|
+
let user = null;
|
|
39
|
+
if (WindowManager.IsWindows()) {
|
|
40
|
+
switch (player) {
|
|
41
|
+
case PlayerNumber.One:
|
|
42
|
+
user = window.BabylonToolkit.XboxLive.Plugin.getXboxLiveUserOne();
|
|
43
|
+
break;
|
|
44
|
+
case PlayerNumber.Two:
|
|
45
|
+
user = window.BabylonToolkit.XboxLive.Plugin.getXboxLiveUserTwo();
|
|
46
|
+
break;
|
|
47
|
+
case PlayerNumber.Three:
|
|
48
|
+
user = window.BabylonToolkit.XboxLive.Plugin.getXboxLiveUserThree();
|
|
49
|
+
break;
|
|
50
|
+
case PlayerNumber.Four:
|
|
51
|
+
user = window.BabylonToolkit.XboxLive.Plugin.getXboxLiveUserFour();
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return user;
|
|
56
|
+
}
|
|
57
|
+
static GetXboxLiveSystemUser(systemUser, player = PlayerNumber.One) {
|
|
58
|
+
let user = null;
|
|
59
|
+
if (WindowManager.IsWindows()) {
|
|
60
|
+
switch (player) {
|
|
61
|
+
case PlayerNumber.One:
|
|
62
|
+
user = window.BabylonToolkit.XboxLive.Plugin.getXboxLiveSystemUserOne(systemUser);
|
|
63
|
+
break;
|
|
64
|
+
case PlayerNumber.Two:
|
|
65
|
+
user = window.BabylonToolkit.XboxLive.Plugin.getXboxLiveSystemUserTwo(systemUser);
|
|
66
|
+
break;
|
|
67
|
+
case PlayerNumber.Three:
|
|
68
|
+
user = window.BabylonToolkit.XboxLive.Plugin.getXboxLiveSystemUserThree(systemUser);
|
|
69
|
+
break;
|
|
70
|
+
case PlayerNumber.Four:
|
|
71
|
+
user = window.BabylonToolkit.XboxLive.Plugin.getXboxLiveSystemUserFour(systemUser);
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return user;
|
|
76
|
+
}
|
|
77
|
+
static GetXboxLiveUserContext(player = PlayerNumber.One) {
|
|
78
|
+
let context = null;
|
|
79
|
+
if (WindowManager.IsWindows()) {
|
|
80
|
+
switch (player) {
|
|
81
|
+
case PlayerNumber.One:
|
|
82
|
+
context = window.BabylonToolkit.XboxLive.Plugin.getXboxLiveContextOne();
|
|
83
|
+
break;
|
|
84
|
+
case PlayerNumber.Two:
|
|
85
|
+
context = window.BabylonToolkit.XboxLive.Plugin.getXboxLiveContextTwo();
|
|
86
|
+
break;
|
|
87
|
+
case PlayerNumber.Three:
|
|
88
|
+
context = window.BabylonToolkit.XboxLive.Plugin.getXboxLiveContextThree();
|
|
89
|
+
break;
|
|
90
|
+
case PlayerNumber.Four:
|
|
91
|
+
context = window.BabylonToolkit.XboxLive.Plugin.getXboxLiveContextFour();
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return context;
|
|
96
|
+
}
|
|
97
|
+
static ResetXboxLiveUserContext(player = PlayerNumber.One) {
|
|
98
|
+
if (WindowManager.IsWindows()) {
|
|
99
|
+
switch (player) {
|
|
100
|
+
case PlayerNumber.One:
|
|
101
|
+
window.BabylonToolkit.XboxLive.Plugin.resetXboxLiveUserContextOne();
|
|
102
|
+
break;
|
|
103
|
+
case PlayerNumber.Two:
|
|
104
|
+
window.BabylonToolkit.XboxLive.Plugin.resetXboxLiveUserContextTwo();
|
|
105
|
+
break;
|
|
106
|
+
case PlayerNumber.Three:
|
|
107
|
+
window.BabylonToolkit.XboxLive.Plugin.resetXboxLiveUserContextThree();
|
|
108
|
+
break;
|
|
109
|
+
case PlayerNumber.Four:
|
|
110
|
+
window.BabylonToolkit.XboxLive.Plugin.resetXboxLiveUserContextFour();
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
static GetXboxLiveContextProperty(name) {
|
|
116
|
+
return (WindowManager.IsWindows()) ? window.BabylonToolkit.XboxLive.Plugin.getXboxLiveContextProperty(name) : null;
|
|
117
|
+
}
|
|
118
|
+
static SetXboxLiveContextProperty(name, property) {
|
|
119
|
+
if (WindowManager.IsWindows()) {
|
|
120
|
+
window.BabylonToolkit.XboxLive.Plugin.setXboxLiveContextProperty(name, property);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
static ResetXboxLivePropertyContexts() {
|
|
124
|
+
if (WindowManager.IsWindows()) {
|
|
125
|
+
window.BabylonToolkit.XboxLive.Plugin.resetXboxLivePropertyContexts();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
static SetXboxLiveSignOutHandler(handler = null) {
|
|
129
|
+
if (WindowManager.IsWindows()) {
|
|
130
|
+
window.BabylonToolkit.XboxLive.Plugin.onusersignout = handler;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|