diff --git a/levels/bisect/bisect b/levels/en/bisect/bisect similarity index 100% rename from levels/bisect/bisect rename to levels/en/bisect/bisect diff --git a/levels/bisect/sequence b/levels/en/bisect/sequence similarity index 100% rename from levels/bisect/sequence rename to levels/en/bisect/sequence diff --git a/levels/branches/branch-create b/levels/en/branches/branch-create similarity index 100% rename from levels/branches/branch-create rename to levels/en/branches/branch-create diff --git a/levels/branches/branch-remove b/levels/en/branches/branch-remove similarity index 100% rename from levels/branches/branch-remove rename to levels/en/branches/branch-remove diff --git a/levels/branches/checkout-commit b/levels/en/branches/checkout-commit similarity index 100% rename from levels/branches/checkout-commit rename to levels/en/branches/checkout-commit diff --git a/levels/branches/fork b/levels/en/branches/fork similarity index 100% rename from levels/branches/fork rename to levels/en/branches/fork diff --git a/levels/branches/grow b/levels/en/branches/grow similarity index 100% rename from levels/branches/grow rename to levels/en/branches/grow diff --git a/levels/branches/reorder b/levels/en/branches/reorder similarity index 100% rename from levels/branches/reorder rename to levels/en/branches/reorder diff --git a/levels/branches/sequence b/levels/en/branches/sequence similarity index 100% rename from levels/branches/sequence rename to levels/en/branches/sequence diff --git a/levels/changing-the-past/rebase b/levels/en/changing-the-past/rebase similarity index 100% rename from levels/changing-the-past/rebase rename to levels/en/changing-the-past/rebase diff --git a/levels/changing-the-past/reorder b/levels/en/changing-the-past/reorder similarity index 100% rename from levels/changing-the-past/reorder rename to levels/en/changing-the-past/reorder diff --git a/levels/changing-the-past/sequence b/levels/en/changing-the-past/sequence similarity index 100% rename from levels/changing-the-past/sequence rename to levels/en/changing-the-past/sequence diff --git a/levels/files/files-add b/levels/en/files/files-add similarity index 100% rename from levels/files/files-add rename to levels/en/files/files-add diff --git a/levels/files/files-delete b/levels/en/files/files-delete similarity index 100% rename from levels/files/files-delete rename to levels/en/files/files-delete diff --git a/levels/files/sequence b/levels/en/files/sequence similarity index 100% rename from levels/files/sequence rename to levels/en/files/sequence diff --git a/levels/index/add b/levels/en/index/add similarity index 100% rename from levels/index/add rename to levels/en/index/add diff --git a/levels/index/change b/levels/en/index/change similarity index 100% rename from levels/index/change rename to levels/en/index/change diff --git a/levels/index/checkout b/levels/en/index/checkout similarity index 100% rename from levels/index/checkout rename to levels/en/index/checkout diff --git a/levels/index/compare b/levels/en/index/compare similarity index 100% rename from levels/index/compare rename to levels/en/index/compare diff --git a/levels/index/new b/levels/en/index/new similarity index 100% rename from levels/index/new rename to levels/en/index/new diff --git a/levels/index/reset b/levels/en/index/reset similarity index 100% rename from levels/index/reset rename to levels/en/index/reset diff --git a/levels/index/rm b/levels/en/index/rm similarity index 100% rename from levels/index/rm rename to levels/en/index/rm diff --git a/levels/index/sequence b/levels/en/index/sequence similarity index 100% rename from levels/index/sequence rename to levels/en/index/sequence diff --git a/levels/index/steps b/levels/en/index/steps similarity index 100% rename from levels/index/steps rename to levels/en/index/steps diff --git a/levels/intro/cli b/levels/en/intro/cli similarity index 100% rename from levels/intro/cli rename to levels/en/intro/cli diff --git a/levels/intro/commit b/levels/en/intro/commit similarity index 100% rename from levels/intro/commit rename to levels/en/intro/commit diff --git a/levels/intro/copies b/levels/en/intro/copies similarity index 100% rename from levels/intro/copies rename to levels/en/intro/copies diff --git a/levels/intro/init b/levels/en/intro/init similarity index 100% rename from levels/intro/init rename to levels/en/intro/init diff --git a/levels/intro/remote b/levels/en/intro/remote similarity index 100% rename from levels/intro/remote rename to levels/en/intro/remote diff --git a/levels/intro/risky b/levels/en/intro/risky similarity index 100% rename from levels/intro/risky rename to levels/en/intro/risky diff --git a/levels/intro/sequence b/levels/en/intro/sequence similarity index 100% rename from levels/intro/sequence rename to levels/en/intro/sequence diff --git a/levels/intro/who-are-you b/levels/en/intro/who-are-you similarity index 100% rename from levels/intro/who-are-you rename to levels/en/intro/who-are-you diff --git a/levels/low-level/basics b/levels/en/low-level/basics similarity index 100% rename from levels/low-level/basics rename to levels/en/low-level/basics diff --git a/levels/low-level/blob-create b/levels/en/low-level/blob-create similarity index 100% rename from levels/low-level/blob-create rename to levels/en/low-level/blob-create diff --git a/levels/low-level/blob-remove b/levels/en/low-level/blob-remove similarity index 100% rename from levels/low-level/blob-remove rename to levels/en/low-level/blob-remove diff --git a/levels/low-level/commit-create b/levels/en/low-level/commit-create similarity index 100% rename from levels/low-level/commit-create rename to levels/en/low-level/commit-create diff --git a/levels/low-level/commit-parents b/levels/en/low-level/commit-parents similarity index 100% rename from levels/low-level/commit-parents rename to levels/en/low-level/commit-parents diff --git a/levels/low-level/commit-rhombus b/levels/en/low-level/commit-rhombus similarity index 100% rename from levels/low-level/commit-rhombus rename to levels/en/low-level/commit-rhombus diff --git a/levels/low-level/index-add b/levels/en/low-level/index-add similarity index 100% rename from levels/low-level/index-add rename to levels/en/low-level/index-add diff --git a/levels/low-level/index-remove b/levels/en/low-level/index-remove similarity index 100% rename from levels/low-level/index-remove rename to levels/en/low-level/index-remove diff --git a/levels/low-level/index-update b/levels/en/low-level/index-update similarity index 100% rename from levels/low-level/index-update rename to levels/en/low-level/index-update diff --git a/levels/low-level/puzzle-apocalypse b/levels/en/low-level/puzzle-apocalypse similarity index 100% rename from levels/low-level/puzzle-apocalypse rename to levels/en/low-level/puzzle-apocalypse diff --git a/levels/low-level/puzzle-precious-blob b/levels/en/low-level/puzzle-precious-blob similarity index 100% rename from levels/low-level/puzzle-precious-blob rename to levels/en/low-level/puzzle-precious-blob diff --git a/levels/low-level/puzzle-trees-all-the-way-down b/levels/en/low-level/puzzle-trees-all-the-way-down similarity index 100% rename from levels/low-level/puzzle-trees-all-the-way-down rename to levels/en/low-level/puzzle-trees-all-the-way-down diff --git a/levels/low-level/ref-create b/levels/en/low-level/ref-create similarity index 100% rename from levels/low-level/ref-create rename to levels/en/low-level/ref-create diff --git a/levels/low-level/ref-move b/levels/en/low-level/ref-move similarity index 100% rename from levels/low-level/ref-move rename to levels/en/low-level/ref-move diff --git a/levels/low-level/ref-remove b/levels/en/low-level/ref-remove similarity index 100% rename from levels/low-level/ref-remove rename to levels/en/low-level/ref-remove diff --git a/levels/low-level/sequence b/levels/en/low-level/sequence similarity index 100% rename from levels/low-level/sequence rename to levels/en/low-level/sequence diff --git a/levels/low-level/symref-create b/levels/en/low-level/symref-create similarity index 100% rename from levels/low-level/symref-create rename to levels/en/low-level/symref-create diff --git a/levels/low-level/symref-no-deref b/levels/en/low-level/symref-no-deref similarity index 100% rename from levels/low-level/symref-no-deref rename to levels/en/low-level/symref-no-deref diff --git a/levels/low-level/tree-create b/levels/en/low-level/tree-create similarity index 100% rename from levels/low-level/tree-create rename to levels/en/low-level/tree-create diff --git a/levels/low-level/tree-nested b/levels/en/low-level/tree-nested similarity index 100% rename from levels/low-level/tree-nested rename to levels/en/low-level/tree-nested diff --git a/levels/low-level/tree-read b/levels/en/low-level/tree-read similarity index 100% rename from levels/low-level/tree-read rename to levels/en/low-level/tree-read diff --git a/levels/low-level/welcome b/levels/en/low-level/welcome similarity index 100% rename from levels/low-level/welcome rename to levels/en/low-level/welcome diff --git a/levels/merge/conflict b/levels/en/merge/conflict similarity index 100% rename from levels/merge/conflict rename to levels/en/merge/conflict diff --git a/levels/merge/merge b/levels/en/merge/merge similarity index 100% rename from levels/merge/merge rename to levels/en/merge/merge diff --git a/levels/merge/merge-abort b/levels/en/merge/merge-abort similarity index 100% rename from levels/merge/merge-abort rename to levels/en/merge/merge-abort diff --git a/levels/merge/sequence b/levels/en/merge/sequence similarity index 100% rename from levels/merge/sequence rename to levels/en/merge/sequence diff --git a/levels/remotes/friend b/levels/en/remotes/friend similarity index 100% rename from levels/remotes/friend rename to levels/en/remotes/friend diff --git a/levels/remotes/problems b/levels/en/remotes/problems similarity index 100% rename from levels/remotes/problems rename to levels/en/remotes/problems diff --git a/levels/remotes/sequence b/levels/en/remotes/sequence similarity index 100% rename from levels/remotes/sequence rename to levels/en/remotes/sequence diff --git a/levels/sandbox/empty b/levels/en/sandbox/empty similarity index 100% rename from levels/sandbox/empty rename to levels/en/sandbox/empty diff --git a/levels/sandbox/remote b/levels/en/sandbox/remote similarity index 100% rename from levels/sandbox/remote rename to levels/en/sandbox/remote diff --git a/levels/sandbox/sequence b/levels/en/sandbox/sequence similarity index 100% rename from levels/sandbox/sequence rename to levels/en/sandbox/sequence diff --git a/levels/sandbox/three-commits b/levels/en/sandbox/three-commits similarity index 100% rename from levels/sandbox/three-commits rename to levels/en/sandbox/three-commits diff --git a/levels/sequence b/levels/en/sequence similarity index 100% rename from levels/sequence rename to levels/en/sequence diff --git a/levels/shit-happens/bad-commit b/levels/en/shit-happens/bad-commit similarity index 100% rename from levels/shit-happens/bad-commit rename to levels/en/shit-happens/bad-commit diff --git a/levels/shit-happens/pushed-something-broken b/levels/en/shit-happens/pushed-something-broken similarity index 100% rename from levels/shit-happens/pushed-something-broken rename to levels/en/shit-happens/pushed-something-broken diff --git a/levels/shit-happens/reflog b/levels/en/shit-happens/reflog similarity index 100% rename from levels/shit-happens/reflog rename to levels/en/shit-happens/reflog diff --git a/levels/shit-happens/restore-a-file b/levels/en/shit-happens/restore-a-file similarity index 100% rename from levels/shit-happens/restore-a-file rename to levels/en/shit-happens/restore-a-file diff --git a/levels/shit-happens/restore-a-file-from-the-past b/levels/en/shit-happens/restore-a-file-from-the-past similarity index 100% rename from levels/shit-happens/restore-a-file-from-the-past rename to levels/en/shit-happens/restore-a-file-from-the-past diff --git a/levels/shit-happens/sequence b/levels/en/shit-happens/sequence similarity index 100% rename from levels/shit-happens/sequence rename to levels/en/shit-happens/sequence diff --git a/levels/stash/sequence b/levels/en/stash/sequence similarity index 100% rename from levels/stash/sequence rename to levels/en/stash/sequence diff --git a/levels/stash/stash b/levels/en/stash/stash similarity index 100% rename from levels/stash/stash rename to levels/en/stash/stash diff --git a/levels/stash/stash-branch b/levels/en/stash/stash-branch similarity index 100% rename from levels/stash/stash-branch rename to levels/en/stash/stash-branch diff --git a/levels/stash/stash-clear b/levels/en/stash/stash-clear similarity index 100% rename from levels/stash/stash-clear rename to levels/en/stash/stash-clear diff --git a/levels/stash/stash-merge b/levels/en/stash/stash-merge similarity index 100% rename from levels/stash/stash-merge rename to levels/en/stash/stash-merge diff --git a/levels/stash/stash-pop b/levels/en/stash/stash-pop similarity index 100% rename from levels/stash/stash-pop rename to levels/en/stash/stash-pop diff --git a/levels/tags/add-tag b/levels/en/tags/add-tag similarity index 100% rename from levels/tags/add-tag rename to levels/en/tags/add-tag diff --git a/levels/tags/add-tag-later b/levels/en/tags/add-tag-later similarity index 100% rename from levels/tags/add-tag-later rename to levels/en/tags/add-tag-later diff --git a/levels/tags/remote-tag b/levels/en/tags/remote-tag similarity index 100% rename from levels/tags/remote-tag rename to levels/en/tags/remote-tag diff --git a/levels/tags/remove-tag b/levels/en/tags/remove-tag similarity index 100% rename from levels/tags/remove-tag rename to levels/en/tags/remove-tag diff --git a/levels/tags/sequence b/levels/en/tags/sequence similarity index 100% rename from levels/tags/sequence rename to levels/en/tags/sequence diff --git a/levels/unused/checkout b/levels/en/unused/checkout similarity index 100% rename from levels/unused/checkout rename to levels/en/unused/checkout diff --git a/levels/unused/clone b/levels/en/unused/clone similarity index 100% rename from levels/unused/clone rename to levels/en/unused/clone diff --git a/levels/unused/commit b/levels/en/unused/commit similarity index 100% rename from levels/unused/commit rename to levels/en/unused/commit diff --git a/levels/unused/commit-a b/levels/en/unused/commit-a similarity index 100% rename from levels/unused/commit-a rename to levels/en/unused/commit-a diff --git a/levels/unused/fetch b/levels/en/unused/fetch similarity index 100% rename from levels/unused/fetch rename to levels/en/unused/fetch diff --git a/levels/unused/files-move b/levels/en/unused/files-move similarity index 100% rename from levels/unused/files-move rename to levels/en/unused/files-move diff --git a/levels/unused/index-mv b/levels/en/unused/index-mv similarity index 100% rename from levels/unused/index-mv rename to levels/en/unused/index-mv diff --git a/levels/unused/init b/levels/en/unused/init similarity index 100% rename from levels/unused/init rename to levels/en/unused/init diff --git a/levels/unused/pull-push b/levels/en/unused/pull-push similarity index 100% rename from levels/unused/pull-push rename to levels/en/unused/pull-push diff --git a/levels/unused/remotes-add b/levels/en/unused/remotes-add similarity index 100% rename from levels/unused/remotes-add rename to levels/en/unused/remotes-add diff --git a/levels/unused/remotes-delete b/levels/en/unused/remotes-delete similarity index 100% rename from levels/unused/remotes-delete rename to levels/en/unused/remotes-delete diff --git a/levels/unused/restore b/levels/en/unused/restore similarity index 100% rename from levels/unused/restore rename to levels/en/unused/restore diff --git a/levels/unused/split b/levels/en/unused/split similarity index 100% rename from levels/unused/split rename to levels/en/unused/split diff --git a/levels/unused/steps b/levels/en/unused/steps similarity index 100% rename from levels/unused/steps rename to levels/en/unused/steps diff --git a/levels/unused/who-are-you b/levels/en/unused/who-are-you similarity index 100% rename from levels/unused/who-are-you rename to levels/en/unused/who-are-you diff --git a/levels/workflows/gitignore b/levels/en/workflows/gitignore similarity index 100% rename from levels/workflows/gitignore rename to levels/en/workflows/gitignore diff --git a/levels/workflows/pr b/levels/en/workflows/pr similarity index 100% rename from levels/workflows/pr rename to levels/en/workflows/pr diff --git a/levels/workflows/sequence b/levels/en/workflows/sequence similarity index 100% rename from levels/workflows/sequence rename to levels/en/workflows/sequence diff --git a/project.godot b/project.godot index 8af698d..808e7e6 100644 --- a/project.godot +++ b/project.godot @@ -149,6 +149,10 @@ mute={ ] } +[locale] + +translations=PoolStringArray( "res://resources/localizations.en.translation", "res://resources/localizations.it.translation" ) + [network] limits/debugger_stdout/max_chars_per_second=100000 diff --git a/resources/localizations.csv b/resources/localizations.csv new file mode 100644 index 0000000..12f76b2 --- /dev/null +++ b/resources/localizations.csv @@ -0,0 +1,17 @@ +keys,en,it +LEVELS,Livels,Livelli +QUIT,Quit,Esci +BACK,Back,Indietro +RELOAD,Reload,Ricarica +MUSIC,Toggle Music,Musica +NEXT_LEVEL,Next Level,Prossimo Livello +GIT_MESSAGE,"Hi! It seems that you don't have Git installed yet! + +On Linux, please install it from your package manager, usually the package is called "git"! + +On macOS 10.8 and below, you can download Git from git-scm.com.","Ciao! Sembra che tu non abbia ancora installato Git! + +Su Linux, installalo dal tuo gestore di pacchetti, di solito il pacchetto si chiama "git"! + +Su macOS 10.8 e versioni precedenti, puoi scaricare Git da git-scm.com." +INSTALL,"Sure, I'll install it!","Sicuro, lo installerĂ²" \ No newline at end of file diff --git a/resources/localizations.csv.import b/resources/localizations.csv.import new file mode 100644 index 0000000..e2044a4 --- /dev/null +++ b/resources/localizations.csv.import @@ -0,0 +1,16 @@ +[remap] + +importer="csv_translation" +type="Translation" + +[deps] + +files=[ "res://resources/localizations.en.translation", "res://resources/localizations.it.translation" ] + +source_file="res://resources/localizations.csv" +dest_files=[ "res://resources/localizations.en.translation", "res://resources/localizations.it.translation" ] + +[params] + +compress=true +delimiter=0 diff --git a/resources/localizations.en.translation b/resources/localizations.en.translation new file mode 100644 index 0000000..b578dfb Binary files /dev/null and b/resources/localizations.en.translation differ diff --git a/resources/localizations.it.translation b/resources/localizations.it.translation new file mode 100644 index 0000000..1346041 Binary files /dev/null and b/resources/localizations.it.translation differ diff --git a/scenes/card.tscn b/scenes/card.tscn index 55c230f..9de01e4 100644 --- a/scenes/card.tscn +++ b/scenes/card.tscn @@ -170,5 +170,6 @@ stretch_mode = 6 __meta__ = { "_edit_use_anchors_": false } + [connection signal="mouse_entered" from="Area2D" to="." method="_mouse_entered"] [connection signal="mouse_exited" from="Area2D" to="." method="_mouse_exited"] diff --git a/scenes/cards.gd b/scenes/cards.gd index d68dc02..e6373d3 100644 --- a/scenes/cards.gd +++ b/scenes/cards.gd @@ -3,7 +3,7 @@ extends Control var card_store = {} var cards var card_radius = 1500 -var lang = "it" # TODO: Make a global variable to setting dir and cards localizations +#var lang = "it" # TODO: Make a global variable to setting dir and cards localizations func _ready(): load_card_store() @@ -17,7 +17,7 @@ func _process(_delta): func load_card_store(): card_store = {} - var cards_json = JSON.parse(helpers.read_file("res://resources/cards_i18n.json")).result + var cards_json = JSON.parse(helpers.read_file("res://resources/cards.json")).result for card in cards_json: card_store[card["id"]] = card @@ -40,7 +40,7 @@ func draw_card(card): new_card.id = card["id"] new_card.command = card["command"] - new_card.description = card["description"][lang] + new_card.description = card["description"][helpers.lang] new_card.energy = 0 #card.energy new_card.position = Vector2(rect_size.x, rect_size.y*2) add_child(new_card) diff --git a/scenes/cards.tscn b/scenes/cards.tscn index 1fc2fcc..bc678d1 100644 --- a/scenes/cards.tscn +++ b/scenes/cards.tscn @@ -49,4 +49,5 @@ text = "3" __meta__ = { "_edit_use_anchors_": false } + [connection signal="pressed" from="Button" to="." method="redraw_all_cards"] diff --git a/scenes/chapter.gd b/scenes/chapter.gd index 9f2abc2..b0c9ad4 100644 --- a/scenes/chapter.gd +++ b/scenes/chapter.gd @@ -13,7 +13,7 @@ func load(path): var level_names = [] var dir = Directory.new() - dir.open("res://levels/%s" % slug) + dir.open("res://levels/" + helpers.lang + "/%s" % slug) dir.list_dir_begin() while true: @@ -28,7 +28,7 @@ func load(path): var final_level_sequence = [] - var level_sequence = Array(helpers.read_file("res://levels/%s/sequence" % slug, "").split("\n")) + var level_sequence = Array(helpers.read_file("res://levels/" + helpers.lang + "/%s/sequence" % slug, "").split("\n")) for level in level_sequence: if level == "": @@ -42,7 +42,7 @@ func load(path): for l in final_level_sequence: var level = Level.new() - level.load("res://levels/%s/%s" % [slug, l]) + level.load("res://levels/" + helpers.lang + "/%s/%s" % [slug, l]) levels.push_back(level) func _to_string(): diff --git a/scenes/drop_area.tscn b/scenes/drop_area.tscn index ed564e6..8a85979 100644 --- a/scenes/drop_area.tscn +++ b/scenes/drop_area.tscn @@ -45,5 +45,6 @@ material = SubResource( 3 ) position = Vector2( -0.102825, -0.377726 ) scale = Vector2( 2.25501, 2.25501 ) texture = ExtResource( 2 ) + [connection signal="area_entered" from="Area2D" to="." method="_mouse_entered"] [connection signal="area_exited" from="Area2D" to="." method="_mouse_exited"] diff --git a/scenes/file_browser.tscn b/scenes/file_browser.tscn index cbc6bec..7bfbe1d 100644 --- a/scenes/file_browser.tscn +++ b/scenes/file_browser.tscn @@ -131,5 +131,6 @@ __meta__ = { [node name="PopupMenu" type="PopupMenu" parent="."] margin_right = 20.0 margin_bottom = 20.0 + [connection signal="pressed" from="Panel/TextEdit/SaveButton" to="." method="save"] [connection signal="pressed" from="Panel/TextEdit/CloseButton" to="." method="close"] diff --git a/scenes/file_browser_item.tscn b/scenes/file_browser_item.tscn index d623e75..4ceb076 100644 --- a/scenes/file_browser_item.tscn +++ b/scenes/file_browser_item.tscn @@ -122,4 +122,5 @@ autowrap = true [node name="PopupMenu" type="PopupMenu" parent="."] margin_right = 20.0 margin_bottom = 20.0 + [connection signal="id_pressed" from="PopupMenu" to="." method="_popup_menu_pressed"] diff --git a/scenes/helpers.gd b/scenes/helpers.gd index 57dd61f..6d983d7 100644 --- a/scenes/helpers.gd +++ b/scenes/helpers.gd @@ -1,5 +1,7 @@ extends Node +var lang = "it" # Variable for localization + var debug_file_io = false # Crash the game and display the error message. diff --git a/scenes/input_dialog.tscn b/scenes/input_dialog.tscn index 17876b9..4642eed 100644 --- a/scenes/input_dialog.tscn +++ b/scenes/input_dialog.tscn @@ -21,4 +21,5 @@ anchor_bottom = 1.0 __meta__ = { "_edit_use_anchors_": false } + [connection signal="text_entered" from="LineEdit" to="." method="_text_entered"] diff --git a/scenes/level_select.gd b/scenes/level_select.gd index acd0866..42bff1b 100644 --- a/scenes/level_select.gd +++ b/scenes/level_select.gd @@ -15,6 +15,7 @@ func back(): func reload(): + for child in level_list.get_children(): child.queue_free() diff --git a/scenes/level_select.tscn b/scenes/level_select.tscn index 2f8e4f3..d60e69e 100644 --- a/scenes/level_select.tscn +++ b/scenes/level_select.tscn @@ -42,35 +42,11 @@ margin_right = 1320.0 margin_bottom = 1080.0 size_flags_horizontal = 3 -[node name="Button" type="Button" parent="."] -margin_left = 61.0902 -margin_top = 59.0538 -margin_right = 126.09 -margin_bottom = 98.0538 -text = "Back" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Button2" type="Button" parent="."] -margin_left = 138.588 -margin_top = 59.3009 -margin_right = 226.588 -margin_bottom = 98.3009 -focus_mode = 0 -enabled_focus_mode = 0 -text = "Reload" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Button3" parent="." instance=ExtResource( 4 )] - [node name="HelpLabel" type="Label" parent="."] visible = false margin_left = 63.0 margin_top = 159.0 -margin_right = 378.0 +margin_right = 379.0 margin_bottom = 220.0 text = "Help us improving Oh My Git! by answering some questions:" @@ -90,6 +66,41 @@ text = "To the survey /o/" __meta__ = { "_edit_use_anchors_": false } -[connection signal="pressed" from="Button" to="." method="back"] -[connection signal="pressed" from="Button2" to="." method="reload"] + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +anchor_right = 1.0 +margin_left = 89.0 +margin_top = 24.0 +margin_bottom = 63.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Back" type="Button" parent="HBoxContainer"] +margin_right = 75.0 +margin_bottom = 39.0 +text = "BACK" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Reload" type="Button" parent="HBoxContainer"] +margin_left = 80.0 +margin_right = 188.0 +margin_bottom = 39.0 +focus_mode = 0 +enabled_focus_mode = 0 +text = "RELOAD" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Toggle_Music" parent="HBoxContainer" instance=ExtResource( 4 )] +margin_left = 193.0 +margin_top = 0.0 +margin_right = 282.0 +margin_bottom = 39.0 + [connection signal="pressed" from="HelpLabel/Button3" to="." method="onSurveyPressed"] +[connection signal="pressed" from="HBoxContainer/Back" to="." method="back"] +[connection signal="pressed" from="HBoxContainer/Reload" to="." method="reload"] diff --git a/scenes/levels.gd b/scenes/levels.gd index 593b728..07d645c 100644 --- a/scenes/levels.gd +++ b/scenes/levels.gd @@ -9,7 +9,7 @@ func reload(): chapters = [] var dir = Directory.new() - dir.open("res://levels") + dir.open("res://levels/" + helpers.lang) # TODO: Add language directory to get a correct language dir.list_dir_begin() var chapter_names = [] @@ -26,7 +26,7 @@ func reload(): var final_chapter_sequence = [] - var chapter_sequence = Array(helpers.read_file("res://levels/sequence", "").split("\n")) + var chapter_sequence = Array(helpers.read_file("res://levels/" + helpers.lang + "/sequence", "").split("\n")) for chapter in chapter_sequence: if chapter == "": @@ -40,5 +40,5 @@ func reload(): for c in final_chapter_sequence: var chapter = Chapter.new() - chapter.load("res://levels/%s" % c) + chapter.load("res://levels/" + helpers.lang + "/%s" % c) chapters.push_back(chapter) diff --git a/scenes/main.tscn b/scenes/main.tscn index e19dec2..303f9a7 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -206,31 +206,31 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="BackButton" type="Button" parent="Menu"] -margin_right = 65.0 +[node name="Back" type="Button" parent="Menu"] +margin_right = 75.0 margin_bottom = 39.0 focus_mode = 0 enabled_focus_mode = 0 -text = "Back" +text = "BACK" __meta__ = { "_edit_use_anchors_": false } -[node name="ReloadButton2" type="Button" parent="Menu"] -margin_left = 73.0 -margin_right = 161.0 +[node name="Reload" type="Button" parent="Menu"] +margin_left = 83.0 +margin_right = 191.0 margin_bottom = 39.0 focus_mode = 0 enabled_focus_mode = 0 -text = "Reload" +text = "RELOAD" __meta__ = { "_edit_use_anchors_": false } [node name="CardsButton" type="Button" parent="Menu"] visible = false -margin_left = 458.0 -margin_right = 539.0 +margin_left = 169.0 +margin_right = 250.0 margin_bottom = 39.0 focus_mode = 0 enabled_focus_mode = 0 @@ -251,35 +251,36 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Button3" parent="Menu" instance=ExtResource( 11 )] -margin_left = 169.0 +[node name="Toogle_Music" parent="Menu" instance=ExtResource( 11 )] +margin_left = 199.0 margin_top = 0.0 -margin_right = 315.0 +margin_right = 288.0 margin_bottom = 39.0 [node name="CLIBadge" parent="Menu" instance=ExtResource( 10 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_left = 323.0 -margin_right = 368.0 +margin_left = 296.0 +margin_right = 341.0 margin_bottom = 39.0 [node name="NextLevelButton" type="Button" parent="Menu"] -margin_left = 376.0 -margin_right = 493.0 +margin_left = 349.0 +margin_right = 501.0 margin_bottom = 39.0 focus_mode = 0 custom_styles/hover = SubResource( 2 ) custom_styles/normal = ExtResource( 4 ) enabled_focus_mode = 0 -text = "Next level" +text = "NEXT_LEVEL" __meta__ = { "_edit_use_anchors_": false } + [connection signal="saved" from="Rows/Columns/RightSide/FileBrowser" to="." method="update_repos"] [connection signal="command_done" from="Rows/Controls/Terminal" to="." method="update_repos"] -[connection signal="pressed" from="Menu/BackButton" to="." method="back"] -[connection signal="pressed" from="Menu/ReloadButton2" to="." method="reload_level"] +[connection signal="pressed" from="Menu/Back" to="." method="back"] +[connection signal="pressed" from="Menu/Reload" to="." method="reload_level"] [connection signal="pressed" from="Menu/CardsButton" to="." method="toggle_cards"] [connection signal="pressed" from="Menu/Tip!" to="." method="new_tip"] [connection signal="pressed" from="Menu/NextLevelButton" to="." method="load_next_level"] diff --git a/scenes/music_button.gd b/scenes/music_button.gd index 6cc4e03..330356a 100644 --- a/scenes/music_button.gd +++ b/scenes/music_button.gd @@ -1,6 +1,5 @@ extends Button - func _ready(): pass diff --git a/scenes/music_button.tscn b/scenes/music_button.tscn index 70f47b0..a48cc46 100644 --- a/scenes/music_button.tscn +++ b/scenes/music_button.tscn @@ -2,16 +2,17 @@ [ext_resource path="res://scenes/music_button.gd" type="Script" id=1] -[node name="Button3" type="Button"] +[node name="Toggle_music" type="Button"] margin_left = 241.005 margin_top = 58.856 margin_right = 387.005 margin_bottom = 97.856 focus_mode = 0 enabled_focus_mode = 0 -text = "Toggle music" +text = "MUSIC" script = ExtResource( 1 ) __meta__ = { "_edit_use_anchors_": false } + [connection signal="pressed" from="." to="." method="toggle_music"] diff --git a/scenes/no_git.tscn b/scenes/no_git.tscn index b4cad7c..60bc98c 100644 --- a/scenes/no_git.tscn +++ b/scenes/no_git.tscn @@ -58,11 +58,11 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Button" type="Button" parent="VBoxContainer"] +[node name="Levels" type="Button" parent="VBoxContainer"] visible = false margin_right = 351.0 margin_bottom = 39.0 -text = "Levels" +text = "LEVELS" [node name="Button3" type="Button" parent="VBoxContainer"] visible = false @@ -70,10 +70,10 @@ margin_right = 351.0 margin_bottom = 39.0 text = "Sandbox" -[node name="Button2" type="Button" parent="VBoxContainer"] +[node name="Install" type="Button" parent="VBoxContainer"] margin_right = 351.0 margin_bottom = 39.0 -text = "Sure, I'll install it!" +text = "INSTALL" [node name="Sprite" type="Sprite" parent="."] @@ -94,12 +94,12 @@ margin_left = 20.0 margin_top = 21.0 margin_right = 546.0 margin_bottom = 252.0 -text = "Hi! It seems that you don't have Git installed yet! - -On Linux, please install it from your package manager, usually the package is called \"git\"! - -On macOS 10.8 and below, you can download Git from git-scm.com." +text = "GIT_MESSAGE" autowrap = true -[connection signal="pressed" from="VBoxContainer/Button" to="." method="levels"] +__meta__ = { +"_edit_use_anchors_": false +} + +[connection signal="pressed" from="VBoxContainer/Levels" to="." method="levels"] [connection signal="pressed" from="VBoxContainer/Button3" to="." method="sandbox"] -[connection signal="pressed" from="VBoxContainer/Button2" to="." method="quit"] +[connection signal="pressed" from="VBoxContainer/Install" to="." method="quit"] diff --git a/scenes/node.tscn b/scenes/node.tscn index 643a44c..f951214 100644 --- a/scenes/node.tscn +++ b/scenes/node.tscn @@ -81,6 +81,7 @@ custom_colors/font_color = Color( 1, 1, 1, 1 ) __meta__ = { "_edit_use_anchors_": false } + [connection signal="mouse_entered" from="Rect" to="." method="_on_hover"] [connection signal="mouse_exited" from="Rect" to="." method="_on_unhover"] [connection signal="mouse_entered" from="Area2D" to="." method="_on_hover"] diff --git a/scenes/notification.tscn b/scenes/notification.tscn index 5d944e0..3b552c5 100644 --- a/scenes/notification.tscn +++ b/scenes/notification.tscn @@ -60,4 +60,5 @@ text = "Got it!" __meta__ = { "_edit_use_anchors_": false } + [connection signal="pressed" from="Panel/CenterContainer/OK" to="." method="confirm"] diff --git a/scenes/title.tscn b/scenes/title.tscn index f919e19..2aa0fe7 100644 --- a/scenes/title.tscn +++ b/scenes/title.tscn @@ -52,7 +52,7 @@ __meta__ = { [node name="Button" type="Button" parent="VBoxContainer"] margin_right = 351.0 margin_bottom = 39.0 -text = "Levels" +text = "LEVELS" [node name="Button3" type="Button" parent="VBoxContainer"] margin_top = 44.0 @@ -64,7 +64,7 @@ text = "Sandbox" margin_top = 88.0 margin_right = 351.0 margin_bottom = 127.0 -text = "Quit" +text = "QUIT" [node name="Sprite" type="Sprite" parent="."]