|
|
@ -20,6 +20,7 @@ signal close_save_list_ui |
|
|
|
|
|
|
|
|
|
|
|
var _game_data_resource: SaveGameDataResource = SaveGameDataResource.new() |
|
|
|
var _save_icon_size: Vector2i = Vector2i(896, 504) ## If Vector2.ZERO, uses the user's resolution |
|
|
|
var _save_level_data_component: SaveLevelDataComponent ## Contains the save paths and filenames |
|
|
|
|
|
|
|
|
|
|
@ -128,8 +129,6 @@ func _load_save_level_data_component() -> bool: |
|
|
|
func _load_game_resource(resource_filename: String) -> void: |
|
|
|
if not _load_save_level_data_component(): return |
|
|
|
|
|
|
|
EntityManager.reset_world.emit() |
|
|
|
|
|
|
|
var save_game_file_path: String = _save_level_data_component.settings.save_game_data_path + resource_filename |
|
|
|
if !FileAccess.file_exists(save_game_file_path): |
|
|
|
printerr("Failed to load save. File does not exist: ", save_game_file_path) |
|
|
@ -140,6 +139,8 @@ func _load_game_resource(resource_filename: String) -> void: |
|
|
|
printerr("Failed to load save. Unknown format? ", save_game_file_path) |
|
|
|
return |
|
|
|
|
|
|
|
EntityManager.reset_world.emit() |
|
|
|
|
|
|
|
var root_node: Window = get_tree().root |
|
|
|
for resource: Resource in _game_data_resource.save_data_nodes: |
|
|
|
if resource is Node3DDataResource: |
|
|
@ -180,6 +181,9 @@ func _take_save_screenshot(save_game_file_path: String) -> void: |
|
|
|
var _icon_filepath: String = save_game_file_path.replace(".tres", ".png") |
|
|
|
|
|
|
|
var _icon: Image = get_viewport().get_texture().get_image() |
|
|
|
if _save_icon_size != Vector2i.ZERO: |
|
|
|
_icon.resize(_save_icon_size.x, _save_icon_size.y) |
|
|
|
|
|
|
|
_icon.save_png(_icon_filepath) |
|
|
|
|
|
|
|
|
|
|
|