pxt-common-packages 12.2.8 → 12.3.1
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/libs/azureiot/built/debug/binary.js +461 -461
- package/libs/color/built/debug/binary.js +8 -8
- package/libs/color-sensor/built/debug/binary.js +8 -8
- package/libs/controller/built/debug/binary.js +7056 -7056
- package/libs/controller---none/built/debug/binary.js +7036 -7036
- package/libs/datalogger/built/debug/binary.js +63 -63
- package/libs/edge-connector/built/debug/binary.js +8 -8
- package/libs/esp32/built/debug/binary.js +462 -462
- package/libs/game/_locales/game-jsdoc-strings.json +2 -2
- package/libs/game/_locales/game-strings.json +2 -2
- package/libs/game/built/debug/binary.js +6975 -6975
- package/libs/game/numberprompt.ts +4 -4
- package/libs/game/prompt.ts +11 -7
- package/libs/game/systemKeyboard.cpp +5 -0
- package/libs/game/systemKeyboard.d.ts +3 -0
- package/libs/lcd/built/debug/binary.js +8 -8
- package/libs/light-spectrum-sensor/built/debug/binary.js +8 -8
- package/libs/lora/built/debug/binary.js +8 -8
- package/libs/matrix-keypad/built/debug/binary.js +8 -8
- package/libs/mqtt/built/debug/binary.js +176 -176
- package/libs/net/built/debug/binary.js +176 -176
- package/libs/net-game/built/debug/binary.js +8752 -8732
- package/libs/palette/built/debug/binary.js +6974 -6974
- package/libs/pixel/built/debug/binary.js +8 -8
- package/libs/power/built/debug/binary.js +8 -8
- package/libs/proximity/built/debug/binary.js +8 -8
- package/libs/radio/built/debug/binary.js +8 -8
- package/libs/radio-broadcast/built/debug/binary.js +8 -8
- package/libs/rotary-encoder/built/debug/binary.js +8 -8
- package/libs/screen/built/debug/binary.js +50 -50
- package/libs/servo/built/debug/binary.js +8 -8
- package/libs/sprite-scaling/built/debug/binary.js +6974 -6974
- package/libs/storyboard/built/debug/binary.js +6974 -6974
- package/package.json +1 -1
|
@@ -4,21 +4,21 @@ namespace game {
|
|
|
4
4
|
* Ask the player for a number value.
|
|
5
5
|
* @param message The message to display on the text-entry screen
|
|
6
6
|
* @param answerLength The maximum number of digits the user can enter (1 - 10)
|
|
7
|
-
* @param
|
|
7
|
+
* @param useOnScreenKeyboard Force the simulator to use the on-screen keyboard for text entry
|
|
8
8
|
*/
|
|
9
9
|
//% weight=10 help=game/ask-for-number
|
|
10
10
|
//% blockId=gameaskfornumber
|
|
11
|
-
//% block="ask for number $message || and max length $answerLength use
|
|
11
|
+
//% block="ask for number $message || and max length $answerLength use on-screen keyboard $useOnScreenKeyboard"
|
|
12
12
|
//% message.shadow=text
|
|
13
13
|
//% message.defl=""
|
|
14
14
|
//% answerLength.defl="6"
|
|
15
15
|
//% answerLength.min=1
|
|
16
16
|
//% answerLength.max=10
|
|
17
17
|
//% group="Prompt"
|
|
18
|
-
export function askForNumber(message: any, answerLength = 6,
|
|
18
|
+
export function askForNumber(message: any, answerLength = 6, useOnScreenKeyboard = false) {
|
|
19
19
|
answerLength = Math.max(0, Math.min(10, answerLength));
|
|
20
20
|
let p = new game.NumberPrompt();
|
|
21
|
-
const result = p.show(console.inspect(message), answerLength,
|
|
21
|
+
const result = p.show(console.inspect(message), answerLength, useOnScreenKeyboard);
|
|
22
22
|
return parseFloat(result);
|
|
23
23
|
}
|
|
24
24
|
|
package/libs/game/prompt.ts
CHANGED
|
@@ -19,20 +19,20 @@ namespace game {
|
|
|
19
19
|
* Ask the player for a string value.
|
|
20
20
|
* @param message The message to display on the text-entry screen
|
|
21
21
|
* @param answerLength The maximum number of characters the user can enter (1 - 24)
|
|
22
|
-
* @param
|
|
22
|
+
* @param useOnScreenKeyboard Force the simulator to use the on-screen keyboard for text entry
|
|
23
23
|
*/
|
|
24
24
|
//% weight=10 help=game/ask-for-string
|
|
25
25
|
//% blockId=gameaskforstring
|
|
26
|
-
//% block="ask for string $message || and max length $answerLength use
|
|
26
|
+
//% block="ask for string $message || and max length $answerLength use on-screen keyboard $useOnScreenKeyboard"
|
|
27
27
|
//% message.shadow=text
|
|
28
28
|
//% message.defl=""
|
|
29
29
|
//% answerLength.defl="12"
|
|
30
30
|
//% answerLength.min=1
|
|
31
31
|
//% answerLength.max=24
|
|
32
32
|
//% group="Prompt"
|
|
33
|
-
export function askForString(message: any, answerLength = 12,
|
|
33
|
+
export function askForString(message: any, answerLength = 12, useOnScreenKeyboard = false) {
|
|
34
34
|
let p = new game.Prompt();
|
|
35
|
-
const result = p.show(console.inspect(message), answerLength,
|
|
35
|
+
const result = p.show(console.inspect(message), answerLength, useOnScreenKeyboard);
|
|
36
36
|
return result;
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -161,7 +161,7 @@ namespace game {
|
|
|
161
161
|
this.selectionEnd = 0;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
show(message: string, answerLength: number,
|
|
164
|
+
show(message: string, answerLength: number, useOnScreenKeyboard = false) {
|
|
165
165
|
this.message = message;
|
|
166
166
|
this.answerLength = answerLength;
|
|
167
167
|
|
|
@@ -171,7 +171,7 @@ namespace game {
|
|
|
171
171
|
this.createRenderable();
|
|
172
172
|
this.confirmPressed = false;
|
|
173
173
|
|
|
174
|
-
if (
|
|
174
|
+
if (!useOnScreenKeyboard && control.deviceDalVersion() === "sim" && helpers._isSystemKeyboardSupported()) {
|
|
175
175
|
this.useSystemKeyboard = true;
|
|
176
176
|
helpers._promptForText(this.answerLength, this.numbersOnly());
|
|
177
177
|
this.selectionEnd = 0;
|
|
@@ -228,7 +228,7 @@ namespace game {
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
const promptText = new sprites.RenderText(this.message, CONTENT_WIDTH);
|
|
231
|
-
|
|
231
|
+
let systemKeyboardText: sprites.RenderText;
|
|
232
232
|
|
|
233
233
|
this.renderable = scene.createRenderable(-1, () => {
|
|
234
234
|
promptText.draw(screen, (screen.width >> 1) - (promptText.width >> 1), CONTENT_TOP, this.theme.colorPrompt, 0, 2)
|
|
@@ -240,6 +240,10 @@ namespace game {
|
|
|
240
240
|
return;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
+
if (!systemKeyboardText) {
|
|
244
|
+
systemKeyboardText = new sprites.RenderText(helpers._getLocalizedInstructions(), CONTENT_WIDTH);
|
|
245
|
+
}
|
|
246
|
+
|
|
243
247
|
screen.fillRect(0, screen.height - (PADDING << 1) - systemKeyboardText.height, screen.width, screen.height, this.theme.colorBottomBackground);
|
|
244
248
|
systemKeyboardText.draw(screen, PADDING, screen.height - PADDING - systemKeyboardText.height, this.theme.colorBottomText);
|
|
245
249
|
});
|
|
@@ -12,6 +12,9 @@ declare namespace helpers {
|
|
|
12
12
|
//% shim=Keyboard::getTextPromptString
|
|
13
13
|
function _getTextPromptString(): string;
|
|
14
14
|
|
|
15
|
+
//% shim=Keyboard::getLocalizedInstructions
|
|
16
|
+
function _getLocalizedInstructions(): string;
|
|
17
|
+
|
|
15
18
|
//% shim=Keyboard::getTextPromptSelectionStart
|
|
16
19
|
function _getTextPromptSelectionStart(): number;
|
|
17
20
|
|
|
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
|
|
|
56
56
|
const pxsim_numops = pxsim.numops;
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function _main___P48754(s) {
|
|
60
60
|
let r0 = s.r0, step = s.pc;
|
|
61
61
|
s.pc = -1;
|
|
62
62
|
|
|
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
|
|
|
66
66
|
switch (step) {
|
|
67
67
|
case 0:
|
|
68
68
|
|
|
69
|
-
globals.
|
|
70
|
-
globals.
|
|
69
|
+
globals._intervals___48997 = (undefined);
|
|
70
|
+
globals._pollEventQueue___49010 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P48754.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"characterlcd.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P48754.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P48754_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P48754, depth: s.depth + 1,
|
|
82
82
|
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
|
|
83
83
|
} }
|
|
84
84
|
|
|
@@ -88,5 +88,5 @@ function _main___P48753_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P48754
|
|
92
92
|
})
|
|
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
|
|
|
56
56
|
const pxsim_numops = pxsim.numops;
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function _main___P98605(s) {
|
|
60
60
|
let r0 = s.r0, step = s.pc;
|
|
61
61
|
s.pc = -1;
|
|
62
62
|
|
|
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
|
|
|
66
66
|
switch (step) {
|
|
67
67
|
case 0:
|
|
68
68
|
|
|
69
|
-
globals.
|
|
70
|
-
globals.
|
|
69
|
+
globals._intervals___98848 = (undefined);
|
|
70
|
+
globals._pollEventQueue___98861 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P98605.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tsl2591.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P98605.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P98605_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P98605, depth: s.depth + 1,
|
|
82
82
|
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
|
|
83
83
|
} }
|
|
84
84
|
|
|
@@ -88,5 +88,5 @@ function _main___P98602_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P98605
|
|
92
92
|
})
|
|
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
|
|
|
56
56
|
const pxsim_numops = pxsim.numops;
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function _main___P60067(s) {
|
|
60
60
|
let r0 = s.r0, step = s.pc;
|
|
61
61
|
s.pc = -1;
|
|
62
62
|
|
|
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
|
|
|
66
66
|
switch (step) {
|
|
67
67
|
case 0:
|
|
68
68
|
|
|
69
|
-
globals.
|
|
70
|
-
globals.
|
|
69
|
+
globals._intervals___60310 = (undefined);
|
|
70
|
+
globals._pollEventQueue___60323 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P60067.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"lora.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P60067.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P60067_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P60067, depth: s.depth + 1,
|
|
82
82
|
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
|
|
83
83
|
} }
|
|
84
84
|
|
|
@@ -88,5 +88,5 @@ function _main___P60066_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P60067
|
|
92
92
|
})
|
|
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
|
|
|
56
56
|
const pxsim_numops = pxsim.numops;
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function _main___P192099(s) {
|
|
60
60
|
let r0 = s.r0, step = s.pc;
|
|
61
61
|
s.pc = -1;
|
|
62
62
|
|
|
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
|
|
|
66
66
|
switch (step) {
|
|
67
67
|
case 0:
|
|
68
68
|
|
|
69
|
-
globals.
|
|
70
|
-
globals.
|
|
69
|
+
globals._intervals___192342 = (undefined);
|
|
70
|
+
globals._pollEventQueue___192355 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P192099.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"keypad.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P192099.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P192099_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P192099, depth: s.depth + 1,
|
|
82
82
|
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
|
|
83
83
|
} }
|
|
84
84
|
|
|
@@ -88,5 +88,5 @@ function _main___P192086_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P192099
|
|
92
92
|
})
|