Skip to content

Commit b3b1ae0

Browse files
Change Enum names and clarify blocks
1 parent 1625f45 commit b3b1ae0

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

inventory.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
enum ToolbarColorAttribute {
2-
//% block="box outline"
2+
//% block="outline"
33
BoxOutline,
4-
//% block="box selected outline"
4+
//% block="selected outline"
55
BoxSelectedOutline,
6-
//% block="box background"
6+
//% block="background"
77
BoxBackground
88
}
99

1010
enum InventoryColorAttribute {
11-
//% block="inventory outline"
11+
//% block="outline"
1212
InventoryOutline,
13-
//% block="inventory selected outline"
13+
//% block="selected outline"
1414
InventorySelectedOutline,
15-
//% block="inventory background"
15+
//% block="background"
1616
InventoryBackground,
17-
//% block="inventory text"
17+
//% block="text"
1818
InventoryText
1919
}
2020

@@ -72,7 +72,7 @@ namespace Inventory {
7272
* @param attribute: A property of the ItemTextAttribute enum.
7373
* @param value: The new text of the item.
7474
*/
75-
//% block="%Inventory(Item) set text of %attribute to %value"
75+
//% block="item %Inventory(Item) set %attribute to %value"
7676
//% weight=20
7777
//% group="Item"
7878
//% hidden
@@ -88,7 +88,7 @@ namespace Inventory {
8888
* Get the name of description of the item.
8989
* @return: The text.
9090
*/
91-
//% block="%Inventory(Item) get text of %attribute"
91+
//% block="item %Inventory(Item) get %attribute"
9292
//% weight=10
9393
//% group="Item"
9494
//% hidden
@@ -105,7 +105,7 @@ namespace Inventory {
105105
* Set the image of the item.
106106
* @param new_image: The new image.
107107
*/
108-
//% block="%Inventory(Item) set image to %new_image"
108+
//% block="item %Inventory(Item) set image to %new_image"
109109
//% new_image.shadow=screen_image_picker
110110
//% weight=40
111111
//% group="Item"
@@ -118,7 +118,7 @@ namespace Inventory {
118118
* Get the image of the item.
119119
* @return: The image.
120120
*/
121-
//% block="%Inventory(Item) get image"
121+
//% block="item %Inventory(Item) get image"
122122
//% weight=30
123123
//% group="Item"
124124
//% hidden
@@ -196,7 +196,7 @@ namespace Inventory {
196196
* Get the items in the toolbar. Only rewrapped for blocks.
197197
* @return: The items, as an array of Item.
198198
*/
199-
//% block="%Inventory(toolbar) get items"
199+
//% block="toolbar %Inventory(toolbar) get items"
200200
//% weight=80
201201
//% group="Toolbar"
202202
//% hidden
@@ -215,7 +215,7 @@ namespace Inventory {
215215
/**
216216
* Set the items in the toolbar. Only rewrapped for blocks.
217217
*/
218-
//% block="%Inventory(toolbar) set items to %new_items"
218+
//% block="toolbar %Inventory(toolbar) set items to %new_items"
219219
//% new_items.shadow="lists_create_with"
220220
//% weight=90
221221
//% group="Toolbar"
@@ -244,7 +244,7 @@ namespace Inventory {
244244
* @attribute: A property of the ToolbarNumberAttribute enum.
245245
* @value: The new value.
246246
*/
247-
//% block="%Inventory(toolbar) set %attribute to %value"
247+
//% block="toolbar %Inventory(toolbar) set %attribute to %value"
248248
//% weight=70
249249
//% group="Toolbar"
250250
//% hidden
@@ -261,7 +261,7 @@ namespace Inventory {
261261
* @attribute: A property of the ToolbarNumberAttribute enum.
262262
* @return: A number.
263263
*/
264-
//% block="%Inventory(toolbar) get %attribute"
264+
//% block="toolbar %Inventory(toolbar) get %attribute"
265265
//% weight=60
266266
//% group="Toolbar"
267267
//% hidden
@@ -279,7 +279,7 @@ namespace Inventory {
279279
* @param attribute: A property of the ToolbarColorAttribute enum.
280280
* @param color: A number which should be the new color of the attribute.
281281
*/
282-
//% block="%Inventory(toolbar) set color of %attribute to %color"
282+
//% block="toolbar %Inventory(toolbar) set color of %attribute to %color"
283283
//% color.shadow=colorindexpicker
284284
//% weight=50
285285
//% group="Toolbar"
@@ -299,7 +299,7 @@ namespace Inventory {
299299
* @param attribute: A property of the ToolbarColorAttribute enum.
300300
* @return: The color (which is a number) of the attribute, otherwise -1.
301301
*/
302-
//% block="%Inventory(toolbar) get color of %attribute"
302+
//% block="toolbar %Inventory(toolbar) get color of %attribute"
303303
//% weight=40
304304
//% group="Toolbar"
305305
public get_color(attribute: ToolbarColorAttribute) {
@@ -316,7 +316,7 @@ namespace Inventory {
316316
/**
317317
* Update the image of the toolbar.
318318
*/
319-
//% block="%Inventory(toolbar) force redraw of toolbar"
319+
//% block="toolbar %Inventory(toolbar) force redraw"
320320
//% weight=30
321321
public update() {
322322
let image_size: number = 16;
@@ -425,7 +425,7 @@ namespace Inventory {
425425
* Get the items in the inventory. Only rewrapped for blocks.
426426
* @return: The items - as an array of Item.
427427
*/
428-
//% block="%Inventory(inventory) get items"
428+
//% block="inventory %Inventory(inventory) get items"
429429
//% weight=80
430430
//% group="Inventory"
431431
//% hidden
@@ -445,7 +445,7 @@ namespace Inventory {
445445
* Set the items in the inventory. Only rewrapped for blocks.
446446
* @new_items: A list of Item.
447447
*/
448-
//% block="%Inventory(inventory) set items to %new_items"
448+
//% block="inventory %Inventory(inventory) set items to %new_items"
449449
//% new_items.shadow="lists_create_with"
450450
//% weight=90
451451
//% group="Inventory"
@@ -474,7 +474,7 @@ namespace Inventory {
474474
* @attribute: A property of the InventoryNumberAttribute enum.
475475
* @value: The new number.
476476
*/
477-
//% block="%Inventory(inventory) set %attribute to %value"
477+
//% block="inventory %Inventory(inventory) set %attribute to %value"
478478
//% weight=70
479479
//% group="Inventory"
480480
//% hidden
@@ -491,7 +491,7 @@ namespace Inventory {
491491
* @attribute: A property of the InventoryNumberAttribute enum.
492492
* @return: The number.
493493
*/
494-
//% block="%Inventory(inventory) get %attribute"
494+
//% block="inventory %Inventory(inventory) get %attribute"
495495
//% weight=60
496496
//% group="Inventory"
497497
//% hidden
@@ -515,7 +515,7 @@ namespace Inventory {
515515
* Get the text in the inventory. Only rewrapped for blocks.
516516
* @return: A string.
517517
*/
518-
//% block="%Inventory(inventory) get text"
518+
//% block="inventory %Inventory(inventory) get text"
519519
//% weight=40
520520
//% group="Inventory"
521521
//% hidden
@@ -535,7 +535,7 @@ namespace Inventory {
535535
* Set the text in the inventory. Only rewrapped for blocks.
536536
* @new_text: The new text.
537537
*/
538-
//% block="%Inventory(inventory) set text to %new_text"
538+
//% block="inventory %Inventory(inventory) set text to %new_text"
539539
//% weight=50
540540
//% group="Inventory"
541541
//% hidden
@@ -548,7 +548,7 @@ namespace Inventory {
548548
* @param attribute: A property of the InventoryColorAttribute enum.
549549
* @param color: A number which should be the new color of the attribute.
550550
*/
551-
//% block="%Inventory(inventory) set color of %attribute to %color"
551+
//% block="inventory %Inventory(inventory) set color of %attribute to %color"
552552
//% color.shadow=colorindexpicker
553553
//% weight=30
554554
//% group="Inventory"
@@ -570,7 +570,7 @@ namespace Inventory {
570570
* @param attribute: A property of the InventoryColorAttribute enum.
571571
* @return: The color (which is a number) of the attribute, otherwise -1.
572572
*/
573-
//% block="%Inventory(inventory) get color of %attribute"
573+
//% block="inventory %Inventory(inventory) get color of %attribute"
574574
//% weight=20
575575
//% group="Inventory"
576576
public get_color(attribute: InventoryColorAttribute) {
@@ -589,7 +589,7 @@ namespace Inventory {
589589
/**
590590
* Update the image of the inventory.
591591
*/
592-
//% block="%Inventory(Inventory) force redraw of inventory"
592+
//% block="inventory %Inventory(Inventory) force redraw"
593593
//% weight=10
594594
//% group="Inventory"
595595
public update() {

0 commit comments

Comments
 (0)