fix: refactoring path for settings panel

This commit is contained in:
tiger tiger tiger 2025-12-13 11:10:11 +01:00
parent ffe4f4461c
commit aefc236baa
2 changed files with 8 additions and 8 deletions

View File

@ -80,8 +80,6 @@ func _init(initial_filepath = "") -> void:
_is_initialised = true
func read_save_file() -> void:
print_debug("Reading Savegame from: %s" % filepath)
if not DirAccess.dir_exists_absolute(filepath.get_base_dir()):
DirAccess.make_dir_absolute(filepath.get_base_dir())
@ -95,7 +93,7 @@ func read_save_file() -> void:
return
if FileAccess.file_exists(filepath):
print_debug("Opening existing Savegame: %s" % filepath)
print_debug("Savegame: Reading from: %s" % filepath)
var file := FileAccess.open(filepath, FileAccess.READ)
var raw_json := FileAccess.get_file_as_string(filepath)
file.close()
@ -155,7 +153,7 @@ func read_save_file() -> void:
thumbnail = ImageTexture.create_from_image(tmp_img)
is_empty = false
else:
print_debug("Creating empty Savegame: %s" % filepath)
print_debug("Savegame: Creating (in memory) for path: %s" % filepath)
is_valid = true
func _get_save_dict() -> Dictionary:
@ -172,12 +170,14 @@ func _get_save_dict() -> Dictionary:
}
func save_to_file(screen_shot: Texture) -> void:
print_debug("Savegame: Saving to file: %s" % filepath)
if filepath == "DEBUG":
push_warning("Saving DEBUG save skipped. This is intentional.")
push_warning("Savegame: Saving DEBUG save skipped. This is intentional.")
return
if current_room == State.rooms.NULL:
print_debug("Not saving empty savegame.")
push_warning("Savegame: Not saving empty savegame.")
return
last_saved = int(Time.get_unix_time_from_system())

View File

@ -10,7 +10,7 @@ script/source = "extends Panel
@export var is_in_startup: bool
@onready var show_navigation_buttons = $\"CenterContainer/PanelContainer/VBoxContainer/TabContainer/physical Accessibility/Container2/margin/show nav ui\"
@onready var show_navigation_buttons = $\"SettingsContainer/PanelContainer/VBoxContainer/TabContainer/physical Accessibility/Container2/margin/show nav ui\"
func _ready():
theme = State.current_main_theme