Skip to content

Commit

Permalink
fix: Use sleigh image on start block for xmas theme (#1549)
Browse files Browse the repository at this point in the history
* fix: Use sleigh image on start block for xmas theme

* Use preexisting image

* Simplify code
  • Loading branch information
faucomte97 authored Dec 5, 2023
1 parent 7f78a3d commit 0b72589
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions game/static/game/js/blocklyCustomBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ function initCustomBlocksDescription() {
this.setColour(50);
this.appendDummyInput()
.appendField(gettext("Start"))
.appendField(
new Blockly.FieldImage(
ocargo.Drawing.imageDir + CHARACTER_EN_FACE_URL,
ocargo.BlocklyControl.BLOCK_CHARACTER_HEIGHT,
ocargo.BlocklyControl.BLOCK_CHARACTER_WIDTH
)
);
.appendField(new Blockly.FieldImage(
new Date().getMonth() === 11 && CHARACTER_NAME === "Van"
? ocargo.Drawing.imageDir + "characters/top_view/Sleigh.svg"
: ocargo.Drawing.imageDir + CHARACTER_EN_FACE_URL,
ocargo.BlocklyControl.BLOCK_CHARACTER_HEIGHT,
ocargo.BlocklyControl.BLOCK_CHARACTER_WIDTH
)
);
this.setNextStatement(true, "Action");
this.setTooltip(gettext("The beginning of the program"));
this.setDeletable(false);
Expand Down

0 comments on commit 0b72589

Please sign in to comment.