1
0
mirror of https://github.com/s00500/SimpleExpressions synced 2024-11-22 09:30:53 +00:00
This commit is contained in:
Lukas Bachschwell 2017-12-12 14:15:22 +01:00
parent ea9fabe9a4
commit 8cf9d4583a
2 changed files with 111 additions and 92 deletions

View File

@ -5,7 +5,7 @@
{ {
"keys": "keys":
{ {
"LANG_CATEGORY_SOUND": "User Sound", "LANG_CATEGORY_SOUND": "Sound",
"LANG_SUBCATEGORY_BUZZER": "Buzzer", "LANG_SUBCATEGORY_BUZZER": "Buzzer",
"LANG_PIEZO_BUZZER": "Buzzer", "LANG_PIEZO_BUZZER": "Buzzer",
"LANG_PIEZO_BUZZER_PIN": "PIN", "LANG_PIEZO_BUZZER_PIN": "PIN",

View File

@ -12,7 +12,26 @@ Blockly.Blocks['show_mouth'] = {
init: function() { init: function() {
this.appendDummyInput('').appendField("WS2812 7-Ring").appendField(new Blockly.FieldImage('img/blocks/led_strip.svg', 40 * options.zoom, 40 * options.zoom)); this.appendDummyInput('').appendField("WS2812 7-Ring").appendField(new Blockly.FieldImage('img/blocks/led_strip.svg', 40 * options.zoom, 40 * options.zoom));
this.appendValueInput('PIN').appendField(Facilino.locales.getKey('LANG_SIMPLEEXPRESSIONS_PIN')).setAlign(Blockly.ALIGN_RIGHT).setCheck(Number); this.appendValueInput('PIN').appendField(Facilino.locales.getKey('LANG_SIMPLEEXPRESSIONS_PIN')).setAlign(Blockly.ALIGN_RIGHT).setCheck(Number);
this.appendDummyInput('').appendField('Expression').appendField(new Blockly.FieldDropdown([['Zeros','zeros'],['Happy Small','happySmall'],['Happy Full','happyFull'],['Sad Small','sadSmall'],['Sad Full','sadFull'],['Neutral','neutral'],['Circle','circle'],['Center','center'],['Hook','hook'],['Upsidedown Hook','upsidedownhook'],['Kooh','kooh'],['Upsidedown Kooh','upsidedownkooh'],['Cross','cross'],['Rect','rect'],['Left Arrow','leftarrow'],['Right Arrow','rightarrow'],['Left Half','lefthalf'],['Right Half','righthalf']]),'EXPRESSION').setAlign(Blockly.ALIGN_RIGHT); this.appendDummyInput('').appendField('Expression').appendField(new Blockly.FieldDropdown([
['Zeros', 'zeros'],
['Happy Small', 'happySmall'],
['Happy Full', 'happyFull'],
['Sad Small', 'sadSmall'],
['Sad Full', 'sadFull'],
['Neutral', 'neutral'],
['Circle', 'circle'],
['Center', 'center'],
['Hook', 'hook'],
['Upsidedown Hook', 'upsidedownhook'],
['Kooh', 'kooh'],
['Upsidedown Kooh', 'upsidedownkooh'],
['Cross', 'cross'],
['Rect', 'rect'],
['Left Arrow', 'leftarrow'],
['Right Arrow', 'rightarrow'],
['Left Half', 'lefthalf'],
['Right Half', 'righthalf']
]), 'EXPRESSION').setAlign(Blockly.ALIGN_RIGHT);
var colour = new Blockly.FieldColour('#000000'); var colour = new Blockly.FieldColour('#000000');
colour.setColours(['#000000', '#808080', '#C0C0C0', '#FFFFFF', '#800000', '#FF0000', '#808000', '#FFFF00', '#008000', '#00FF00', '#008080', '#00FFFF', '#000080', '#0000FF', '#800080', '#FF00FF']).setColumns(4); colour.setColours(['#000000', '#808080', '#C0C0C0', '#FFFFFF', '#800000', '#FF0000', '#808000', '#FFFF00', '#008000', '#00FF00', '#008080', '#00FFFF', '#000080', '#0000FF', '#800080', '#FF00FF']).setColumns(4);
this.appendDummyInput('').appendField('Color').appendField(colour, 'COLOR').setAlign(Blockly.ALIGN_RIGHT); this.appendDummyInput('').appendField('Color').appendField(colour, 'COLOR').setAlign(Blockly.ALIGN_RIGHT);