Skip to content

Commit

Permalink
tidy up, add pigeon translations
Browse files Browse the repository at this point in the history
  • Loading branch information
evemartin committed Sep 3, 2024
1 parent b75bea7 commit e7324b7
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 18 deletions.
1 change: 1 addition & 0 deletions game/static/game/js/blockly/msg/js/ca.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ Blockly.Msg["TRAFFIC_LIGHT_GREEN_TITLE"] = "semàfor verd";
Blockly.Msg["DEAD_END_TITLE"] = "és carrer sense sortida";
Blockly.Msg["AT_DESTINATION_TITLE"] = "a destí";
Blockly.Msg["COW_CROSSING_TITLE"] = "vaques";
Blockly.Msg["PIGEON_CROSSING_TITLE"] = "coloms";

Blockly.Msg["CALL_PROC_TITLE"] = "Crida";
Blockly.Msg["CALL_PROC_TOOLTIP"] = "Crida un procediment";
Expand Down
1 change: 1 addition & 0 deletions game/static/game/js/blockly/msg/js/en-gb.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ Blockly.Msg["TRAFFIC_LIGHT_GREEN_TITLE"] = "traffic light green";
Blockly.Msg["DEAD_END_TITLE"] = "is dead end";
Blockly.Msg["AT_DESTINATION_TITLE"] = "at destination";
Blockly.Msg["COW_CROSSING_TITLE"] = "cows";
Blockly.Msg["PIGEON_CROSSING_TITLE"] = "pigeons";

Blockly.Msg["CALL_PROC_TITLE"] = "Call";
Blockly.Msg["CALL_PROC_TOOLTIP"] = "Calls a procedure";
Expand Down
1 change: 1 addition & 0 deletions game/static/game/js/blockly/msg/js/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ Blockly.Msg["TRAFFIC_LIGHT_GREEN_TITLE"] = "traffic light green";
Blockly.Msg["DEAD_END_TITLE"] = "is dead end";
Blockly.Msg["AT_DESTINATION_TITLE"] = "at destination";
Blockly.Msg["COW_CROSSING_TITLE"] = "cows";
Blockly.Msg["PIGEON_CROSSING_TITLE"] = "pigeons";

Blockly.Msg["CALL_PROC_TITLE"] = "Call";
Blockly.Msg["CALL_PROC_TOOLTIP"] = "Calls a procedure";
Expand Down
1 change: 1 addition & 0 deletions game/static/game/js/blockly/msg/js/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ Blockly.Msg["TRAFFIC_LIGHT_GREEN_TITLE"] = "semáforo en verde";
Blockly.Msg["DEAD_END_TITLE"] = "es un callejón sin salida";
Blockly.Msg["AT_DESTINATION_TITLE"] = "en destino";
Blockly.Msg["COW_CROSSING_TITLE"] = "vacas";
Blockly.Msg["PIGEON_CROSSING_TITLE"] = "palomas";

Blockly.Msg["CALL_PROC_TITLE"] = "Llamar";
Blockly.Msg["CALL_PROC_TOOLTIP"] = "Llamar a una función";
Expand Down
1 change: 1 addition & 0 deletions game/static/game/js/blockly/msg/js/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ Blockly.Msg["TRAFFIC_LIGHT_GREEN_TITLE"] = "feu vert";
Blockly.Msg["DEAD_END_TITLE"] = "cul-de-sac";
Blockly.Msg["AT_DESTINATION_TITLE"] = "arrivé à destination";
Blockly.Msg["COW_CROSSING_TITLE"] = "vaches";
Blockly.Msg["PIGEON_CROSSING_TITLE"] = "pigeons";

Blockly.Msg["CALL_PROC_TITLE"] = "Appeler";
Blockly.Msg["CALL_PROC_TOOLTIP"] = "Appeler une fonction";
Expand Down
1 change: 1 addition & 0 deletions game/static/game/js/blockly/msg/js/hi.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ Blockly.Msg["TRAFFIC_LIGHT_GREEN_TITLE"] = "ट्रैफिक लाइट
Blockly.Msg["DEAD_END_TITLE"] = "आगे का रास्ता बंद है";
Blockly.Msg["AT_DESTINATION_TITLE"] = "मंजिल /गंतव्य पर";
Blockly.Msg["COW_CROSSING_TITLE"] = "गायों";
Blockly.Msg["PIGEON_CROSSING_TITLE"] = "कबूतरों";

Blockly.Msg["CALL_PROC_TITLE"] = "पुकारना";
Blockly.Msg["CALL_PROC_TOOLTIP"] = "एक प्रक्रिया बुलाना";
Expand Down
4 changes: 2 additions & 2 deletions game/static/game/js/blocklyCustomBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ function initCustomBlocksDescription() {
init: function() {
this.setColour(210);
this.setOutput(true, 'Boolean');
let imageUrl = ocargo.Drawing.animalType == "pigeon" ? ocargo.Drawing.pigeonUrl : ocargo.Drawing.whiteCowUrl
let imageUrl = ocargo.Drawing.animalType == ocargo.Cow.PIGEON ? ocargo.Drawing.pigeonUrl : ocargo.Drawing.whiteCowUrl
this.appendDummyInput()
.appendField(ocargo.Drawing.animalType == "pigeon" ? "pigeons": Blockly.Msg.COW_CROSSING_TITLE)
.appendField(ocargo.Drawing.animalType == ocargo.Cow.PIGEON ? Blockly.Msg.PIGEON_CROSSING_TITLE: Blockly.Msg.COW_CROSSING_TITLE)
.appendField(new Blockly.FieldImage(ocargo.Drawing.imageDir + imageUrl,
ocargo.BlocklyControl.COW_WIDTH,
ocargo.BlocklyControl.BLOCK_HEIGHT), 'IMAGE');
Expand Down
7 changes: 1 addition & 6 deletions game/static/game/js/drawing.js
Original file line number Diff line number Diff line change
Expand Up @@ -1236,20 +1236,15 @@ ocargo.Drawing.renderCoins = function (coins) {
}

ocargo.Drawing.cowUrl = function (type) {
console.log(ocargo.Drawing.animalType)
//ocargo.Drawing.animalType = type;
ocargo.Drawing.animalType = type;
switch (type) {
case ocargo.Cow.WHITE:
ocargo.Drawing.animalType = "white"
return ocargo.Drawing.whiteCowUrl
case ocargo.Cow.BROWN:
ocargo.Drawing.animalType = "brown"
return ocargo.Drawing.brownCowUrl
case ocargo.Cow.PIGEON:
ocargo.Drawing.animalType = "pigeon"
return ocargo.Drawing.pigeonUrl
default:
ocargo.Drawing.animalType = "white"
return ocargo.Drawing.whiteCowUrl
}
}
Expand Down
10 changes: 3 additions & 7 deletions game/static/game/js/level_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,13 @@ ocargo.LevelEditor = function(levelId) {

// Initialise the grid
initialiseGrid();
//setTheme(THEMES.grass);
setTheme(THEMES.grass);

// Setup the toolbox
setupToolbox();

if (levelId !== null) {
loadLevel(levelId);
console.log(currentTheme);
} else {
setTheme(THEMES.grass);
}

setupTrashcan();
Expand Down Expand Up @@ -2707,8 +2704,8 @@ ocargo.LevelEditor = function(levelId) {
}
}

async function loadLevel(levelID) {
await saving.retrieveLevel(levelID, function(err, level, owned) {
function loadLevel(levelID) {
saving.retrieveLevel(levelID, function(err, level, owned) {
if (err !== null) {
console.error(err);
return;
Expand All @@ -2718,7 +2715,6 @@ ocargo.LevelEditor = function(levelId) {

saveState.loaded(owned, extractState(), level.id);
});
console.log(currentTheme);
}

function saveLevel(name, levelId, callback) {
Expand Down
3 changes: 0 additions & 3 deletions game/templates/game/level_editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,6 @@ <h2 class="title"><img class="modal_image" src='{% static "game/image/icons/bloc
</div>

{% for block in blocks %}
<script>
console.log("{{block}}")
</script>
<div class="table_row">
<div class="table_cell">
<input type="checkbox" id="{{block}}_checkbox" class="block_checkbox" unchecked>
Expand Down

0 comments on commit e7324b7

Please sign in to comment.