From 5791514d437dd7f93434c8ffeec47045ea989f30 Mon Sep 17 00:00:00 2001 From: VAILLANT Jeremy Date: Thu, 13 May 2021 15:39:15 +0200 Subject: [PATCH] Replace scene about by settings --- locales/en.po | 19 +++++++----- locales/fr.po | 19 +++++++----- locales/model.pot | 19 +++++++----- scenes/UI/About.tscn | 57 ----------------------------------- scenes/UI/Settings.tscn | 67 +++++++++++++++++++++++++++++++++++++++++ scenes/main.gd | 14 ++++----- scenes/main.tscn | 26 +++++----------- 7 files changed, 113 insertions(+), 108 deletions(-) delete mode 100644 scenes/UI/About.tscn create mode 100644 scenes/UI/Settings.tscn diff --git a/locales/en.po b/locales/en.po index e5284a2..25e5421 100644 --- a/locales/en.po +++ b/locales/en.po @@ -12,20 +12,23 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Language: en\n" -msgid "MAIN_BUTTON_NEW" -msgstr "Start game" +msgid "MAIN_BUTTON_PUZZLES" +msgstr "Puzzles" -msgid "MAIN_BUTTON_CONTINUE" -msgstr "Continue" - -msgid "MAIN_BUTTON_ABOUT" -msgstr "About" +msgid "MAIN_BUTTON_SETTINGS" +msgstr "Settings" msgid "MAIN_BUTTON_QUIT" msgstr "Exit" +msgid "SETTINGS_LABEL_LANGUE" +msgstr "Choose your language :" + +msgid "SETTINGS_LABEL_GYROSCOPE" +msgstr "Enable gyroscope :" + msgid "LOADING" -msgstr "Loading ..." +msgstr "Loading" msgid "ABOUT_LEAD_DEV" msgstr "Lead Developer -- VAILLANT Jérémy" diff --git a/locales/fr.po b/locales/fr.po index ad25b42..d3b0752 100644 --- a/locales/fr.po +++ b/locales/fr.po @@ -11,20 +11,23 @@ msgstr "" "Language: fr\n" "X-Generator: Poedit 2.4.1\n" -msgid "MAIN_BUTTON_NEW" -msgstr "Commencer" +msgid "MAIN_BUTTON_PUZZLES" +msgstr "Puzzles" -msgid "MAIN_BUTTON_CONTINUE" -msgstr "Continue" - -msgid "MAIN_BUTTON_ABOUT" -msgstr "Credit" +msgid "MAIN_BUTTON_SETTINGS" +msgstr "Parametres" msgid "MAIN_BUTTON_QUIT" msgstr "Quit" +msgid "SETTINGS_LABEL_LANGUE" +msgstr "Choisir sa language :" + +msgid "SETTINGS_LABEL_GYROSCOPE" +msgstr "Utiliser le gyroscope :" + msgid "LOADING" -msgstr "Chargement ..." +msgstr "Chargement" msgid "ABOUT_LEAD_DEV" msgstr "Lead Developer -- VAILLANT Jérémy" diff --git a/locales/model.pot b/locales/model.pot index cc02f60..1869b3f 100644 --- a/locales/model.pot +++ b/locales/model.pot @@ -12,20 +12,23 @@ msgstr "" "Language: en\n" "X-Generator: Poedit 2.4.1\n" -msgid "MAIN_BUTTON_NEW" -msgstr "Start game" +msgid "MAIN_BUTTON_PUZZLES" +msgstr "Puzzles" -msgid "MAIN_BUTTON_CONTINUE" -msgstr "Continue" - -msgid "MAIN_BUTTON_ABOUT" -msgstr "About" +msgid "MAIN_BUTTON_SETTINGS" +msgstr "Settings" msgid "MAIN_BUTTON_QUIT" msgstr "Exit" +msgid "SETTINGS_LABEL_LANGUE" +msgstr "Choose your language :" + +msgid "SETTINGS_LABEL_GYROSCOPE" +msgstr "Enable gyroscope :" + msgid "LOADING" -msgstr "Loading ..." +msgstr "Loading" msgid "ABOUT_LEAD_DEV" msgstr "Lead Developer -- VAILLANT Jérémy" diff --git a/scenes/UI/About.tscn b/scenes/UI/About.tscn deleted file mode 100644 index 34dd3bc..0000000 --- a/scenes/UI/About.tscn +++ /dev/null @@ -1,57 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[sub_resource type="GDScript" id=1] -script/source = "extends Node - -func _ready(): - $CenterContainer/VBoxContainer/LeadDev.text = tr(\"ABOUT_LEAD_DEV\") - $CenterContainer/VBoxContainer/LeadArtist.text = tr(\"ABOUT_LEAD_ARTIST\") - $CenterContainer/VBoxContainer/Sources.text = tr(\"ABOUT_SOURCE_GAME\") -" - -[node name="About" type="Node"] -script = SubResource( 1 ) - -[node name="CenterContainer" type="CenterContainer" parent="."] -margin_left = 150.0 -margin_right = 1024.0 -margin_bottom = 600.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] -margin_left = 210.0 -margin_top = 275.0 -margin_right = 663.0 -margin_bottom = 325.0 -alignment = 1 - -[node name="LeadDev" type="Label" parent="CenterContainer/VBoxContainer"] -margin_right = 453.0 -margin_bottom = 14.0 -text = "Lead Develop : GRem -- VAILLANT Jérémy" -align = 1 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="LeadArtist" type="Label" parent="CenterContainer/VBoxContainer"] -margin_top = 18.0 -margin_right = 453.0 -margin_bottom = 32.0 -text = "Lead Artist : Stilobique -- VAILLANT Aurelien" -align = 1 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Sources" type="Label" parent="CenterContainer/VBoxContainer"] -margin_top = 36.0 -margin_right = 453.0 -margin_bottom = 50.0 -text = "Source code of game : https://dev.stilobique.com/Athena/game-source" -align = 1 -__meta__ = { -"_edit_use_anchors_": false -} diff --git a/scenes/UI/Settings.tscn b/scenes/UI/Settings.tscn new file mode 100644 index 0000000..0883008 --- /dev/null +++ b/scenes/UI/Settings.tscn @@ -0,0 +1,67 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://addons/godot_db_manager/tables_list.gd" type="Script" id=1] + +[sub_resource type="GDScript" id=1] +script/source = "extends Node + +func _ready(): + $CenterContainer/VBoxContainer/Langue/Label.text = tr(\"SETTINGS_LABEL_LANGUE\") + $CenterContainer/VBoxContainer/gyroscope/Label.text = tr(\"SETTINGS_LABEL_GYROSCOPE\") + +func _on_Gyroscope_pressed(): + print(\"[Settings#_on_Gyroscope_pressed]\") +" + +[node name="About" type="Node"] +script = SubResource( 1 ) + +[node name="CenterContainer" type="CenterContainer" parent="."] +margin_left = 150.0 +margin_right = 1024.0 +margin_bottom = 600.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] +margin_left = 400.0 +margin_top = 284.0 +margin_right = 473.0 +margin_bottom = 316.0 +alignment = 1 + +[node name="Langue" type="CenterContainer" parent="CenterContainer/VBoxContainer"] +margin_right = 73.0 +margin_bottom = 14.0 + +[node name="Label" type="Label" parent="CenterContainer/VBoxContainer/Langue"] +margin_left = 11.0 +margin_right = 61.0 +margin_bottom = 14.0 +text = "langue :" + +[node name="GDDBTablesList" type="Control" parent="CenterContainer/VBoxContainer/Langue"] +margin_left = 36.0 +margin_top = 7.0 +margin_right = 36.0 +margin_bottom = 7.0 +script = ExtResource( 1 ) + +[node name="gyroscope" type="CenterContainer" parent="CenterContainer/VBoxContainer"] +margin_top = 18.0 +margin_right = 73.0 +margin_bottom = 32.0 + +[node name="Label" type="Label" parent="CenterContainer/VBoxContainer/gyroscope"] +margin_right = 73.0 +margin_bottom = 14.0 +text = "gyroscope :" + +[node name="TextureButton" type="TextureButton" parent="CenterContainer/VBoxContainer/gyroscope"] +margin_left = 36.0 +margin_top = 7.0 +margin_right = 36.0 +margin_bottom = 7.0 + +[connection signal="pressed" from="CenterContainer/VBoxContainer/gyroscope/TextureButton" to="." method="_on_Gyroscope_pressed"] diff --git a/scenes/main.gd b/scenes/main.gd index 6902d50..39cb207 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -1,6 +1,6 @@ extends Node -export (PackedScene) var about = load("res://scenes/UI/About.tscn") +export (PackedScene) var settings = load("res://scenes/UI/Settings.tscn") export (PackedScene) var scenes = load("res://scenes/UI/ChooseScene.tscn") const max_diff = 0.08 @@ -9,20 +9,18 @@ var current_scene = null var value_old = Vector2(0, 0) func _ready(): - print(tr("MESSAGE_READY")) - $Grid/Menu/Action/New.text = tr("MAIN_BUTTON_NEW") - $Grid/Menu/Action/Continue.text = tr("MAIN_BUTTON_CONTINUE") - $Grid/Menu/Action/About.text = tr("MAIN_BUTTON_ABOUT") + $Grid/Menu/Action/Puzzles.text = tr("MAIN_BUTTON_PUZZLES") + $Grid/Menu/Action/Settings.text = tr("MAIN_BUTTON_SETTINGS") $Grid/Menu/Action/Quit.text = tr("MAIN_BUTTON_QUIT") # Quit the game func _on_Quit_pressed(): get_tree().quit(0) -# Load scene about -func _on_About_pressed(): +# Load scene settings +func _on_Settings_pressed(): _prepare_change_scene() - current_scene = about.instance() + current_scene = settings.instance() add_child(current_scene) # Load scene for select game diff --git a/scenes/main.tscn b/scenes/main.tscn index ac0e000..a15d1ab 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -76,36 +76,24 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="New" type="LinkButton" parent="Grid/Menu/Action"] +[node name="Puzzles" type="LinkButton" parent="Grid/Menu/Action"] margin_left = 10.0 margin_top = 30.0 margin_right = 130.0 margin_bottom = 64.0 custom_fonts/font = ExtResource( 3 ) -text = "new" +text = "Puzzles" __meta__ = { "_edit_use_anchors_": false } -[node name="Continue" type="LinkButton" parent="Grid/Menu/Action"] -margin_left = 10.0 -margin_top = 80.0 -margin_right = 136.0 -margin_bottom = 114.0 -custom_fonts/font = ExtResource( 3 ) -disabled = true -text = "Reprendre" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="About" type="LinkButton" parent="Grid/Menu/Action"] +[node name="Settings" type="LinkButton" parent="Grid/Menu/Action"] margin_left = 10.0 margin_top = 130.0 -margin_right = 86.0 +margin_right = 114.0 margin_bottom = 164.0 custom_fonts/font = ExtResource( 3 ) -text = "Credit" +text = "Settings" __meta__ = { "_edit_use_anchors_": false } @@ -122,6 +110,6 @@ __meta__ = { "_edit_use_anchors_": false } -[connection signal="pressed" from="Grid/Menu/Action/New" to="." method="_on_New_pressed"] -[connection signal="pressed" from="Grid/Menu/Action/About" to="." method="_on_About_pressed"] +[connection signal="pressed" from="Grid/Menu/Action/Puzzles" to="." method="_on_New_pressed"] +[connection signal="pressed" from="Grid/Menu/Action/Settings" to="." method="_on_Settings_pressed"] [connection signal="pressed" from="Grid/Menu/Action/Quit" to="." method="_on_Quit_pressed"]