Skip to content

Commit 4f5f79e

Browse files
committed
feat: ✨ added duplicate_config
1 parent 62a0811 commit 4f5f79e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

addons/mod_loader/api/config.gd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,18 @@ static func delete_config(config: ModConfig) -> bool:
129129
return true
130130

131131

132+
# Duplicate an existing ModConfig
133+
#
134+
# Parameters:
135+
# - config (ModConfig): The ModConfig object to be duplicated.
136+
# - config_name (String): The name of the new configuration.
137+
#
138+
# Returns:
139+
# - ModConfig: The duplicated ModConfig object if successful, or null otherwise.
140+
static func duplicate_config(config: ModConfig, config_name: String) -> ModConfig:
141+
return create_config(config.mod_id, config_name, config.data)
142+
143+
132144
# Sets the current configuration of a mod to the specified configuration.
133145
#
134146
# Parameters:

0 commit comments

Comments
 (0)