From 3f35b8c9b4a87979a5094668209f0c22c00158c5 Mon Sep 17 00:00:00 2001 From: Chris Bloomfield <43499897+ithinkandicode@users.noreply.github.com> Date: Mon, 27 Feb 2023 11:27:53 +0000 Subject: [PATCH] Misc: Uncomment `code_note` code in file saving API methods --- addons/mod_loader/mod_loader_utils.gd | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/mod_loader/mod_loader_utils.gd b/addons/mod_loader/mod_loader_utils.gd index 8744531f..e8d7173a 100644 --- a/addons/mod_loader/mod_loader_utils.gd +++ b/addons/mod_loader/mod_loader_utils.gd @@ -498,11 +498,15 @@ static func save_string_to_file(save_string: String, filepath: String) -> bool: # Create directory if it doesn't exist yet var file_directory := filepath.get_base_dir() var dir := Directory.new() + + code_note(str( + "View error codes here:", + "https://docs.godotengine.org/en/stable/classes/class_%40globalscope.html#enum-globalscope-error" + )) + if not dir.dir_exists(file_directory): var makedir_error = dir.make_dir_recursive(file_directory) if not makedir_error == OK: - # @todo: Uncomment when PR #139 is merged: https://github.com/GodotModding/godot-mod-loader/pull/139 - #code_note("View error codes here: https://docs.godotengine.org/en/stable/classes/class_%40globalscope.html#enum-globalscope-error") log_fatal("Encountered an error (%s) when attempting to create a directory, with the path: %s" % [makedir_error, file_directory], LOG_NAME) return false @@ -512,8 +516,6 @@ static func save_string_to_file(save_string: String, filepath: String) -> bool: var fileopen_error = file.open(filepath, File.WRITE) if not fileopen_error == OK: - # @todo: Uncomment when PR #139 is merged: https://github.com/GodotModding/godot-mod-loader/pull/139 - #code_note("View error codes here: https://docs.godotengine.org/en/stable/classes/class_%40globalscope.html#enum-globalscope-error") log_fatal("Encountered an error (%s) when attempting to write to a file, with the path: %s" % [fileopen_error, filepath], LOG_NAME) return false