@@ -12,12 +12,12 @@ const DEFAULT_CONFIG_NAME := "default"
12
12
## Creates a new configuration for a mod.[br]
13
13
## [br]
14
14
## [b]Parameters:[/b][br]
15
- ## - [code] mod_id[/code ] ([String]): The ID of the mod.[br]
16
- ## - [code] config_name[/code ] ([String]): The name of the configuration.[br]
17
- ## - [code] config_data[/code ] ([Dictionary]): The configuration data to be stored.[br]
15
+ ## - [param mod_id] ([String]): The ID of the mod.[br]
16
+ ## - [param config_name] ([String]): The name of the configuration.[br]
17
+ ## - [param config_data] ([Dictionary]): The configuration data to be stored.[br]
18
18
## [br]
19
19
## [b]Returns:[/b][br]
20
- ## - [ModConfig]: The created ModConfig object if successful, or null otherwise.
20
+ ## - [ModConfig]: The created [ ModConfig] object if successful, or null otherwise.
21
21
static func create_config (mod_id : String , config_name : String , config_data : Dictionary ) -> ModConfig :
22
22
var default_config : ModConfig = get_default_config (mod_id )
23
23
if not default_config :
@@ -72,7 +72,7 @@ static func create_config(mod_id: String, config_name: String, config_data: Dict
72
72
## Updates an existing [ModConfig] object with new data and saves the config file.[br]
73
73
## [br]
74
74
## [b]Parameters:[/b][br]
75
- ## - [code] config[/code ] ([ModConfig]): The [ModConfig] object to be updated.[br]
75
+ ## - [param config] ([ModConfig]): The [ModConfig] object to be updated.[br]
76
76
## [br]
77
77
## [b]Returns:[/b][br]
78
78
## - [ModConfig]: The updated [ModConfig] object if successful, or null otherwise.
@@ -104,10 +104,10 @@ static func update_config(config: ModConfig) -> ModConfig:
104
104
## Deletes a [ModConfig] object and performs cleanup operations.[br]
105
105
## [br]
106
106
## [b]Parameters:[/b][br]
107
- ## - [code] config[/code ] ([ModConfig]): The [ModConfig] object to be deleted.[br]
107
+ ## - [param config] ([ModConfig]): The [ModConfig] object to be deleted.[br]
108
108
## [br]
109
109
## [b]Returns:[/b][br]
110
- ## - [code] bool[/code ]: True if the deletion was successful, False otherwise.
110
+ ## - [bool]: True if the deletion was successful, False otherwise.
111
111
static func delete_config (config : ModConfig ) -> bool :
112
112
# Check if the config is the "default" config, which cannot be deleted
113
113
if config .name == DEFAULT_CONFIG_NAME :
@@ -131,15 +131,15 @@ static func delete_config(config: ModConfig) -> bool:
131
131
## Sets the current configuration of a mod to the specified configuration.[br]
132
132
## [br]
133
133
## [b]Parameters:[/b][br]
134
- ## - [code] config[/code ] ([ModConfig]): The [ModConfig] object to be set as current config.
134
+ ## - [param config] ([ModConfig]): The [ModConfig] object to be set as current config.
135
135
static func set_current_config (config : ModConfig ) -> void :
136
136
ModLoaderStore .mod_data [config .mod_id ].current_config = config
137
137
138
138
139
139
## Returns the schema for the specified mod id.[br]
140
140
## [br]
141
141
## [b]Parameters:[/b][br]
142
- ## - [code] mod_id[/code ] (String): the ID of the mod.[br]
142
+ ## - [param mod_id] ([ String] ): The ID of the mod.[br]
143
143
## [br]
144
144
## [b]Returns:[/b][br]
145
145
## - A dictionary representing the schema for the mod's configuration file.
@@ -158,8 +158,8 @@ static func get_config_schema(mod_id: String) -> Dictionary:
158
158
## Retrieves the schema for a specific property key.[br]
159
159
## [br]
160
160
## [b]Parameters:[/b][br]
161
- ## - [code] config[/code ] ([ModConfig]): The [ModConfig] object from which to retrieve the schema.[br]
162
- ## - [code] prop[/code ] ([String]): The property key for which to retrieve the schema.[br]
161
+ ## - [param config] ([ModConfig]): The [ModConfig] object from which to retrieve the schema.[br]
162
+ ## - [param prop] ([String]): The property key for which to retrieve the schema.[br]
163
163
## [br]
164
164
## [b]Returns:[/b][br]
165
165
## - [Dictionary]: The schema dictionary for the specified property.
@@ -182,16 +182,16 @@ static func get_schema_for_prop(config: ModConfig, prop: String) -> Dictionary:
182
182
return schema_for_prop
183
183
184
184
185
- ## Recursively traverses the schema dictionary based on the provided [code]prop_key_array[/code]
186
- ## and returns the corresponding schema for the target property.[br]
187
- ## [br]
188
- ## [b]Parameters:[/b][br]
189
- ## - [code] schema_prop[/code ]: The current schema dictionary to traverse.[br]
190
- ## - [code] prop_key_array[/code ]: An array containing the property keys representing the path to the target property.[br]
191
- ## [br]
192
- ## [b]Returns:[/b][br]
193
- ## The schema dictionary corresponding to the target property specified by the [code]prop_key_array[/code].[br]
194
- ## If the target property is not found, an empty dictionary is returned.
185
+ # Recursively traverses the schema dictionary based on the provided [code]prop_key_array[/code]
186
+ # and returns the corresponding schema for the target property.[br]
187
+ # [br]
188
+ # [b]Parameters:[/b][br]
189
+ # - [param schema_prop]: The current schema dictionary to traverse.[br]
190
+ # - [param prop_key_array]: An array containing the property keys representing the path to the target property.[br]
191
+ # [br]
192
+ # [b]Returns:[/b][br]
193
+ # - [Dictionary]: The schema dictionary corresponding to the target property specified by the [code]prop_key_array[/code].
194
+ # If the target property is not found, an empty dictionary is returned.
195
195
static func _traverse_schema (schema_prop : Dictionary , prop_key_array : Array ) -> Dictionary :
196
196
# Return the current schema_prop if the prop_key_array is empty (reached the destination property)
197
197
if prop_key_array .is_empty ():
@@ -219,7 +219,7 @@ static func _traverse_schema(schema_prop: Dictionary, prop_key_array: Array) ->
219
219
## Retrieves an Array of mods that have configuration files.[br]
220
220
## [br]
221
221
## [b]Returns:[/b][br]
222
- ## - An Array containing the mod data of mods that have configuration files.
222
+ ## - [Array]: An Array containing the mod data of mods that have configuration files.
223
223
static func get_mods_with_config () -> Array :
224
224
# Create an empty array to store mods with configuration files
225
225
var mods_with_config := []
@@ -241,10 +241,10 @@ static func get_mods_with_config() -> Array:
241
241
## Retrieves the configurations dictionary for a given mod ID.[br]
242
242
## [br]
243
243
## [b]Parameters:[/b][br]
244
- ## - [code] mod_id[/code ]: The ID of the mod.[br]
244
+ ## - [param mod_id]: The ID of the mod.[br]
245
245
## [br]
246
246
## [b]Returns:[/b][br]
247
- ## - A dictionary containing the configurations for the specified mod.
247
+ ## - [Dictionary]: A dictionary containing the configurations for the specified mod.
248
248
## If the mod ID is invalid or no configurations are found, an empty dictionary is returned.
249
249
static func get_configs (mod_id : String ) -> Dictionary :
250
250
# Check if the mod ID is invalid
@@ -265,11 +265,11 @@ static func get_configs(mod_id: String) -> Dictionary:
265
265
## Retrieves the configuration for a specific mod and configuration name.[br]
266
266
## [br]
267
267
## [b]Parameters:[/b][br]
268
- ## - [code] mod_id[/code ] ([String]): The ID of the mod.[br]
269
- ## - [code] config_name[/code ] ([String]): The name of the configuration.[br]
268
+ ## - [param mod_id] ([String]): The ID of the mod.[br]
269
+ ## - [param config_name] ([String]): The name of the configuration.[br]
270
270
## [br]
271
271
## [b]Returns:[/b][br]
272
- ## - The configuration as a [ModConfig] object or null if not found.
272
+ ## - [ModConfig]: The configuration as a [ModConfig] object or null if not found.
273
273
static func get_config (mod_id : String , config_name : String ) -> ModConfig :
274
274
var configs := get_configs (mod_id )
275
275
@@ -283,10 +283,10 @@ static func get_config(mod_id: String, config_name: String) -> ModConfig:
283
283
## Checks whether a mod has a current configuration set.[br]
284
284
## [br]
285
285
## [b]Parameters:[/b][br]
286
- ## - [code] mod_id[/code ] ([String]): The ID of the mod.[br]
286
+ ## - [param mod_id] ([String]): The ID of the mod.[br]
287
287
## [br]
288
288
## [b]Returns:[/b][br]
289
- ## - [code] bool[/code ]: True if the mod has a current configuration, False otherwise.
289
+ ## - [bool]: True if the mod has a current configuration, false otherwise.
290
290
static func has_current_config (mod_id : String ) -> bool :
291
291
var mod_data := ModLoaderMod .get_mod_data (mod_id )
292
292
return not mod_data .current_config == null
@@ -295,11 +295,11 @@ static func has_current_config(mod_id: String) -> bool:
295
295
## Checks whether a mod has a configuration with the specified name.[br]
296
296
## [br]
297
297
## [b]Parameters:[/b][br]
298
- ## - [code] mod_id[/code ] ([String]): The ID of the mod.[br]
299
- ## - [code] config_name[/code ] ([String]): The name of the configuration.[br]
298
+ ## - [param mod_id] ([String]): The ID of the mod.[br]
299
+ ## - [param config_name] ([String]): The name of the configuration.[br]
300
300
## [br]
301
301
## [b]Returns:[/b][br]
302
- ## - [code] bool[/code ]: True if the mod has a configuration with the specified name, False otherwise.
302
+ ## - [bool]: True if the mod has a configuration with the specified name, False otherwise.
303
303
static func has_config (mod_id : String , config_name : String ) -> bool :
304
304
var mod_data := ModLoaderMod .get_mod_data (mod_id )
305
305
return mod_data .configs .has (config_name )
@@ -308,10 +308,10 @@ static func has_config(mod_id: String, config_name: String) -> bool:
308
308
## Retrieves the default configuration for a specified mod ID.[br]
309
309
## [br]
310
310
## [b]Parameters:[/b][br]
311
- ## - [code] mod_id[/code] : The ID of the mod.[br]
311
+ ## - [param mod_id] ([String]) : The ID of the mod.[br]
312
312
## [br]
313
313
## [b]Returns:[/b][br]
314
- ## - The [ModConfig] object representing the default configuration for the specified mod.
314
+ ## - [ModConfig]: The [ModConfig] object representing the default configuration for the specified mod.
315
315
## If the mod ID is invalid or no configuration is found, returns null.
316
316
static func get_default_config (mod_id : String ) -> ModConfig :
317
317
return get_config (mod_id , DEFAULT_CONFIG_NAME )
@@ -320,10 +320,10 @@ static func get_default_config(mod_id: String) -> ModConfig:
320
320
## Retrieves the currently active configuration for a specific mod.[br]
321
321
## [br]
322
322
## [b]Parameters:[/b][br]
323
- ## - [code] mod_id[/code ] ([String]): The ID of the mod.[br]
323
+ ## - [param mod_id] ([String]): The ID of the mod.[br]
324
324
## [br]
325
325
## [b]Returns:[/b][br]
326
- ## - The configuration as a [ModConfig] object or [code]null[/code] if not found.
326
+ ## - [ModConfig]: The configuration as a [ModConfig] object or [code]null[/code] if not found.
327
327
static func get_current_config (mod_id : String ) -> ModConfig :
328
328
var current_config_name := get_current_config_name (mod_id )
329
329
var current_config : ModConfig
@@ -341,10 +341,10 @@ static func get_current_config(mod_id: String) -> ModConfig:
341
341
## Retrieves the name of the current configuration for a specific mod.[br]
342
342
## [br]
343
343
## [b]Parameters:[/b][br]
344
- ## - [code] mod_id[/code ] ([String]): The ID of the mod.[br]
344
+ ## - [param mod_id] ([String]): The ID of the mod.[br]
345
345
## [br]
346
346
## [b]Returns:[/b][br]
347
- ## - The currently active configuration name for the given mod id or an empty string if not found.
347
+ ## - [String] The currently active configuration name for the given mod id or an empty string if not found.
348
348
static func get_current_config_name (mod_id : String ) -> String :
349
349
# Check if user profile has been loaded
350
350
if not ModLoaderStore .current_user_profile or not ModLoaderStore .user_profiles .has (ModLoaderStore .current_user_profile .name ):
@@ -369,7 +369,7 @@ static func get_current_config_name(mod_id: String) -> String:
369
369
## Refreshes the data of the provided configuration by reloading it from the config file.[br]
370
370
## [br]
371
371
## [b]Parameters:[/b][br]
372
- ## - [code] config[/code ] ([ModConfig]): The [ModConfig] object whose data needs to be refreshed.[br]
372
+ ## - [param config] ([ModConfig]): The [ModConfig] object whose data needs to be refreshed.[br]
373
373
## [br]
374
374
## [b]Returns:[/b][br]
375
375
## - [ModConfig]: The [ModConfig] object with refreshed data if successful, or the original object otherwise.
@@ -383,8 +383,12 @@ static func refresh_config_data(config: ModConfig) -> ModConfig:
383
383
384
384
385
385
## Iterates over all mods to refresh the data of their current configurations, if available.[br]
386
- ## Compares the previous configuration data with the refreshed data and emits the `current_config_changed` signal if changes are detected.[br]
387
386
## [br]
387
+ ## [b]Returns:[/b][br]
388
+ ## - No return value[br]
389
+ ## [br]
390
+ ## Compares the previous configuration data with the refreshed data and emits the [signal ModLoader.current_config_changed]
391
+ ## signal if changes are detected.[br]
388
392
## This function ensures that any changes made to the configuration files outside the application
389
393
## are reflected within the application's runtime, allowing for dynamic updates without the need for a restart.
390
394
static func refresh_current_configs () -> void :
0 commit comments