From 0a3a2a96000a9892de10825f1b03641ff608945e Mon Sep 17 00:00:00 2001 From: peli Date: Mon, 12 Oct 2020 23:42:23 -0700 Subject: [PATCH] added support for control messages --- docs/projects/SUMMARY.md | 2 +- libs/base/_locales/base-jsdoc-strings.json | 4 +++- libs/base/_locales/base-strings.json | 1 + package.json | 4 ++-- sim/dalboard.ts | 5 ++++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/projects/SUMMARY.md b/docs/projects/SUMMARY.md index 87a26ec2f..00c228558 100644 --- a/docs/projects/SUMMARY.md +++ b/docs/projects/SUMMARY.md @@ -22,7 +22,7 @@ * [Dandelion](/projects/dandelion) * [Watch Timer](/projects/watch-timer) * [Magic Wand](/projects/magic-wand) - * [Legendary Gauntlets](/projects/wonder-woman-gauntlets) + * [Wonder Woman's Legendary Gauntlets](/projects/wonder-woman-gauntlets) * [Headlamp](/projects/headlamp) * [Energy glove](/examples/energy-glove) * [Beaded Necklace](/projects/beaded-necklace) diff --git a/libs/base/_locales/base-jsdoc-strings.json b/libs/base/_locales/base-jsdoc-strings.json index 460bc6f80..924726808 100644 --- a/libs/base/_locales/base-jsdoc-strings.json +++ b/libs/base/_locales/base-jsdoc-strings.json @@ -1,5 +1,6 @@ { "Array": "Add, remove, and replace items in lists.", + "Array._pickRandom": "Return a random value from the array", "Array._popStatement": "Remove the last element from an array and return it.", "Array._removeAtStatement": "Remove the element at a certain index.", "Array._shiftStatement": "Remove the first element from an array and return it. This method changes the length of the array.", @@ -37,6 +38,7 @@ "Array.reverse": "Reverse the elements in an array. The first array element becomes the last, and the last array element becomes the first.", "Array.set": "Store a value at a particular index", "Array.set|param|index": "the zero-based position in the list to store the value, eg: 0", + "Array.set|param|value": "the value to insert, eg: 0", "Array.shift": "Remove the first element from an array and return it. This method changes the length of the array.", "Array.slice": "Return a section of an array.", "Array.slice|param|end": "The end of the specified portion of the array. eg: 0", @@ -188,7 +190,7 @@ "String.split": "Splits the string according to the separators", "String.split|param|separator": "@param limit", "String.substr": "Return a substring of the current string.", - "String.substr|param|length": "number of characters to extract", + "String.substr|param|length": "number of characters to extract, eg: 10", "String.substr|param|start": "first character index; can be negative from counting from the end, eg:0", "String.toLowerCase": "Converts the string to lower case characters.", "String.trim": "Return a substring of the current string with whitespace removed from both ends", diff --git a/libs/base/_locales/base-strings.json b/libs/base/_locales/base-strings.json index 30658a08a..b7bbe4648 100644 --- a/libs/base/_locales/base-strings.json +++ b/libs/base/_locales/base-strings.json @@ -1,4 +1,5 @@ { + "Array._pickRandom|block": "get random value from %list", "Array._popStatement|block": "remove last value from %list", "Array._removeAtStatement|block": "%list| remove value at %index", "Array._shiftStatement|block": "remove first value from %list", diff --git a/package.json b/package.json index 5c14a2822..595a2488b 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,8 @@ "@types/web-bluetooth": "0.0.4" }, "dependencies": { - "pxt-common-packages": "8.1.1", - "pxt-core": "6.2.6" + "pxt-common-packages": "8.2.7", + "pxt-core": "6.4.2" }, "scripts": { "serve": "node node_modules/pxt-core/built/pxt.js serve", diff --git a/sim/dalboard.ts b/sim/dalboard.ts index 686d1f218..b707d8c13 100644 --- a/sim/dalboard.ts +++ b/sim/dalboard.ts @@ -49,7 +49,8 @@ namespace pxsim { TemperatureBoard, InfraredBoard, CapTouchBoard, - StorageBoard { + StorageBoard, + ControlMessageBoard { // state & update logic for component services _neopixelState: pxt.Map; buttonState: CommonButtonState; @@ -65,6 +66,7 @@ namespace pxsim { touchButtonState: TouchButtonState; irState: InfraredState; storageState: StorageState; + controlMessageState: ControlMessageState; invertAccelerometerYAxis = true; @@ -81,6 +83,7 @@ namespace pxsim { //components this.storageState = new StorageState(); + this.controlMessageState = new ControlMessageState(this); this.builtinParts["neopixel"] = this.neopixelState(CPlayPinName.D8); this.builtinParts["buttonpair"] = this.buttonState = new CommonButtonState();