Skip to content

Commit 4cb39bb

Browse files
committed
Merge branch 'develop' of https://github.com/smalruby/smalruby3-gui into develop
2 parents 39a1b33 + 6594421 commit 4cb39bb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/lib/ruby-generator/makeymakey.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,16 @@ export default function (Generator) {
1515
return `${Generator.spriteName()}.when(:makey_key_pressed, ${key}) do\n`;
1616
};
1717

18+
Generator.makeymakey_menu_SEQUENCE = function (block) {
19+
const sequence = Generator.quote_(Generator.getFieldValue(block, 'SEQUENCE') || 'LEFT UP RIGHT');
20+
return [sequence, Generator.ORDER_ATOMIC];
21+
};
22+
23+
Generator.makeymakey_whenCodePressed = function (block) {
24+
block.isStatement = true;
25+
const sequence = Generator.valueToCode(block, 'SEQUENCE', Generator.ORDER_NONE) || null;
26+
return `${Generator.spriteName()}.when(:makey_pressed_in_oder, ${sequence}) do\n`;
27+
};
28+
1829
return Generator;
1930
}

0 commit comments

Comments
 (0)