Skip to content

Commit 274fcd6

Browse files
committed
style: 🎨 renamed disk -> file
1 parent c707437 commit 274fcd6

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

addons/mod_loader/api/config.gd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static func create_config(mod_id: String, config_name: String, config_data: Dict
6060
# Store the mod_config in the mod's ModData
6161
ModLoaderStore.mod_data[mod_id].configs[config_name] = mod_config
6262
# Save the mod_config to a new config JSON file in the mod's config directory
63-
var is_save_success := mod_config.save_to_disc()
63+
var is_save_success := mod_config.save_to_file()
6464

6565
if not is_save_success:
6666
return null
@@ -70,7 +70,7 @@ static func create_config(mod_id: String, config_name: String, config_data: Dict
7070
return mod_config
7171

7272

73-
# Updates an existing ModConfig object with new data and saves it to disk.
73+
# Updates an existing ModConfig object with new data and save the config file.
7474
#
7575
# Parameters:
7676
# - config (ModConfig): The ModConfig object to be updated.
@@ -91,8 +91,8 @@ static func update_config(config: ModConfig) -> ModConfig:
9191
ModLoaderLog.error("Update for config \"%s\" failed validation with error message \"%s\"" % [config.name, error_message], LOG_NAME)
9292
return null
9393

94-
# Save the updated config to disk
95-
var is_save_success := config.save_to_disc()
94+
# Save the updated config to the config file
95+
var is_save_success := config.save_to_file()
9696

9797
if not is_save_success:
9898
ModLoaderLog.error("Failed to save config \"%s\" to \"%s\"." % [config.name, config.save_path], LOG_NAME)
@@ -119,7 +119,7 @@ static func delete_config(config: ModConfig) -> bool:
119119
set_current_config(get_default_config(config.mod_id))
120120

121121
# Remove the config file from the Mod Config directory
122-
var is_remove_success := config.remove_from_disc()
122+
var is_remove_success := config.remove_file()
123123

124124
if not is_remove_success:
125125
return false

addons/mod_loader/classes/mod_config.gd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ func is_valid() -> bool:
6767
return false
6868

6969

70-
# Saves the config data to disc
71-
func save_to_disc() -> bool:
70+
# Saves the config data to the config file
71+
func save_to_file() -> bool:
7272
var is_success := _ModLoaderFile.save_dictionary_to_json_file(data, save_path)
7373
return is_success
7474

7575

76-
# Removes the config data from disc
77-
func remove_from_disc() -> bool:
76+
# Removes the config file
77+
func remove_file() -> bool:
7878
var is_success := _ModLoaderFile.remove_file(save_path)
7979
return is_success

addons/mod_loader/classes/mod_manifest.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func load_mod_config_defaults() -> void:
210210
if not _ModLoaderFile.file_exists(config.save_path):
211211
# Generate config_default based on the default values in config_schema
212212
config.data = _generate_default_config_from_schema(config.schema.properties)
213-
# Save the default config to disk
213+
# Create the default config file
214214
_ModLoaderFile.save_dictionary_to_json_file(config.data, config.save_path)
215215
else:
216216
# If there is a default.json just load that

0 commit comments

Comments
 (0)