Decompile field editors. Changes in authoring of field editors.
This commit is contained in:
parent
d54378d802
commit
a76e8d5ef1
@ -173,13 +173,13 @@ namespace basic {
|
|||||||
* Draws the selected icon on the LED screen
|
* Draws the selected icon on the LED screen
|
||||||
*/
|
*/
|
||||||
//% weight=90 blockGap=8
|
//% weight=90 blockGap=8
|
||||||
//% blockId=basic_show_icon
|
//% blockId=basic_show_icon
|
||||||
//% block="show icon %i" icon="\uf00a"
|
//% block="show icon %i" icon="\uf00a"
|
||||||
//% parts="ledmatrix"
|
//% parts="ledmatrix"
|
||||||
//% help=basic/show-icon
|
//% help=basic/show-icon
|
||||||
//% blockFieldEditor="FieldGridPicker"
|
//% i.fieldEditor="gridpicker"
|
||||||
//% blockFieldEditorParams.width=400 blockFieldEditorParams.columns=5
|
//% i.fieldOptions.width="400" i.fieldOptions.columns="5"
|
||||||
//% blockFieldEditorParams.itemColour=black blockFieldEditorParams.tooltips=true
|
//% i.fieldOptions.itemColour="black" i.fieldOptions.tooltips="true"
|
||||||
export function showIcon(icon: IconNames) {
|
export function showIcon(icon: IconNames) {
|
||||||
let res = images.iconImage(icon)
|
let res = images.iconImage(icon)
|
||||||
res.showImage(0)
|
res.showImage(0)
|
||||||
|
@ -178,7 +178,7 @@ namespace music {
|
|||||||
//% help=music/play-tone weight=90
|
//% help=music/play-tone weight=90
|
||||||
//% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" blockGap=8
|
//% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" blockGap=8
|
||||||
//% parts="headphone"
|
//% parts="headphone"
|
||||||
//% useEnumVal = 1
|
//% useEnumVal=1
|
||||||
export function playTone(frequency: number, ms: number): void {
|
export function playTone(frequency: number, ms: number): void {
|
||||||
if (_playTone) _playTone(frequency, ms);
|
if (_playTone) _playTone(frequency, ms);
|
||||||
else pins.analogPitch(frequency, ms);
|
else pins.analogPitch(frequency, ms);
|
||||||
@ -191,7 +191,7 @@ namespace music {
|
|||||||
//% help=music/ring-tone weight=80
|
//% help=music/ring-tone weight=80
|
||||||
//% blockId=device_ring block="ring tone (Hz)|%note=device_note" blockGap=8
|
//% blockId=device_ring block="ring tone (Hz)|%note=device_note" blockGap=8
|
||||||
//% parts="headphone"
|
//% parts="headphone"
|
||||||
//% useEnumVal = 1
|
//% useEnumVal=1
|
||||||
export function ringTone(frequency: number): void {
|
export function ringTone(frequency: number): void {
|
||||||
playTone(frequency, 0);
|
playTone(frequency, 0);
|
||||||
}
|
}
|
||||||
@ -215,8 +215,8 @@ namespace music {
|
|||||||
//% weight=50 help=music/note-frequency
|
//% weight=50 help=music/note-frequency
|
||||||
//% blockId=device_note block="%note"
|
//% blockId=device_note block="%note"
|
||||||
//% shim=TD_ID
|
//% shim=TD_ID
|
||||||
//% blockFieldEditor="note_editor"
|
//% note.fieldEditor="note" note.defl="262"
|
||||||
//% useEnumVal = 1
|
//% useEnumVal=1
|
||||||
export function noteFrequency(name: Note): number {
|
export function noteFrequency(name: Note): number {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user