adding settings pannel to update connexion configuration

This commit is contained in:
AleaJactaEst 2019-12-15 21:52:55 +01:00
parent 4e7dc77d95
commit f07103d05e
9 changed files with 363 additions and 176 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 KiB

After

Width:  |  Height:  |  Size: 377 KiB

Binary file not shown.

View file

@ -16,15 +16,25 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
class connexion: class connexion:
var _url_login = "" # var _url_login = "http://http://149.91.80.160/login/r2_login.php"
var _url_register = "" var _url_login = "https://lirria.khaganat.net/login/r2_login.php"
var _khaganat_host = "localhost" # var _url_register = "http://149.91.80.160/ams/index.php?page=register"
var _khaganat_port = "40916" var _url_register = "http://lirria.khaganat.net/ams/index.php?page=register"
var _language = "FR"
var _language = "fr"
var _valid_certificate = true var _valid_certificate = true
func save():
print("[config connexion] Save connexion config")
var config_file = ConfigFile.new()
config_file.set_value("login", "url", _url_login)
config_file.set_value("register", "url", _url_register)
config_file.set_value("global", "valid_certificate", _valid_certificate)
config_file.set_value("global", "language", _language)
config_file.save("user://connexion.cfg")
func _init(): func _init():
print("[config connexion] Load connexion config"); print("[config connexion] Load connexion config")
#var message = load("res://assets/Scripts/Models/nel_login_message.gd") #var message = load("res://assets/Scripts/Models/nel_login_message.gd")
var config_file = ConfigFile.new() var config_file = ConfigFile.new()
@ -32,24 +42,12 @@ class connexion:
var err = config_file.load("user://connexion.cfg") var err = config_file.load("user://connexion.cfg")
if err: if err:
print("Error code when loading player config file khanat.cfg: ", err) print("Error code when loading player config file khanat.cfg: ", err)
config_file.set_value("login", "url", "http://149.91.80.160/login/r2_login.php") save()
config_file.set_value("register", "url", "http://149.91.80.160/ams/index.php?page=register")
config_file.set_value("global", "valid_certificate", false)
config_file.save("user://connexion.cfg")
self._url_login = config_file.get_value("login", "url", "http://172.17.0.3/login/r2_login.php") self._url_login = config_file.get_value("login", "url", self._url_login)
self._url_register = config_file.get_value("register", "url", "http://172.17.0.3/login/r2_login.php") self._url_register = config_file.get_value("register", "url", self._url_register)
self._khaganat_host = config_file.get_value("server", "host", "172.17.0.3") self._language = config_file.get_value("global", "language", self._language)
self._khaganat_port = config_file.get_value("server", "port", "47851") self._valid_certificate = config_file.get_value("global", "valid_certificate", self._valid_certificate)
self._language = config_file.get_value("global", "language", "fr")
self._valid_certificate = config_file.get_value("global", "valid_certificate", false)
config_file.save("user://connexion.cfg")
func get_khaganat_host():
return self._khaganat_host
func get_khaganat_port():
return int(self._khaganat_port)
func get_url_login(): func get_url_login():
return self._url_login return self._url_login
@ -61,4 +59,16 @@ class connexion:
return self._valid_certificate return self._valid_certificate
func get_language(): func get_language():
return self._language return self._language
func set_url_login(url):
self._url_login = url
func set_url_register(url):
self._url_register = url
func set_valid_certificate(value):
self._valid_certificate = value
func set_language(value):
self._language = value

View file

@ -73,6 +73,9 @@ var _quit_id
var _update_time var _update_time
var _queue_message_system var _queue_message_system
var _khaganat_host = "localhost"
var _khaganat_port = "47851"
func _ready(): func _ready():
_current_received_number = 0 _current_received_number = 0
_last_received_number = 0 _last_received_number = 0
@ -168,13 +171,15 @@ func disconnect_server():
print("[net_low_level:disconnect_server] Send disconnect to server") print("[net_low_level:disconnect_server] Send disconnect to server")
_socketUDP.close() _socketUDP.close()
func set_khaganat_server(host, port):
_khaganat_host = host
_khaganat_port = port
func connect_to_server(user_addr, user_key, user_id): func connect_to_server(user_addr, user_key, user_id):
var connexion = load("res://assets/Scripts/Config/connexion.gd").connexion.new() var connexion = load("res://assets/Scripts/Config/connexion.gd").connexion.new()
var khaganat_host = connexion.get_khaganat_host()
var khaganat_port = connexion.get_khaganat_port()
var lang = connexion.get_language() var lang = connexion.get_language()
print("[net_low_level:connect_to_server] prepare:" + str(khaganat_host) + ":" + str(khaganat_port)) print("[net_low_level:connect_to_server] prepare:" + str(_khaganat_host) + ":" + str(_khaganat_port))
_socketUDP.set_dest_address(khaganat_host, khaganat_port) _socketUDP.set_dest_address(_khaganat_host, _khaganat_port)
send_system_login(user_addr, user_key, user_id, lang) send_system_login(user_addr, user_key, user_id, lang)
func decode_system_message(msgin): func decode_system_message(msgin):

View file

@ -9,6 +9,8 @@ func _ready():
$Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Resizable/CheckBox.pressed = ProjectSettings.get_setting( "display/window/size/resizable" ) $Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Resizable/CheckBox.pressed = ProjectSettings.get_setting( "display/window/size/resizable" )
$Menus/TabContainer/Display/ScrollContainer/VBoxContainer/CurrentScreen/SpinBox.value = OS.current_screen $Menus/TabContainer/Display/ScrollContainer/VBoxContainer/CurrentScreen/SpinBox.value = OS.current_screen
$Menus/TabContainer/connexion/v_box_container/h_box_container4/language.add_item("fr")
$Menus/TabContainer/connexion/v_box_container/h_box_container4/language.add_item("en")
load_settings() load_settings()
@ -34,20 +36,30 @@ func load_settings():
$Menus/TabContainer/Test/ScrollContainer/VBoxContainer/font_size_bar.value = global.font_size $Menus/TabContainer/Test/ScrollContainer/VBoxContainer/font_size_bar.value = global.font_size
$Menus/TabContainer/Test/ScrollContainer/VBoxContainer/font_size/font_size_value.text = str( global.font_size ) $Menus/TabContainer/Test/ScrollContainer/VBoxContainer/font_size/font_size_value.text = str( global.font_size )
#var connexion = load("res://assets/Scripts/Config/connexion.gd").new()
var script_connexion = load("res://assets/Scripts/Config/connexion.gd")
var connexion = script_connexion.connexion.new()
var language = connexion.get_language()
$Menus/TabContainer/connexion/v_box_container/h_box_container/register.text = connexion.get_url_register()
$Menus/TabContainer/connexion/v_box_container/h_box_container2/connexion.text = connexion.get_url_login()
$Menus/TabContainer/connexion/v_box_container/h_box_container3/certificate_valid.pressed = connexion.get_valid_certificate()
# language
for i in range(0, $Menus/TabContainer/connexion/v_box_container/h_box_container4/language.get_item_count()):
if $Menus/TabContainer/connexion/v_box_container/h_box_container4/language.get_item_text(i) == language:
$Menus/TabContainer/connexion/v_box_container/h_box_container4/language.select(i)
break
#$Menus/TabContainer/connexion/v_box_container/h_box_container4/language.
#.selected = language
#$Menus/TabContainer/connexion/v_box_container/h_box_container4/language.selected
#func _on_ReturnButton_pressed():
func _on_ReturnButton_pressed(): # var config_file = ConfigFile.new()
# var err = config_file.load( "user://settings.cfg" )
var config_file = ConfigFile.new() # if err:
var err = config_file.load( "user://settings.cfg" ) # print("Error code when loading config file: ", err)
if err: # config_file.set_value("theme", "font_size", $Menus.get_theme().default_font.size)
print("Error code when loading config file: ", err) # config_file.save( "user://settings.cfg" )
# emit_signal( "return_pressed" )
config_file.set_value("theme", "font_size", $Menus.get_theme().default_font.size)
config_file.save( "user://settings.cfg" )
emit_signal( "return_pressed" )
func _on_Title_text_changed(new_text): func _on_Title_text_changed(new_text):
@ -84,3 +96,31 @@ func _on_AlwaysOnTop_toggled(button_pressed):
func _on_SpinBox_value_changed(value): func _on_SpinBox_value_changed(value):
OS.current_screen = value OS.current_screen = value
func _on_ApplyButton_pressed():
var config_file = ConfigFile.new()
var err = config_file.load( "user://settings.cfg" )
if err:
print("Error code when loading config file: ", err)
config_file.set_value("theme", "font_size", $Menus.get_theme().default_font.size)
config_file.save( "user://settings.cfg" )
# Save Connexion
var script_connexion = load("res://assets/Scripts/Config/connexion.gd")
var connexion = script_connexion.connexion.new()
connexion.set_url_register($Menus/TabContainer/connexion/v_box_container/h_box_container/register.text)
connexion.set_url_login($Menus/TabContainer/connexion/v_box_container/h_box_container2/connexion.text)
var id = $Menus/TabContainer/connexion/v_box_container/h_box_container4/language.get_selected_id()
var language = $Menus/TabContainer/connexion/v_box_container/h_box_container4/language.get_item_text(id)
connexion.set_language(language)
connexion.set_valid_certificate($Menus/TabContainer/connexion/v_box_container/h_box_container3/certificate_valid.pressed)
connexion.save()
emit_signal( "return_pressed" )
func _on_CancelButton_pressed():
emit_signal( "return_pressed" )
func _unhandled_input(event):
if event is InputEventKey:
if event.pressed and event.scancode == KEY_ESCAPE:
emit_signal( "return_pressed" )

View file

@ -1,26 +1,27 @@
[gd_scene load_steps=18 format=2] [gd_scene load_steps=20 format=2]
[ext_resource path="res://gui_scene/GUI/Settings/Settings.gd" type="Script" id=1] [ext_resource path="res://assets/GUI/themes/login_theme.theme" type="Theme" id=1]
[ext_resource path="res://assets/GUI/images/settings-Khanat-background.png" type="Texture" id=2] [ext_resource path="res://gui_scene/GUI/Settings/Settings.gd" type="Script" id=2]
[ext_resource path="res://assets/GUI/fonts/ryzom.ttf" type="DynamicFontData" id=3] [ext_resource path="res://assets/GUI/images/settings-Khanat-background.png" type="Texture" id=3]
[ext_resource path="res://addons/input_map_button/input_map_button_node.gd" type="Script" id=4] [ext_resource path="res://assets/GUI/fonts/ryzom.ttf" type="DynamicFontData" id=4]
[ext_resource path="res://addons/input_map_button/icon.png" type="Texture" id=5] [ext_resource path="res://addons/input_map_button/input_map_button_node.gd" type="Script" id=5]
[ext_resource path="res://gui_scene/GUI/Settings/MenuButton.gd" type="Script" id=6] [ext_resource path="res://addons/input_map_button/icon.png" type="Texture" id=6]
[ext_resource path="res://gui_scene/GUI/MusicControls/MusicControls.tscn" type="PackedScene" id=7] [ext_resource path="res://gui_scene/GUI/Settings/MenuButton.gd" type="Script" id=7]
[ext_resource path="res://gui_scene/GUI/scene_selection/scene_selection_menu.tscn" type="PackedScene" id=8] [ext_resource path="res://gui_scene/GUI/MusicControls/MusicControls.tscn" type="PackedScene" id=8]
[ext_resource path="res://gui_scene/GUI/scene_selection/scene_selection_menu.tscn" type="PackedScene" id=9]
[sub_resource type="DynamicFont" id=1] [sub_resource type="DynamicFont" id=1]
size = 14 size = 14
extra_spacing_top = 8 extra_spacing_top = 8
extra_spacing_bottom = 8 extra_spacing_bottom = 8
font_data = ExtResource( 3 ) font_data = ExtResource( 4 )
[sub_resource type="Theme" id=2] [sub_resource type="Theme" id=2]
default_font = SubResource( 1 ) default_font = SubResource( 1 )
[sub_resource type="DynamicFont" id=3] [sub_resource type="DynamicFont" id=3]
size = 42 size = 42
font_data = ExtResource( 3 ) font_data = ExtResource( 4 )
[sub_resource type="StyleBoxFlat" id=4] [sub_resource type="StyleBoxFlat" id=4]
content_margin_left = 8.0 content_margin_left = 8.0
@ -47,57 +48,68 @@ corner_radius_top_right = 8
corner_radius_bottom_right = 8 corner_radius_bottom_right = 8
corner_radius_bottom_left = 8 corner_radius_bottom_left = 8
[sub_resource type="StyleBoxLine" id=7] [sub_resource type="CanvasItemMaterial" id=7]
[sub_resource type="StyleBoxLine" id=8] [sub_resource type="StyleBoxLine" id=8]
[sub_resource type="StyleBoxLine" id=9]
thickness = 2 thickness = 2
vertical = true vertical = true
[sub_resource type="DynamicFont" id=9] [sub_resource type="DynamicFont" id=10]
size = 32 size = 20
font_data = ExtResource( 3 ) font_data = ExtResource( 4 )
[node name="Settings" type="MarginContainer"] [node name="Settings" type="MarginContainer"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource( 1 )
custom_constants/margin_right = 0 custom_constants/margin_right = 0
custom_constants/margin_top = 0 custom_constants/margin_top = 0
custom_constants/margin_left = 0 custom_constants/margin_left = 0
custom_constants/margin_bottom = 0 custom_constants/margin_bottom = 0
script = ExtResource( 1 ) script = ExtResource( 2 )
[node name="texture_rect" type="TextureRect" parent="."] [node name="texture_rect" type="TextureRect" parent="."]
margin_right = 1280.0 margin_right = 1280.0
margin_bottom = 720.0 margin_bottom = 720.0
texture = ExtResource( 2 ) size_flags_horizontal = 3
size_flags_vertical = 3
texture = ExtResource( 3 )
expand = true
[node name="Menus" type="VBoxContainer" parent="."] [node name="Menus" type="VBoxContainer" parent="."]
margin_right = 1280.0 margin_right = 1280.0
margin_bottom = 720.0 margin_bottom = 720.0
size_flags_horizontal = 3
size_flags_vertical = 3
theme = SubResource( 2 ) theme = SubResource( 2 )
[node name="MenuTitle" type="Label" parent="Menus"] [node name="MenuTitle" type="Label" parent="Menus"]
margin_right = 1280.0 margin_right = 1280.0
margin_bottom = 49.0 margin_bottom = 49.0
size_flags_horizontal = 3
size_flags_vertical = 1 size_flags_vertical = 1
custom_fonts/font = SubResource( 3 ) custom_fonts/font = SubResource( 3 )
custom_colors/font_color = Color( 0, 0, 0, 1 ) custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Settings" text = "Configurations"
align = 1 align = 1
[node name="TabContainer" type="TabContainer" parent="Menus"] [node name="TabContainer" type="TabContainer" parent="Menus"]
margin_top = 53.0 margin_top = 53.0
margin_right = 1280.0 margin_right = 1280.0
margin_bottom = 672.0 margin_bottom = 676.0
grow_horizontal = 0
grow_vertical = 0
rect_min_size = Vector2( 0, 64 ) rect_min_size = Vector2( 0, 64 )
size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
custom_styles/tab_fg = SubResource( 4 ) custom_styles/tab_fg = SubResource( 4 )
custom_styles/tab_bg = SubResource( 5 ) custom_styles/tab_bg = SubResource( 5 )
custom_styles/panel = SubResource( 6 ) custom_styles/panel = SubResource( 6 )
[node name="Display" type="MarginContainer" parent="Menus/TabContainer"] [node name="Display" type="MarginContainer" parent="Menus/TabContainer"]
editor/display_folded = true
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
margin_top = 49.0 margin_top = 49.0
@ -107,117 +119,111 @@ custom_constants/margin_left = 42
custom_constants/margin_bottom = 42 custom_constants/margin_bottom = 42
[node name="ScrollContainer" type="ScrollContainer" parent="Menus/TabContainer/Display"] [node name="ScrollContainer" type="ScrollContainer" parent="Menus/TabContainer/Display"]
material = SubResource( 7 )
margin_left = 42.0 margin_left = 42.0
margin_top = 42.0 margin_top = 42.0
margin_right = 1238.0 margin_right = 1238.0
margin_bottom = 528.0 margin_bottom = 532.0
[node name="VBoxContainer" type="VBoxContainer" parent="Menus/TabContainer/Display/ScrollContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="Menus/TabContainer/Display/ScrollContainer"]
margin_right = 1196.0 margin_right = 1196.0
margin_bottom = 239.0 margin_bottom = 213.0
size_flags_horizontal = 7 size_flags_horizontal = 7
size_flags_vertical = 2 size_flags_vertical = 2
custom_constants/separation = 8 custom_constants/separation = 8
[node name="Fullscreen" type="HBoxContainer" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer"] [node name="Fullscreen" type="HBoxContainer" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer"]
editor/display_folded = true
margin_right = 1196.0 margin_right = 1196.0
margin_bottom = 41.0 margin_bottom = 33.0
[node name="Label" type="Label" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Fullscreen"] [node name="Label" type="Label" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Fullscreen"]
margin_left = 523.0 margin_left = 523.0
margin_top = 4.0
margin_right = 596.0 margin_right = 596.0
margin_bottom = 37.0 margin_bottom = 33.0
size_flags_horizontal = 10 size_flags_horizontal = 10
text = "Fullscreen" text = "Fullscreen"
[node name="CheckBox" type="CheckBox" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Fullscreen"] [node name="CheckBox" type="CheckBox" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Fullscreen"]
margin_left = 600.0 margin_left = 600.0
margin_right = 624.0 margin_right = 616.0
margin_bottom = 41.0 margin_bottom = 33.0
size_flags_horizontal = 2 size_flags_horizontal = 2
[node name="Borderless" type="HBoxContainer" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer"] [node name="Borderless" type="HBoxContainer" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer"]
margin_top = 49.0 margin_top = 41.0
margin_right = 1196.0 margin_right = 1196.0
margin_bottom = 90.0 margin_bottom = 74.0
[node name="Label" type="Label" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Borderless"] [node name="Label" type="Label" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Borderless"]
margin_left = 520.0 margin_left = 520.0
margin_top = 4.0
margin_right = 596.0 margin_right = 596.0
margin_bottom = 37.0 margin_bottom = 33.0
size_flags_horizontal = 10 size_flags_horizontal = 10
text = "Borderless" text = "Borderless"
[node name="CheckBox" type="CheckBox" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Borderless"] [node name="CheckBox" type="CheckBox" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Borderless"]
margin_left = 600.0 margin_left = 600.0
margin_right = 624.0 margin_right = 616.0
margin_bottom = 41.0 margin_bottom = 33.0
size_flags_horizontal = 2 size_flags_horizontal = 2
[node name="Resizable" type="HBoxContainer" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer"] [node name="Resizable" type="HBoxContainer" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer"]
editor/display_folded = true margin_top = 82.0
margin_top = 98.0
margin_right = 1196.0 margin_right = 1196.0
margin_bottom = 139.0 margin_bottom = 115.0
[node name="Label" type="Label" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Resizable"] [node name="Label" type="Label" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Resizable"]
margin_left = 528.0 margin_left = 528.0
margin_top = 4.0
margin_right = 596.0 margin_right = 596.0
margin_bottom = 37.0 margin_bottom = 33.0
size_flags_horizontal = 10 size_flags_horizontal = 10
text = "Resizable" text = "Resizable"
[node name="CheckBox" type="CheckBox" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Resizable"] [node name="CheckBox" type="CheckBox" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Resizable"]
margin_left = 600.0 margin_left = 600.0
margin_right = 624.0 margin_right = 616.0
margin_bottom = 41.0 margin_bottom = 33.0
size_flags_horizontal = 2 size_flags_horizontal = 2
[node name="AlwaysOnTop" type="HBoxContainer" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer"] [node name="AlwaysOnTop" type="HBoxContainer" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer"]
margin_top = 147.0 margin_top = 123.0
margin_right = 1196.0 margin_right = 1196.0
margin_bottom = 188.0 margin_bottom = 156.0
[node name="Label" type="Label" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/AlwaysOnTop"] [node name="Label" type="Label" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/AlwaysOnTop"]
margin_left = 494.0 margin_left = 494.0
margin_top = 4.0
margin_right = 596.0 margin_right = 596.0
margin_bottom = 37.0 margin_bottom = 33.0
size_flags_horizontal = 10 size_flags_horizontal = 10
text = "Always on top." text = "Always on top."
[node name="CheckBox" type="CheckBox" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/AlwaysOnTop"] [node name="CheckBox" type="CheckBox" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/AlwaysOnTop"]
margin_left = 600.0 margin_left = 600.0
margin_right = 624.0 margin_right = 616.0
margin_bottom = 41.0 margin_bottom = 33.0
size_flags_horizontal = 2 size_flags_horizontal = 2
disabled = true disabled = true
[node name="CurrentScreen" type="HBoxContainer" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer"] [node name="CurrentScreen" type="HBoxContainer" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer"]
margin_top = 196.0 margin_top = 164.0
margin_right = 1196.0 margin_right = 1196.0
margin_bottom = 239.0 margin_bottom = 213.0
[node name="Label" type="Label" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/CurrentScreen"] [node name="Label" type="Label" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/CurrentScreen"]
margin_left = 486.0 margin_left = 486.0
margin_top = 5.0 margin_top = 8.0
margin_right = 596.0 margin_right = 596.0
margin_bottom = 38.0 margin_bottom = 41.0
size_flags_horizontal = 10 size_flags_horizontal = 10
text = "Current screen." text = "Current screen."
[node name="SpinBox" type="SpinBox" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/CurrentScreen"] [node name="SpinBox" type="SpinBox" parent="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/CurrentScreen"]
margin_left = 600.0 margin_left = 600.0
margin_right = 674.0 margin_right = 680.0
margin_bottom = 43.0 margin_bottom = 49.0
size_flags_horizontal = 2 size_flags_horizontal = 2
[node name="Controles" type="VBoxContainer" parent="Menus/TabContainer"] [node name="Controles" type="VBoxContainer" parent="Menus/TabContainer"]
editor/display_folded = true
visible = false visible = false
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
@ -225,19 +231,20 @@ margin_top = 49.0
mouse_filter = 0 mouse_filter = 0
[node name="ScrollContainer" type="ScrollContainer" parent="Menus/TabContainer/Controles"] [node name="ScrollContainer" type="ScrollContainer" parent="Menus/TabContainer/Controles"]
margin_right = 1024.0 editor/display_folded = true
margin_bottom = 450.0 margin_right = 1280.0
margin_bottom = 574.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="TabContainer" type="TabContainer" parent="Menus/TabContainer/Controles/ScrollContainer"] [node name="TabContainer" type="TabContainer" parent="Menus/TabContainer/Controles/ScrollContainer"]
margin_right = 1024.0 margin_right = 1280.0
margin_bottom = 450.0 margin_bottom = 574.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
custom_styles/tab_fg = SubResource( 4 ) custom_styles/tab_fg = SubResource( 4 )
custom_styles/tab_bg = SubResource( 5 ) custom_styles/tab_bg = SubResource( 5 )
custom_styles/panel = SubResource( 7 ) custom_styles/panel = SubResource( 8 )
custom_constants/top_margin = 0 custom_constants/top_margin = 0
custom_constants/side_margin = 0 custom_constants/side_margin = 0
@ -250,11 +257,11 @@ margin_right = -1.0
margin_bottom = -1.0 margin_bottom = -1.0
[node name="game_flashlight" type="HBoxContainer" parent="Menus/TabContainer/Controles/ScrollContainer/TabContainer/Jeu"] [node name="game_flashlight" type="HBoxContainer" parent="Menus/TabContainer/Controles/ScrollContainer/TabContainer/Jeu"]
margin_right = 1022.0 margin_right = 1278.0
margin_bottom = 39.0 margin_bottom = 49.0
script = ExtResource( 4 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 5 ) "_editor_icon": ExtResource( 6 )
} }
description = "Active/désactive la lampe torche." description = "Active/désactive la lampe torche."
config_file = "user://input.cfg" config_file = "user://input.cfg"
@ -263,12 +270,12 @@ default_keyboard_alt = null
default_joypad = null default_joypad = null
[node name="hide_char" type="HBoxContainer" parent="Menus/TabContainer/Controles/ScrollContainer/TabContainer/Jeu"] [node name="hide_char" type="HBoxContainer" parent="Menus/TabContainer/Controles/ScrollContainer/TabContainer/Jeu"]
margin_top = 43.0 margin_top = 53.0
margin_right = 1022.0 margin_right = 1278.0
margin_bottom = 82.0 margin_bottom = 102.0
script = ExtResource( 4 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 5 ) "_editor_icon": ExtResource( 6 )
} }
description = "Affiche/cache le personnage." description = "Affiche/cache le personnage."
config_file = "user://input.cfg" config_file = "user://input.cfg"
@ -318,9 +325,9 @@ align = 1
margin_top = 42.0 margin_top = 42.0
margin_right = 1022.0 margin_right = 1022.0
margin_bottom = 86.0 margin_bottom = 86.0
script = ExtResource( 4 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 5 ) "_editor_icon": ExtResource( 6 )
} }
description = "Test." description = "Test."
config_file = "user://input.cfg" config_file = "user://input.cfg"
@ -332,9 +339,9 @@ default_joypad = null
margin_top = 90.0 margin_top = 90.0
margin_right = 1022.0 margin_right = 1022.0
margin_bottom = 134.0 margin_bottom = 134.0
script = ExtResource( 4 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 5 ) "_editor_icon": ExtResource( 6 )
} }
description = "Play/Pause." description = "Play/Pause."
config_file = "user://input.cfg" config_file = "user://input.cfg"
@ -346,9 +353,9 @@ default_joypad = null
margin_top = 138.0 margin_top = 138.0
margin_right = 1022.0 margin_right = 1022.0
margin_bottom = 182.0 margin_bottom = 182.0
script = ExtResource( 4 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 5 ) "_editor_icon": ExtResource( 6 )
} }
description = "Recharger la scène." description = "Recharger la scène."
config_file = "user://input.cfg" config_file = "user://input.cfg"
@ -360,9 +367,9 @@ default_joypad = null
margin_top = 186.0 margin_top = 186.0
margin_right = 1022.0 margin_right = 1022.0
margin_bottom = 230.0 margin_bottom = 230.0
script = ExtResource( 4 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 5 ) "_editor_icon": ExtResource( 6 )
} }
description = "Libéré/capturer le curseur." description = "Libéré/capturer le curseur."
config_file = "user://input.cfg" config_file = "user://input.cfg"
@ -374,9 +381,9 @@ default_joypad = null
margin_top = 234.0 margin_top = 234.0
margin_right = 1022.0 margin_right = 1022.0
margin_bottom = 278.0 margin_bottom = 278.0
script = ExtResource( 4 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 5 ) "_editor_icon": ExtResource( 6 )
} }
description = "Quitter." description = "Quitter."
config_file = "user://input.cfg" config_file = "user://input.cfg"
@ -402,7 +409,7 @@ margin_bottom = 37.0
margin_right = 338.0 margin_right = 338.0
margin_bottom = 37.0 margin_bottom = 37.0
size_flags_horizontal = 3 size_flags_horizontal = 3
custom_styles/normal = SubResource( 8 ) custom_styles/normal = SubResource( 9 )
text = "Description" text = "Description"
align = 2 align = 2
@ -428,9 +435,9 @@ align = 1
margin_top = 41.0 margin_top = 41.0
margin_right = 1022.0 margin_right = 1022.0
margin_bottom = 80.0 margin_bottom = 80.0
script = ExtResource( 4 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 5 ) "_editor_icon": ExtResource( 6 )
} }
description = "Avancer." description = "Avancer."
config_file = "user://input.cfg" config_file = "user://input.cfg"
@ -442,9 +449,9 @@ default_joypad = null
margin_top = 84.0 margin_top = 84.0
margin_right = 1022.0 margin_right = 1022.0
margin_bottom = 123.0 margin_bottom = 123.0
script = ExtResource( 4 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 5 ) "_editor_icon": ExtResource( 6 )
} }
description = "Reculer." description = "Reculer."
config_file = "user://input.cfg" config_file = "user://input.cfg"
@ -456,9 +463,9 @@ default_joypad = null
margin_top = 127.0 margin_top = 127.0
margin_right = 1022.0 margin_right = 1022.0
margin_bottom = 166.0 margin_bottom = 166.0
script = ExtResource( 4 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 5 ) "_editor_icon": ExtResource( 6 )
} }
description = "Deplacement latéral gauche." description = "Deplacement latéral gauche."
config_file = "user://input.cfg" config_file = "user://input.cfg"
@ -470,9 +477,9 @@ default_joypad = null
margin_top = 170.0 margin_top = 170.0
margin_right = 1022.0 margin_right = 1022.0
margin_bottom = 209.0 margin_bottom = 209.0
script = ExtResource( 4 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 5 ) "_editor_icon": ExtResource( 6 )
} }
description = "Deplacement latéral droit." description = "Deplacement latéral droit."
config_file = "user://input.cfg" config_file = "user://input.cfg"
@ -484,9 +491,9 @@ default_joypad = null
margin_top = 213.0 margin_top = 213.0
margin_right = 1022.0 margin_right = 1022.0
margin_bottom = 252.0 margin_bottom = 252.0
script = ExtResource( 4 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 5 ) "_editor_icon": ExtResource( 6 )
} }
description = "Deplacement vers le haut." description = "Deplacement vers le haut."
config_file = "user://input.cfg" config_file = "user://input.cfg"
@ -498,9 +505,9 @@ default_joypad = null
margin_top = 256.0 margin_top = 256.0
margin_right = 1022.0 margin_right = 1022.0
margin_bottom = 295.0 margin_bottom = 295.0
script = ExtResource( 4 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 5 ) "_editor_icon": ExtResource( 6 )
} }
description = "Deplacement vers le bas." description = "Deplacement vers le bas."
config_file = "user://input.cfg" config_file = "user://input.cfg"
@ -541,12 +548,12 @@ custom_constants/margin_bottom = 42
margin_left = 42.0 margin_left = 42.0
margin_top = 42.0 margin_top = 42.0
margin_right = 1238.0 margin_right = 1238.0
margin_bottom = 528.0 margin_bottom = 532.0
[node name="VBoxContainer" type="VBoxContainer" parent="Menus/TabContainer/Test/ScrollContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="Menus/TabContainer/Test/ScrollContainer"]
margin_left = 470.0 margin_left = 470.0
margin_right = 726.0 margin_right = 726.0
margin_bottom = 486.0 margin_bottom = 490.0
size_flags_horizontal = 6 size_flags_horizontal = 6
size_flags_vertical = 3 size_flags_vertical = 3
@ -579,7 +586,7 @@ value = 14.0
[node name="SpinBox" type="SpinBox" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer"] [node name="SpinBox" type="SpinBox" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer"]
margin_top = 53.0 margin_top = 53.0
margin_right = 256.0 margin_right = 256.0
margin_bottom = 96.0 margin_bottom = 102.0
rect_min_size = Vector2( 256, 0 ) rect_min_size = Vector2( 256, 0 )
size_flags_horizontal = 7 size_flags_horizontal = 7
size_flags_vertical = 0 size_flags_vertical = 0
@ -587,73 +594,172 @@ prefix = "test"
suffix = "tset" suffix = "tset"
[node name="CheckBox" type="CheckBox" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer"] [node name="CheckBox" type="CheckBox" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer"]
margin_top = 100.0 margin_top = 106.0
margin_right = 256.0 margin_right = 256.0
margin_bottom = 141.0 margin_bottom = 139.0
hint_tooltip = "Test de CheckBox" hint_tooltip = "Test de CheckBox"
size_flags_horizontal = 3 size_flags_horizontal = 3
text = "Checkbox" text = "Checkbox"
[node name="CheckBox2" type="CheckBox" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer"] [node name="CheckBox2" type="CheckBox" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer"]
margin_top = 145.0 margin_top = 143.0
margin_right = 256.0 margin_right = 256.0
margin_bottom = 186.0 margin_bottom = 176.0
size_flags_horizontal = 3 size_flags_horizontal = 3
text = " Label un peu plus grand" text = " Label un peu plus grand"
[node name="TitleBox" type="HBoxContainer" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer"] [node name="TitleBox" type="HBoxContainer" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer"]
margin_top = 190.0 margin_top = 180.0
margin_right = 256.0 margin_right = 256.0
margin_bottom = 233.0 margin_bottom = 229.0
[node name="Label" type="Label" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer/TitleBox"] [node name="Label" type="Label" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer/TitleBox"]
margin_top = 5.0 margin_top = 8.0
margin_right = 40.0 margin_right = 40.0
margin_bottom = 38.0 margin_bottom = 41.0
text = "Title: " text = "Title: "
[node name="Title" type="LineEdit" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer/TitleBox"] [node name="Title" type="LineEdit" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer/TitleBox"]
margin_left = 44.0 margin_left = 44.0
margin_right = 256.0 margin_right = 256.0
margin_bottom = 43.0 margin_bottom = 49.0
hint_tooltip = "Enter main window's title here." hint_tooltip = "Enter main window's title here."
size_flags_horizontal = 3 size_flags_horizontal = 3
caret_blink = true caret_blink = true
[node name="MenuButton" type="MenuButton" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer"] [node name="MenuButton" type="MenuButton" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer"]
margin_top = 237.0 margin_top = 233.0
margin_right = 256.0 margin_right = 256.0
margin_bottom = 276.0 margin_bottom = 282.0
text = "options" text = "options"
flat = false flat = false
script = ExtResource( 6 ) script = ExtResource( 7 )
[node name="ColorPickerButton" type="ColorPickerButton" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer"] [node name="ColorPickerButton" type="ColorPickerButton" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer"]
margin_top = 280.0 margin_top = 286.0
margin_right = 256.0 margin_right = 256.0
margin_bottom = 319.0 margin_bottom = 319.0
color = Color( 1, 1, 1, 1 ) color = Color( 1, 1, 1, 1 )
[node name="Music" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer" instance=ExtResource( 7 )] [node name="Music" parent="Menus/TabContainer/Test/ScrollContainer/VBoxContainer" instance=ExtResource( 8 )]
margin_top = 323.0 margin_top = 323.0
margin_bottom = 446.0 margin_bottom = 450.0
[node name="scene_selection" parent="Menus/TabContainer" instance=ExtResource( 8 )] [node name="scene_selection" parent="Menus/TabContainer" instance=ExtResource( 9 )]
visible = false visible = false
margin_top = 49.0 margin_top = 49.0
[node name="connexion" type="VBoxContainer" parent="Menus/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 49.0
[node name="v_box_container" type="VBoxContainer" parent="Menus/TabContainer/connexion"]
margin_right = 1280.0
margin_bottom = 176.0
[node name="h_box_container" type="HBoxContainer" parent="Menus/TabContainer/connexion/v_box_container"]
margin_right = 1280.0
margin_bottom = 49.0
[node name="label" type="Label" parent="Menus/TabContainer/connexion/v_box_container/h_box_container"]
margin_left = 564.0
margin_right = 638.0
margin_bottom = 49.0
size_flags_horizontal = 10
size_flags_vertical = 9
text = "Inscription"
align = 2
valign = 1
[node name="register" type="LineEdit" parent="Menus/TabContainer/connexion/v_box_container/h_box_container"]
margin_left = 642.0
margin_right = 1280.0
margin_bottom = 49.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="h_box_container2" type="HBoxContainer" parent="Menus/TabContainer/connexion/v_box_container"]
margin_top = 53.0
margin_right = 1280.0
margin_bottom = 102.0
[node name="label" type="Label" parent="Menus/TabContainer/connexion/v_box_container/h_box_container2"]
margin_right = 638.0
margin_bottom = 49.0
size_flags_horizontal = 11
size_flags_vertical = 7
text = "Connection"
align = 2
valign = 1
[node name="connexion" type="LineEdit" parent="Menus/TabContainer/connexion/v_box_container/h_box_container2"]
margin_left = 642.0
margin_right = 1280.0
margin_bottom = 49.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="h_box_container3" type="HBoxContainer" parent="Menus/TabContainer/connexion/v_box_container"]
margin_top = 106.0
margin_right = 1280.0
margin_bottom = 139.0
[node name="certificate_valid" type="CheckBox" parent="Menus/TabContainer/connexion/v_box_container/h_box_container3"]
margin_left = 485.0
margin_right = 794.0
margin_bottom = 33.0
size_flags_horizontal = 6
size_flags_vertical = 6
text = "Controle le certificat du serveur"
[node name="h_box_container4" type="HBoxContainer" parent="Menus/TabContainer/connexion/v_box_container"]
margin_top = 143.0
margin_right = 1280.0
margin_bottom = 176.0
[node name="label" type="Label" parent="Menus/TabContainer/connexion/v_box_container/h_box_container4"]
margin_right = 638.0
margin_bottom = 33.0
size_flags_horizontal = 11
size_flags_vertical = 6
text = "Langue"
align = 2
valign = 1
[node name="language" type="OptionButton" parent="Menus/TabContainer/connexion/v_box_container/h_box_container4"]
margin_left = 642.0
margin_right = 1280.0
margin_bottom = 33.0
size_flags_horizontal = 3
text = "FR"
[node name="Footer" type="HBoxContainer" parent="Menus"] [node name="Footer" type="HBoxContainer" parent="Menus"]
margin_top = 676.0 margin_top = 680.0
margin_right = 1280.0 margin_right = 1280.0
margin_bottom = 720.0 margin_bottom = 720.0
size_flags_horizontal = 9
size_flags_vertical = 9
[node name="ReturnButton" type="Button" parent="Menus/Footer"] [node name="CancelButton" type="Button" parent="Menus/Footer"]
margin_right = 120.0 margin_right = 95.0
margin_bottom = 44.0 margin_bottom = 40.0
rect_pivot_offset = Vector2( 666, -265 )
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 8 size_flags_vertical = 8
custom_fonts/font = SubResource( 9 ) custom_fonts/font = SubResource( 10 )
text = "Return" text = "Annuler"
[node name="ApplyButton" type="Button" parent="Menus/Footer"]
margin_left = 99.0
margin_right = 213.0
margin_bottom = 40.0
rect_pivot_offset = Vector2( 666, -265 )
size_flags_horizontal = 0
size_flags_vertical = 8
custom_fonts/font = SubResource( 10 )
text = "Appliquer"
[connection signal="toggled" from="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Fullscreen/CheckBox" to="." method="_on_Fullscreen_toggled"] [connection signal="toggled" from="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Fullscreen/CheckBox" to="." method="_on_Fullscreen_toggled"]
[connection signal="toggled" from="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Borderless/CheckBox" to="." method="_on_Borderless_toggled"] [connection signal="toggled" from="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Borderless/CheckBox" to="." method="_on_Borderless_toggled"]
[connection signal="toggled" from="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Resizable/CheckBox" to="." method="_on_Resizable_toggled"] [connection signal="toggled" from="Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Resizable/CheckBox" to="." method="_on_Resizable_toggled"]
@ -662,4 +768,5 @@ text = "Return"
[connection signal="pressed" from="Menus/TabContainer/Controles/ResetButton" to="Menus/TabContainer/Controles" method="_on_ResetButton_pressed"] [connection signal="pressed" from="Menus/TabContainer/Controles/ResetButton" to="Menus/TabContainer/Controles" method="_on_ResetButton_pressed"]
[connection signal="value_changed" from="Menus/TabContainer/Test/ScrollContainer/VBoxContainer/font_size_bar" to="." method="_on_font_size_bar_value_changed"] [connection signal="value_changed" from="Menus/TabContainer/Test/ScrollContainer/VBoxContainer/font_size_bar" to="." method="_on_font_size_bar_value_changed"]
[connection signal="text_changed" from="Menus/TabContainer/Test/ScrollContainer/VBoxContainer/TitleBox/Title" to="." method="_on_Title_text_changed"] [connection signal="text_changed" from="Menus/TabContainer/Test/ScrollContainer/VBoxContainer/TitleBox/Title" to="." method="_on_Title_text_changed"]
[connection signal="pressed" from="Menus/Footer/ReturnButton" to="." method="_on_ReturnButton_pressed"] [connection signal="pressed" from="Menus/Footer/CancelButton" to="." method="_on_CancelButton_pressed"]
[connection signal="pressed" from="Menus/Footer/ApplyButton" to="." method="_on_ApplyButton_pressed"]

View file

@ -101,6 +101,9 @@ func _on_HTTPRequest_request_completed(result, response_code, headers, body):
var state = line1[0] var state = line1[0]
var cookie = line1[1] var cookie = line1[1]
var fsaddr = line1[2] var fsaddr = line1[2]
var khaganat = fsaddr.split(":")
var khaganat_host = khaganat[0]
var khaganat_port = int(khaganat[1])
var ringmainurl = line1[3] var ringmainurl = line1[3]
var fartp = line1[4] var fartp = line1[4]
var stat = "0" var stat = "0"
@ -121,6 +124,7 @@ func _on_HTTPRequest_request_completed(result, response_code, headers, body):
print("[login_menu:_on_HTTPRequest_request_completed] state:" + state + ", cookie:" + cookie + ", fsaddr:" + fsaddr + ", ringmainurl:" + ringmainurl + ", fartp:" + fartp + ", stat:" + stat + ", r2serverversion:" + r2serverversion + ", r2backuppatchurl:" + r2backuppatchurl + ", r2patchurl:" + r2patchurl) print("[login_menu:_on_HTTPRequest_request_completed] state:" + state + ", cookie:" + cookie + ", fsaddr:" + fsaddr + ", ringmainurl:" + ringmainurl + ", fartp:" + fartp + ", stat:" + stat + ", r2serverversion:" + r2serverversion + ", r2backuppatchurl:" + r2backuppatchurl + ", r2patchurl:" + r2patchurl)
var server_info = server_info_script.nel_server_info.new(body.get_string_from_utf8()); var server_info = server_info_script.nel_server_info.new(body.get_string_from_utf8());
net_low_level.set_khaganat_server(khaganat_host, khaganat_port)
net_low_level.connect_to_server(UserAddr, UserKey, UserId) net_low_level.connect_to_server(UserAddr, UserKey, UserId)
emit_signal( "login_button_pressed" ) emit_signal( "login_button_pressed" )

View file

@ -13,6 +13,7 @@ func _ready():
$login_menu.show() $login_menu.show()
$register_menu.hide() $register_menu.hide()
$license_menu.hide() $license_menu.hide()
$settings_menu.hide()
func _on_login_menu_login_button_pressed(): func _on_login_menu_login_button_pressed():
print("[login_scene] Launch game") print("[login_scene] Launch game")
@ -58,27 +59,41 @@ func _on_login_menu_register_button_pressed():
$login_menu.hide() $login_menu.hide()
$register_menu.show() $register_menu.show()
$license_menu.hide() $license_menu.hide()
$settings_menu.hide()
func _on_register_menu_cancel_button_pressed(): func _on_register_menu_cancel_button_pressed():
$login_menu.show() $login_menu.show()
$register_menu.hide() $register_menu.hide()
$license_menu.hide() $license_menu.hide()
$settings_menu.hide()
func _on_register_menu_license_button_pressed(): func _on_register_menu_license_button_pressed():
$login_menu.hide() $login_menu.hide()
$register_menu.hide() $register_menu.hide()
$license_menu.show() $license_menu.show()
$settings_menu.hide()
func _on_license_menu_return_button_pressed(): func _on_license_menu_return_button_pressed():
$login_menu.hide() $login_menu.hide()
$register_menu.show() $register_menu.show()
$license_menu.hide() $license_menu.hide()
$settings_menu.hide()
func _on_register_menu_register_account_created(): func _on_register_menu_register_account_created():
$login_menu.show() $login_menu.show()
$register_menu.hide() $register_menu.hide()
$license_menu.hide() $license_menu.hide()
$settings_menu.hide()
func _on_Settings_menu_return_pressed():
$login_menu.show()
$register_menu.hide()
$license_menu.hide()
$settings_menu.hide()
func _on_settings_button_pressed():
$login_menu.hide()
$register_menu.hide()
$license_menu.hide()
$settings_menu.load_settings()
$settings_menu.show()

View file

@ -1,16 +1,17 @@
[gd_scene load_steps=12 format=2] [gd_scene load_steps=13 format=2]
[ext_resource path="res://login_scene/login_scene.gd" type="Script" id=1] [ext_resource path="res://login_scene/login_scene.gd" type="Script" id=1]
[ext_resource path="res://login_scene/character_selection_menu.tscn" type="PackedScene" id=2] [ext_resource path="res://login_scene/character_selection_menu.tscn" type="PackedScene" id=2]
[ext_resource path="res://gui_scene/GUI/login/login_menu.tscn" type="PackedScene" id=3] [ext_resource path="res://gui_scene/GUI/login/login_menu.tscn" type="PackedScene" id=3]
[ext_resource path="res://gui_scene/GUI/login/register_menu.tscn" type="PackedScene" id=4] [ext_resource path="res://gui_scene/GUI/login/register_menu.tscn" type="PackedScene" id=4]
[ext_resource path="res://gui_scene/GUI/login/license_menu.tscn" type="PackedScene" id=5] [ext_resource path="res://gui_scene/GUI/login/license_menu.tscn" type="PackedScene" id=5]
[ext_resource path="res://assets/GUI/images/Login-Khanat-background-buttons.png" type="Texture" id=6] [ext_resource path="res://gui_scene/GUI/Settings/Settings.tscn" type="PackedScene" id=6]
[ext_resource path="res://assets/GUI/images/Login-Khanat-sound-button.png" type="Texture" id=7] [ext_resource path="res://assets/GUI/images/Login-Khanat-background-buttons.png" type="Texture" id=7]
[ext_resource path="res://assets/GUI/images/Login-Khanat-sound-muted-button.png" type="Texture" id=8] [ext_resource path="res://assets/GUI/images/Login-Khanat-sound-button.png" type="Texture" id=8]
[ext_resource path="res://assets/GUI/images/Login-Khanat-help-button.png" type="Texture" id=9] [ext_resource path="res://assets/GUI/images/Login-Khanat-sound-muted-button.png" type="Texture" id=9]
[ext_resource path="res://assets/GUI/images/Login-Khanat-settings-button.png" type="Texture" id=10] [ext_resource path="res://assets/GUI/images/Login-Khanat-help-button.png" type="Texture" id=10]
[ext_resource path="res://assets/GUI/images/Login-Khanat-quit-button.png" type="Texture" id=11] [ext_resource path="res://assets/GUI/images/Login-Khanat-settings-button.png" type="Texture" id=11]
[ext_resource path="res://assets/GUI/images/Login-Khanat-quit-button.png" type="Texture" id=12]
[node name="login_scene" type="Node"] [node name="login_scene" type="Node"]
script = ExtResource( 1 ) script = ExtResource( 1 )
@ -28,12 +29,15 @@ visible = false
[node name="license_menu" parent="." instance=ExtResource( 5 )] [node name="license_menu" parent="." instance=ExtResource( 5 )]
visible = false visible = false
[node name="settings_menu" parent="." instance=ExtResource( 6 )]
visible = false
[node name="buttons_background" type="TextureRect" parent="."] [node name="buttons_background" type="TextureRect" parent="."]
anchor_left = 1.0 anchor_left = 1.0
anchor_right = 1.0 anchor_right = 1.0
margin_left = -307.0 margin_left = -307.0
margin_bottom = 65.0 margin_bottom = 65.0
texture = ExtResource( 6 ) texture = ExtResource( 7 )
[node name="buttons" type="HBoxContainer" parent="."] [node name="buttons" type="HBoxContainer" parent="."]
anchor_right = 1.0 anchor_right = 1.0
@ -46,26 +50,26 @@ margin_left = 1052.0
margin_right = 1106.0 margin_right = 1106.0
margin_bottom = 61.0 margin_bottom = 61.0
toggle_mode = true toggle_mode = true
texture_normal = ExtResource( 7 ) texture_normal = ExtResource( 8 )
texture_pressed = ExtResource( 8 ) texture_pressed = ExtResource( 9 )
[node name="help_button" type="TextureButton" parent="buttons"] [node name="help_button" type="TextureButton" parent="buttons"]
margin_left = 1110.0 margin_left = 1110.0
margin_right = 1164.0 margin_right = 1164.0
margin_bottom = 61.0 margin_bottom = 61.0
texture_normal = ExtResource( 9 ) texture_normal = ExtResource( 10 )
[node name="settings_button" type="TextureButton" parent="buttons"] [node name="settings_button" type="TextureButton" parent="buttons"]
margin_left = 1168.0 margin_left = 1168.0
margin_right = 1222.0 margin_right = 1222.0
margin_bottom = 61.0 margin_bottom = 61.0
texture_normal = ExtResource( 10 ) texture_normal = ExtResource( 11 )
[node name="quit_button" type="TextureButton" parent="buttons"] [node name="quit_button" type="TextureButton" parent="buttons"]
margin_left = 1226.0 margin_left = 1226.0
margin_right = 1280.0 margin_right = 1280.0
margin_bottom = 61.0 margin_bottom = 61.0
texture_normal = ExtResource( 11 ) texture_normal = ExtResource( 12 )
[connection signal="character_selected" from="character_selection_menu" to="." method="_on_character_selection_menu_character_selected"] [connection signal="character_selected" from="character_selection_menu" to="." method="_on_character_selection_menu_character_selected"]
[connection signal="return_button_pressed" from="character_selection_menu" to="." method="_on_character_selection_menu_return_button_pressed"] [connection signal="return_button_pressed" from="character_selection_menu" to="." method="_on_character_selection_menu_return_button_pressed"]
[connection signal="login_button_pressed" from="login_menu" to="." method="_on_login_menu_login_button_pressed"] [connection signal="login_button_pressed" from="login_menu" to="." method="_on_login_menu_login_button_pressed"]
@ -75,5 +79,7 @@ texture_normal = ExtResource( 11 )
[connection signal="register_account_created" from="register_menu" to="." method="_on_register_menu_register_account_created"] [connection signal="register_account_created" from="register_menu" to="." method="_on_register_menu_register_account_created"]
[connection signal="sound_button_toggled" from="register_menu" to="." method="_on_sound_button_toggled"] [connection signal="sound_button_toggled" from="register_menu" to="." method="_on_sound_button_toggled"]
[connection signal="return_button_pressed" from="license_menu" to="." method="_on_license_menu_return_button_pressed"] [connection signal="return_button_pressed" from="license_menu" to="." method="_on_license_menu_return_button_pressed"]
[connection signal="return_pressed" from="settings_menu" to="." method="_on_Settings_menu_return_pressed"]
[connection signal="toggled" from="buttons/sound_button" to="." method="_on_sound_button_toggled"] [connection signal="toggled" from="buttons/sound_button" to="." method="_on_sound_button_toggled"]
[connection signal="pressed" from="buttons/settings_button" to="." method="_on_settings_button_pressed"]
[connection signal="pressed" from="buttons/quit_button" to="." method="_on_quit_button_pressed"] [connection signal="pressed" from="buttons/quit_button" to="." method="_on_quit_button_pressed"]