@@ -12,12 +12,12 @@ const DEFAULT_CONFIG_NAME := "default"
1212## Creates a new configuration for a mod.[br]
1313## [br]
1414## [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]
1818## [br]
1919## [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.
2121static func create_config (mod_id : String , config_name : String , config_data : Dictionary ) -> ModConfig :
2222 var default_config : ModConfig = get_default_config (mod_id )
2323 if not default_config :
@@ -72,7 +72,7 @@ static func create_config(mod_id: String, config_name: String, config_data: Dict
7272## Updates an existing [ModConfig] object with new data and saves the config file.[br]
7373## [br]
7474## [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]
7676## [br]
7777## [b]Returns:[/b][br]
7878## - [ModConfig]: The updated [ModConfig] object if successful, or null otherwise.
@@ -104,10 +104,10 @@ static func update_config(config: ModConfig) -> ModConfig:
104104## Deletes a [ModConfig] object and performs cleanup operations.[br]
105105## [br]
106106## [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]
108108## [br]
109109## [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.
111111static func delete_config (config : ModConfig ) -> bool :
112112 # Check if the config is the "default" config, which cannot be deleted
113113 if config .name == DEFAULT_CONFIG_NAME :
@@ -131,15 +131,15 @@ static func delete_config(config: ModConfig) -> bool:
131131## Sets the current configuration of a mod to the specified configuration.[br]
132132## [br]
133133## [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.
135135static func set_current_config (config : ModConfig ) -> void :
136136 ModLoaderStore .mod_data [config .mod_id ].current_config = config
137137
138138
139139## Returns the schema for the specified mod id.[br]
140140## [br]
141141## [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]
143143## [br]
144144## [b]Returns:[/b][br]
145145## - A dictionary representing the schema for the mod's configuration file.
@@ -158,8 +158,8 @@ static func get_config_schema(mod_id: String) -> Dictionary:
158158## Retrieves the schema for a specific property key.[br]
159159## [br]
160160## [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]
163163## [br]
164164## [b]Returns:[/b][br]
165165## - [Dictionary]: The schema dictionary for the specified property.
@@ -182,16 +182,16 @@ static func get_schema_for_prop(config: ModConfig, prop: String) -> Dictionary:
182182 return schema_for_prop
183183
184184
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.
195195static func _traverse_schema (schema_prop : Dictionary , prop_key_array : Array ) -> Dictionary :
196196 # Return the current schema_prop if the prop_key_array is empty (reached the destination property)
197197 if prop_key_array .is_empty ():
@@ -219,7 +219,7 @@ static func _traverse_schema(schema_prop: Dictionary, prop_key_array: Array) ->
219219## Retrieves an Array of mods that have configuration files.[br]
220220## [br]
221221## [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.
223223static func get_mods_with_config () -> Array :
224224 # Create an empty array to store mods with configuration files
225225 var mods_with_config := []
@@ -241,10 +241,10 @@ static func get_mods_with_config() -> Array:
241241## Retrieves the configurations dictionary for a given mod ID.[br]
242242## [br]
243243## [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]
245245## [br]
246246## [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.
248248## If the mod ID is invalid or no configurations are found, an empty dictionary is returned.
249249static func get_configs (mod_id : String ) -> Dictionary :
250250 # Check if the mod ID is invalid
@@ -265,11 +265,11 @@ static func get_configs(mod_id: String) -> Dictionary:
265265## Retrieves the configuration for a specific mod and configuration name.[br]
266266## [br]
267267## [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]
270270## [br]
271271## [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.
273273static func get_config (mod_id : String , config_name : String ) -> ModConfig :
274274 var configs := get_configs (mod_id )
275275
@@ -283,10 +283,10 @@ static func get_config(mod_id: String, config_name: String) -> ModConfig:
283283## Checks whether a mod has a current configuration set.[br]
284284## [br]
285285## [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]
287287## [br]
288288## [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.
290290static func has_current_config (mod_id : String ) -> bool :
291291 var mod_data := ModLoaderMod .get_mod_data (mod_id )
292292 return not mod_data .current_config == null
@@ -295,11 +295,11 @@ static func has_current_config(mod_id: String) -> bool:
295295## Checks whether a mod has a configuration with the specified name.[br]
296296## [br]
297297## [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]
300300## [br]
301301## [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.
303303static func has_config (mod_id : String , config_name : String ) -> bool :
304304 var mod_data := ModLoaderMod .get_mod_data (mod_id )
305305 return mod_data .configs .has (config_name )
@@ -308,10 +308,10 @@ static func has_config(mod_id: String, config_name: String) -> bool:
308308## Retrieves the default configuration for a specified mod ID.[br]
309309## [br]
310310## [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]
312312## [br]
313313## [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.
315315## If the mod ID is invalid or no configuration is found, returns null.
316316static func get_default_config (mod_id : String ) -> ModConfig :
317317 return get_config (mod_id , DEFAULT_CONFIG_NAME )
@@ -320,10 +320,10 @@ static func get_default_config(mod_id: String) -> ModConfig:
320320## Retrieves the currently active configuration for a specific mod.[br]
321321## [br]
322322## [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]
324324## [br]
325325## [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.
327327static func get_current_config (mod_id : String ) -> ModConfig :
328328 var current_config_name := get_current_config_name (mod_id )
329329 var current_config : ModConfig
@@ -341,10 +341,10 @@ static func get_current_config(mod_id: String) -> ModConfig:
341341## Retrieves the name of the current configuration for a specific mod.[br]
342342## [br]
343343## [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]
345345## [br]
346346## [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.
348348static func get_current_config_name (mod_id : String ) -> String :
349349 # Check if user profile has been loaded
350350 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:
369369## Refreshes the data of the provided configuration by reloading it from the config file.[br]
370370## [br]
371371## [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]
373373## [br]
374374## [b]Returns:[/b][br]
375375## - [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:
383383
384384
385385## 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]
387386## [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]
388392## This function ensures that any changes made to the configuration files outside the application
389393## are reflected within the application's runtime, allowing for dynamic updates without the need for a restart.
390394static func refresh_current_configs () -> void :
0 commit comments