Skip to content

Commit

Permalink
feat(uepr-76): add show/hide icons for images
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogomil-Stoyanov committed Dec 13, 2024
1 parent 2e3a31e commit fee06ee
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
16 changes: 16 additions & 0 deletions blocks_vertical/looks.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ Blockly.Blocks['looks_show'] = {
init: function() {
this.jsonInit({
"message0": Blockly.Msg.LOOKS_SHOW,
"args0": [
{
"type": "field_image",
"src": Blockly.mainWorkspace.options.pathToMedia + "show.svg",
"width": 28,
"height": 28
},
],
"category": Blockly.Categories.looks,
"extensions": ["colours_looks", "shape_statement"]
});
Expand All @@ -138,6 +146,14 @@ Blockly.Blocks['looks_hide'] = {
init: function() {
this.jsonInit({
"message0": Blockly.Msg.LOOKS_HIDE,
"args0": [
{
"type": "field_image",
"src": Blockly.mainWorkspace.options.pathToMedia + "hide.svg",
"width": 28,
"height": 28
},
],
"category": Blockly.Categories.looks,
"extensions": ["colours_looks", "shape_statement"]
});
Expand Down
8 changes: 8 additions & 0 deletions media/hide.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions media/show.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions msg/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ Blockly.Msg.LOOKS_HELLO = 'Hello!';
Blockly.Msg.LOOKS_THINKFORSECS = 'think %1 for %2 seconds';
Blockly.Msg.LOOKS_THINK = 'think %1';
Blockly.Msg.LOOKS_HMM = 'Hmm...';
Blockly.Msg.LOOKS_SHOW = 'show';
Blockly.Msg.LOOKS_HIDE = 'hide';
Blockly.Msg.LOOKS_SHOW = '%1 show';
Blockly.Msg.LOOKS_HIDE = '%1 hide';
Blockly.Msg.LOOKS_HIDEALLSPRITES = 'hide all sprites';
Blockly.Msg.LOOKS_EFFECT_COLOR = 'color';
Blockly.Msg.LOOKS_EFFECT_FISHEYE = 'fisheye';
Expand Down

0 comments on commit fee06ee

Please sign in to comment.