diff --git a/resources/ui/.~lock.i18n.csv# b/resources/ui/.~lock.i18n.csv# index 39f0bff..6b7bf00 100644 --- a/resources/ui/.~lock.i18n.csv# +++ b/resources/ui/.~lock.i18n.csv# @@ -1 +1 @@ -,lhaubaum,lhaubaum-ThinkPad-T430s,24.07.2019 12:59,file:///home/lhaubaum/.config/libreoffice/4; \ No newline at end of file +,lhaubaum,lhaubaum-ThinkPad-T430s,24.07.2019 13:14,file:///home/lhaubaum/.config/libreoffice/4; \ No newline at end of file diff --git a/resources/ui/i18n.csv b/resources/ui/i18n.csv index 271749d..0889bc1 100644 --- a/resources/ui/i18n.csv +++ b/resources/ui/i18n.csv @@ -38,6 +38,7 @@ LOCALE_EN,english,Englisch (english) LOCALE_DE,german (Deutsch),Deutsch GRAPHICS,graphics,Grafik SAVE,save,Speichern +APPLY,apply,Übernehmen KEYBOARD,keyboard,Tastatur JOYPAD,joypad,Joypad SERVER_ADDR,server address,Server Adresse diff --git a/resources/ui/i18n.de.translation b/resources/ui/i18n.de.translation index a957040..689a73a 100644 Binary files a/resources/ui/i18n.de.translation and b/resources/ui/i18n.de.translation differ diff --git a/resources/ui/i18n.en.translation b/resources/ui/i18n.en.translation index aff3f01..03d8316 100644 Binary files a/resources/ui/i18n.en.translation and b/resources/ui/i18n.en.translation differ diff --git a/scenes/menus/BaseMenu.tscn b/scenes/menus/BaseMenu.tscn index 21392a0..e152c0a 100644 --- a/scenes/menus/BaseMenu.tscn +++ b/scenes/menus/BaseMenu.tscn @@ -23,7 +23,10 @@ anchor_top = 1.0 anchor_bottom = 1.0 margin_top = -56.0 margin_right = 132.0 +size_flags_horizontal = 6 +size_flags_vertical = 6 custom_fonts/font = ExtResource( 1 ) text = "BACK" icon = ExtResource( 2 ) flat = true +align = 0 diff --git a/scenes/menus/SettingsMenu.tscn b/scenes/menus/SettingsMenu.tscn index 6d9ab9e..ab31707 100644 --- a/scenes/menus/SettingsMenu.tscn +++ b/scenes/menus/SettingsMenu.tscn @@ -1,11 +1,12 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://resources/ui/theme.tres" type="Theme" id=1] [ext_resource path="res://scripts/menus/settings.gd" type="Script" id=2] [ext_resource path="res://scenes/menus/BaseMenu.tscn" type="PackedScene" id=3] [ext_resource path="res://scenes/menus/SettingsPlayerMenu.tscn" type="PackedScene" id=4] [ext_resource path="res://scenes/menus/SettingsControlsMenu.tscn" type="PackedScene" id=5] -[ext_resource path="res://assets/icons/save.png" type="Texture" id=6] +[ext_resource path="res://assets/icons/checkmark.png" type="Texture" id=6] +[ext_resource path="res://assets/icons/save.png" type="Texture" id=7] [node name="settings_menu" type="Control"] anchor_right = 1.0 @@ -35,7 +36,6 @@ size_flags_vertical = 3 tab_align = 0 [node name="game" type="Tabs" parent="menu/tabs"] -visible = false anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 4.0 @@ -44,7 +44,6 @@ margin_right = -4.0 margin_bottom = -4.0 [node name="GridContainer" type="GridContainer" parent="menu/tabs/game"] -editor/display_folded = true margin_left = 9.0 margin_top = 10.0 margin_right = 416.0 @@ -114,6 +113,7 @@ margin_right = -4.0 margin_bottom = -4.0 [node name="system" type="Tabs" parent="menu/tabs"] +visible = false anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 4.0 @@ -167,24 +167,48 @@ margin_top = 72.0 margin_right = 895.0 margin_bottom = 109.0 -[node name="save" type="Button" parent="menu"] +[node name="GridContainer" type="GridContainer" parent="menu"] anchor_left = 1.0 anchor_top = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 -margin_left = -147.0 +margin_left = -286.0 margin_top = -56.0 grow_horizontal = 0 grow_vertical = 0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "SAVE" +size_flags_horizontal = 10 +size_flags_vertical = 10 +columns = 2 + +[node name="apply" type="Button" parent="menu/GridContainer"] +margin_right = 150.0 +margin_bottom = 56.0 +grow_horizontal = 0 +grow_vertical = 0 +size_flags_horizontal = 10 +size_flags_vertical = 10 +text = "APPLY" icon = ExtResource( 6 ) flat = true +align = 0 + +[node name="save" type="Button" parent="menu/GridContainer"] +margin_left = 154.0 +margin_right = 286.0 +margin_bottom = 56.0 +grow_horizontal = 0 +grow_vertical = 0 +size_flags_horizontal = 10 +size_flags_vertical = 10 +text = "SAVE" +icon = ExtResource( 7 ) +flat = true +align = 0 [connection signal="item_selected" from="menu/tabs/system/GridContainer/locales" to="." method="_on_locales_item_selected"] [connection signal="tree_exiting" from="menu/tabs/system/GridContainer/locales" to="." method="_on_locales_tree_exiting"] [connection signal="visibility_changed" from="menu/tabs/system/GridContainer/locales" to="." method="_init_locales"] -[connection signal="pressed" from="menu/save" to="." method="_on_save_pressed"] +[connection signal="pressed" from="menu/GridContainer/apply" to="." method="_on_apply_pressed"] +[connection signal="pressed" from="menu/GridContainer/save" to="." method="_on_save_pressed"] [editable path="menu"] diff --git a/scripts/menus/settings.gd b/scripts/menus/settings.gd index bb67087..ebcf116 100644 --- a/scripts/menus/settings.gd +++ b/scripts/menus/settings.gd @@ -60,6 +60,11 @@ func _on_locales_tree_exiting(): func _on_save_pressed(): + _on_apply_pressed() + _on_back_pressed() + + +func _on_apply_pressed(): var values = {} values['player_name'] = player_settings.get_name_node().get_text() values['player_color'] = player_settings.get_color_node().color.to_html() @@ -78,6 +83,4 @@ func _on_save_pressed(): local_storage.write_values(values) game_server.set_server_addr(server_addr) - game_server.set_api_addr(api_addr) - - _on_back_pressed() + game_server.set_api_addr(local_storage.read_value("api_addr",game_server.API_ADDR))