Added translations management
Prepares work for line voiceovers management.
This commit is contained in:
BIN
game/ui/commons/main_menu/flags/en_EN.png
Normal file
BIN
game/ui/commons/main_menu/flags/en_EN.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
BIN
game/ui/commons/main_menu/flags/en_EN_small.png
Normal file
BIN
game/ui/commons/main_menu/flags/en_EN_small.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
BIN
game/ui/commons/main_menu/flags/fr_FR.png
Normal file
BIN
game/ui/commons/main_menu/flags/fr_FR.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
BIN
game/ui/commons/main_menu/flags/fr_FR_small.png
Normal file
BIN
game/ui/commons/main_menu/flags/fr_FR_small.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
54
game/ui/commons/main_menu/main.tscn
Normal file
54
game/ui/commons/main_menu/main.tscn
Normal file
@@ -0,0 +1,54 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=1]
|
||||
|
||||
[node name="main" type="VBoxContainer"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -179.0
|
||||
margin_top = -35.746
|
||||
margin_right = 179.0
|
||||
margin_bottom = 227.254
|
||||
custom_constants/separation = 10
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="new_game" type="Button" parent="."]
|
||||
margin_right = 358.0
|
||||
margin_bottom = 152.0
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "NEW_GAME"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="load_game" type="Button" parent="."]
|
||||
margin_top = 162.0
|
||||
margin_right = 358.0
|
||||
margin_bottom = 189.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "LOAD_GAME"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="options" type="Button" parent="."]
|
||||
margin_top = 199.0
|
||||
margin_right = 358.0
|
||||
margin_bottom = 226.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "OPTIONS"
|
||||
|
||||
[node name="quit" type="Button" parent="."]
|
||||
margin_top = 236.0
|
||||
margin_right = 358.0
|
||||
margin_bottom = 263.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "QUIT"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
@@ -5,6 +5,18 @@ func _ready():
|
||||
escoria.esc_level_runner.set_sound_state(["bg_music",
|
||||
"res://game/sfx/Game-Menu_Looping.mp3", true])
|
||||
|
||||
|
||||
func _on_continue_pressed():
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
func switch_language(lang : String):
|
||||
TranslationServer.set_locale(lang)
|
||||
|
||||
|
||||
func _on_new_game_pressed():
|
||||
escoria.new_game()
|
||||
|
||||
@@ -12,9 +24,19 @@ func _on_load_game_pressed():
|
||||
# Show Loading screen
|
||||
pass
|
||||
|
||||
func _on_options_pressed():
|
||||
$Panel/main.hide()
|
||||
$Panel/options.show()
|
||||
|
||||
func _on_quit_pressed():
|
||||
get_tree().quit()
|
||||
|
||||
###########################################################################
|
||||
###########################################################################
|
||||
# OPTIONS
|
||||
|
||||
func _on_continue_pressed():
|
||||
pass # Replace with function body.
|
||||
|
||||
func _on_back_pressed():
|
||||
$Panel/options.hide()
|
||||
$Panel/main.show()
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://game/ui/commons/main_menu/main_menu.gd" type="Script" id=1]
|
||||
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://game/ui/commons/main_menu/main.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/escoria-core/logo/escoria-logo-small.png" type="Texture" id=3]
|
||||
[ext_resource path="res://game/ui/commons/main_menu/options.tscn" type="PackedScene" id=4]
|
||||
|
||||
[node name="main_menu" type="Control"]
|
||||
anchor_right = 1.0
|
||||
@@ -32,50 +33,16 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -179.0
|
||||
margin_top = -35.746
|
||||
margin_right = 179.0
|
||||
margin_bottom = 227.254
|
||||
custom_constants/separation = 10
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
[node name="main" parent="Panel" instance=ExtResource( 2 )]
|
||||
|
||||
[node name="new_game" type="Button" parent="Panel/VBoxContainer"]
|
||||
margin_right = 358.0
|
||||
margin_bottom = 189.0
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "New game"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
[node name="options" parent="Panel" instance=ExtResource( 4 )]
|
||||
visible = false
|
||||
|
||||
[node name="load_game" type="Button" parent="Panel/VBoxContainer"]
|
||||
margin_top = 199.0
|
||||
margin_right = 358.0
|
||||
margin_bottom = 226.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Load game"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
[connection signal="pressed" from="Panel/main/new_game" to="." method="_on_new_game_pressed"]
|
||||
[connection signal="pressed" from="Panel/main/load_game" to="." method="_on_load_game_pressed"]
|
||||
[connection signal="pressed" from="Panel/main/options" to="." method="_on_options_pressed"]
|
||||
[connection signal="pressed" from="Panel/main/quit" to="." method="_on_quit_pressed"]
|
||||
[connection signal="pressed" from="Panel/options/back" to="." method="_on_back_pressed"]
|
||||
|
||||
[node name="quit" type="Button" parent="Panel/VBoxContainer"]
|
||||
margin_top = 236.0
|
||||
margin_right = 358.0
|
||||
margin_bottom = 263.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Quit"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="Panel/VBoxContainer/new_game" to="." method="_on_new_game_pressed"]
|
||||
[connection signal="pressed" from="Panel/VBoxContainer/load_game" to="." method="_on_load_game_pressed"]
|
||||
[connection signal="pressed" from="Panel/VBoxContainer/quit" to="." method="_on_quit_pressed"]
|
||||
[editable path="Panel/main"]
|
||||
[editable path="Panel/options"]
|
||||
|
||||
11
game/ui/commons/main_menu/options.gd
Normal file
11
game/ui/commons/main_menu/options.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends Control
|
||||
|
||||
func _ready():
|
||||
var locale = TranslationServer.get_locale()
|
||||
|
||||
func greyout_other_languages(except_lang : String) -> void:
|
||||
pass
|
||||
|
||||
func _on_language_input(event : InputEvent, language : String):
|
||||
if event.is_pressed():
|
||||
TranslationServer.set_locale(language)
|
||||
75
game/ui/commons/main_menu/options.tscn
Normal file
75
game/ui/commons/main_menu/options.tscn
Normal file
@@ -0,0 +1,75 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://game/ui/commons/main_menu/flags/en_EN_small.png" type="Texture" id=2]
|
||||
[ext_resource path="res://game/ui/commons/main_menu/flags/fr_FR_small.png" type="Texture" id=3]
|
||||
[ext_resource path="res://game/ui/commons/main_menu/options.gd" type="Script" id=4]
|
||||
|
||||
[node name="options" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="back" type="Button" parent="."]
|
||||
margin_left = 130.0
|
||||
margin_top = 329.0
|
||||
margin_right = 304.0
|
||||
margin_bottom = 383.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "OPTIONS_BACK"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="options_grid" type="GridContainer" parent="."]
|
||||
anchor_left = 0.217
|
||||
anchor_top = 0.427
|
||||
anchor_right = 0.803
|
||||
anchor_bottom = 0.574
|
||||
margin_left = 0.23999
|
||||
margin_top = -0.300018
|
||||
margin_right = 17.1599
|
||||
margin_bottom = 0.400024
|
||||
custom_constants/hseparation = 167
|
||||
columns = 2
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="options_language" type="Label" parent="options_grid"]
|
||||
margin_top = 56.0
|
||||
margin_right = 220.0
|
||||
margin_bottom = 77.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "OPTIONS_LANGUAGE"
|
||||
|
||||
[node name="flags" type="HBoxContainer" parent="options_grid"]
|
||||
margin_left = 387.0
|
||||
margin_right = 767.0
|
||||
margin_bottom = 133.0
|
||||
size_flags_vertical = 3
|
||||
custom_constants/separation = 30
|
||||
alignment = 1
|
||||
|
||||
[node name="fr_FR" type="TextureRect" parent="options_grid/flags"]
|
||||
margin_right = 150.0
|
||||
margin_bottom = 133.0
|
||||
texture = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="en_EN" type="TextureRect" parent="options_grid/flags"]
|
||||
margin_left = 180.0
|
||||
margin_right = 380.0
|
||||
margin_bottom = 133.0
|
||||
texture = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="gui_input" from="options_grid/flags/fr_FR" to="." method="_on_language_input" binds= [ "fr_FR" ]]
|
||||
[connection signal="gui_input" from="options_grid/flags/en_EN" to="." method="_on_language_input" binds= [ "en_EN" ]]
|
||||
Reference in New Issue
Block a user