2018-08-25 08:05:54 +00:00
|
|
|
extends MarginContainer
|
|
|
|
|
|
|
|
var HUD_config_file = "user://hud.cfg"
|
|
|
|
|
|
|
|
|
|
|
|
func _ready():
|
|
|
|
var config_file = ConfigFile.new()
|
|
|
|
var err = config_file.load( HUD_config_file )
|
|
|
|
if err:
|
2020-01-05 15:36:41 +00:00
|
|
|
print("[res://gui_scene/GUI/HUD/HUD.gd:_ready] Error code when loading config file: ", err)
|
2018-08-25 08:05:54 +00:00
|
|
|
else:
|
|
|
|
for child in get_node("Windows" ).get_children():
|
|
|
|
child.load_from_file( config_file )
|
|
|
|
|
|
|
|
func _input( event ):
|
|
|
|
if event.is_action_pressed( "ui_music_controls" ):
|
|
|
|
$Windows/Music.visible = not $Windows/Music.visible
|
2020-01-05 15:16:07 +00:00
|
|
|
|
2018-08-25 08:05:54 +00:00
|
|
|
|
|
|
|
func _on_SaveHUD_pressed():
|
|
|
|
var config_file = ConfigFile.new()
|
|
|
|
var err = config_file.load( HUD_config_file )
|
|
|
|
if err:
|
2020-01-05 15:36:41 +00:00
|
|
|
print("[res://gui_scene/GUI/HUD/HUD.gd:_on_SaveHUD_pressed] Error code when loading config file: ", err)
|
2018-08-25 08:05:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
for child in get_node("Windows" ).get_children():
|
|
|
|
child.save_to_file( config_file )
|
|
|
|
|
|
|
|
config_file.save( HUD_config_file )
|