pxt-arcade 2.0.52 → 2.0.54
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/built/common-sim.d.ts +4 -0
- package/built/common-sim.js +14 -3
- package/built/sim.js +15 -26
- package/built/target.js +1 -1
- package/built/target.json +1 -1
- package/built/targetlight.js +1 -1
- package/built/targetlight.json +1 -1
- package/package.json +4 -4
package/built/common-sim.d.ts
CHANGED
|
@@ -356,6 +356,10 @@ declare namespace pxsim.browserEvents {
|
|
|
356
356
|
interface BrowserEventsBoard extends CommonBoard {
|
|
357
357
|
mouseState: MouseState;
|
|
358
358
|
}
|
|
359
|
+
const INTERNAL_KEY_DOWN = 6870;
|
|
360
|
+
const INTERNAL_KEY_UP = 6871;
|
|
361
|
+
const INTERNAL_POINTER_DOWN = 6868;
|
|
362
|
+
const INTERNAL_POINTER_UP = 6869;
|
|
359
363
|
type MouseEvent = "pointerdown" | "pointerup" | "pointermove" | "pointerleave" | "pointerenter" | "pointercancel" | "pointerover" | "pointerout";
|
|
360
364
|
class MouseState {
|
|
361
365
|
protected x: number;
|
package/built/common-sim.js
CHANGED
|
@@ -843,10 +843,10 @@ var pxsim;
|
|
|
843
843
|
browserEvents.onKeyboardEvent = onKeyboardEvent;
|
|
844
844
|
function fireEvent(key, pressed) {
|
|
845
845
|
if (pressed) {
|
|
846
|
-
pxsim.board().bus.queue(
|
|
846
|
+
pxsim.board().bus.queue(browserEvents.INTERNAL_KEY_DOWN, key);
|
|
847
847
|
}
|
|
848
848
|
else {
|
|
849
|
-
pxsim.board().bus.queue(
|
|
849
|
+
pxsim.board().bus.queue(browserEvents.INTERNAL_KEY_UP, key);
|
|
850
850
|
}
|
|
851
851
|
}
|
|
852
852
|
function getValueForKey(event) {
|
|
@@ -1040,6 +1040,10 @@ var pxsim;
|
|
|
1040
1040
|
var browserEvents;
|
|
1041
1041
|
(function (browserEvents) {
|
|
1042
1042
|
const THROTTLE_INTERVAL = 50;
|
|
1043
|
+
browserEvents.INTERNAL_KEY_DOWN = 6870;
|
|
1044
|
+
browserEvents.INTERNAL_KEY_UP = 6871;
|
|
1045
|
+
browserEvents.INTERNAL_POINTER_DOWN = 6868;
|
|
1046
|
+
browserEvents.INTERNAL_POINTER_UP = 6869;
|
|
1043
1047
|
class MouseState {
|
|
1044
1048
|
constructor() {
|
|
1045
1049
|
this.onMove = pxsim.U.throttle(() => {
|
|
@@ -1062,9 +1066,16 @@ var pxsim;
|
|
|
1062
1066
|
"pointerover",
|
|
1063
1067
|
"pointerout",
|
|
1064
1068
|
];
|
|
1069
|
+
let eventId = 6857 + events.indexOf(event.type);
|
|
1070
|
+
if (event.type === "pointerdown") {
|
|
1071
|
+
eventId = browserEvents.INTERNAL_POINTER_DOWN;
|
|
1072
|
+
}
|
|
1073
|
+
else if (event.type === "pointerup") {
|
|
1074
|
+
eventId = browserEvents.INTERNAL_POINTER_UP;
|
|
1075
|
+
}
|
|
1065
1076
|
// We add 1 to the button here because the left button is 0 and
|
|
1066
1077
|
// that's used as a wildcard in our event bus
|
|
1067
|
-
pxsim.board().bus.queue(
|
|
1078
|
+
pxsim.board().bus.queue(eventId, (event.button || 0) + 1);
|
|
1068
1079
|
}
|
|
1069
1080
|
onWheelEvent(dx, dy, dz) {
|
|
1070
1081
|
this.dx = dx;
|
package/built/sim.js
CHANGED
|
@@ -696,10 +696,8 @@ var pxsim;
|
|
|
696
696
|
}
|
|
697
697
|
kill() {
|
|
698
698
|
super.kill();
|
|
699
|
-
if (this.gameplayer)
|
|
700
|
-
this.gameplayer.setCursorVisible(true);
|
|
699
|
+
if (this.gameplayer)
|
|
701
700
|
this.gameplayer.dispose();
|
|
702
|
-
}
|
|
703
701
|
pxsim.Keyboard.cancelTextPrompt();
|
|
704
702
|
}
|
|
705
703
|
}
|
|
@@ -778,15 +776,6 @@ function isSafari() {
|
|
|
778
776
|
ButtonMethods.id = id;
|
|
779
777
|
})(ButtonMethods = pxsim.ButtonMethods || (pxsim.ButtonMethods = {}));
|
|
780
778
|
})(pxsim || (pxsim = {}));
|
|
781
|
-
(function (pxsim) {
|
|
782
|
-
var browserEvents;
|
|
783
|
-
(function (browserEvents) {
|
|
784
|
-
function _setCursorVisible(visible) {
|
|
785
|
-
pxsim.board().gameplayer.setCursorVisible(visible);
|
|
786
|
-
}
|
|
787
|
-
browserEvents._setCursorVisible = _setCursorVisible;
|
|
788
|
-
})(browserEvents = pxsim.browserEvents || (pxsim.browserEvents = {}));
|
|
789
|
-
})(pxsim || (pxsim = {}));
|
|
790
779
|
var pxsim;
|
|
791
780
|
(function (pxsim) {
|
|
792
781
|
var Keyboard;
|
|
@@ -1363,7 +1352,6 @@ var pxsim;
|
|
|
1363
1352
|
visuals.releaseButton(pxsim.Key.Reset);
|
|
1364
1353
|
};
|
|
1365
1354
|
}
|
|
1366
|
-
this.setCursorVisible(true);
|
|
1367
1355
|
}
|
|
1368
1356
|
buttonChanged(button, isPressed) {
|
|
1369
1357
|
this.joystick.buttonChanged(button, isPressed);
|
|
@@ -1435,16 +1423,6 @@ var pxsim;
|
|
|
1435
1423
|
this.reset && this.reset.setAttribute("aria-disabled", "true");
|
|
1436
1424
|
}
|
|
1437
1425
|
}
|
|
1438
|
-
setCursorVisible(visible) {
|
|
1439
|
-
if (!this.screen)
|
|
1440
|
-
return;
|
|
1441
|
-
if (visible) {
|
|
1442
|
-
this.screen.style.cursor = "unset";
|
|
1443
|
-
}
|
|
1444
|
-
else {
|
|
1445
|
-
this.screen.style.cursor = "none";
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
1426
|
}
|
|
1449
1427
|
visuals.GamePlayer = GamePlayer;
|
|
1450
1428
|
})(visuals = pxsim.visuals || (pxsim.visuals = {}));
|
|
@@ -4599,10 +4577,10 @@ var pxsim;
|
|
|
4599
4577
|
browserEvents.onKeyboardEvent = onKeyboardEvent;
|
|
4600
4578
|
function fireEvent(key, pressed) {
|
|
4601
4579
|
if (pressed) {
|
|
4602
|
-
pxsim.board().bus.queue(
|
|
4580
|
+
pxsim.board().bus.queue(browserEvents.INTERNAL_KEY_DOWN, key);
|
|
4603
4581
|
}
|
|
4604
4582
|
else {
|
|
4605
|
-
pxsim.board().bus.queue(
|
|
4583
|
+
pxsim.board().bus.queue(browserEvents.INTERNAL_KEY_UP, key);
|
|
4606
4584
|
}
|
|
4607
4585
|
}
|
|
4608
4586
|
function getValueForKey(event) {
|
|
@@ -4796,6 +4774,10 @@ var pxsim;
|
|
|
4796
4774
|
var browserEvents;
|
|
4797
4775
|
(function (browserEvents) {
|
|
4798
4776
|
const THROTTLE_INTERVAL = 50;
|
|
4777
|
+
browserEvents.INTERNAL_KEY_DOWN = 6870;
|
|
4778
|
+
browserEvents.INTERNAL_KEY_UP = 6871;
|
|
4779
|
+
browserEvents.INTERNAL_POINTER_DOWN = 6868;
|
|
4780
|
+
browserEvents.INTERNAL_POINTER_UP = 6869;
|
|
4799
4781
|
class MouseState {
|
|
4800
4782
|
constructor() {
|
|
4801
4783
|
this.onMove = pxsim.U.throttle(() => {
|
|
@@ -4818,9 +4800,16 @@ var pxsim;
|
|
|
4818
4800
|
"pointerover",
|
|
4819
4801
|
"pointerout",
|
|
4820
4802
|
];
|
|
4803
|
+
let eventId = 6857 + events.indexOf(event.type);
|
|
4804
|
+
if (event.type === "pointerdown") {
|
|
4805
|
+
eventId = browserEvents.INTERNAL_POINTER_DOWN;
|
|
4806
|
+
}
|
|
4807
|
+
else if (event.type === "pointerup") {
|
|
4808
|
+
eventId = browserEvents.INTERNAL_POINTER_UP;
|
|
4809
|
+
}
|
|
4821
4810
|
// We add 1 to the button here because the left button is 0 and
|
|
4822
4811
|
// that's used as a wildcard in our event bus
|
|
4823
|
-
pxsim.board().bus.queue(
|
|
4812
|
+
pxsim.board().bus.queue(eventId, (event.button || 0) + 1);
|
|
4824
4813
|
}
|
|
4825
4814
|
onWheelEvent(dx, dy, dz) {
|
|
4826
4815
|
this.dx = dx;
|