Browse Source

small menu improvements

Lurkars 6 years ago
parent
commit
d63704c256
  1. 2
      resources/ui/.~lock.i18n.csv#
  2. 1
      resources/ui/i18n.csv
  3. BIN
      resources/ui/i18n.de.translation
  4. BIN
      resources/ui/i18n.en.translation
  5. 3
      scenes/menus/BaseMenu.tscn
  6. 44
      scenes/menus/SettingsMenu.tscn
  7. 9
      scripts/menus/settings.gd

2
resources/ui/.~lock.i18n.csv#

@ -1 +1 @@
,lhaubaum,lhaubaum-ThinkPad-T430s,24.07.2019 12:59,file:///home/lhaubaum/.config/libreoffice/4;
,lhaubaum,lhaubaum-ThinkPad-T430s,24.07.2019 13:14,file:///home/lhaubaum/.config/libreoffice/4;

1
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

BIN
resources/ui/i18n.de.translation

BIN
resources/ui/i18n.en.translation

3
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

44
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"]

9
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))
Loading…
Cancel
Save