@@ -106,6 +106,7 @@ static func rename_profile(old_profile_name: String, new_profile_name: String) -
106
106
if not ModLoaderStore .user_profiles .has (old_profile_name ):
107
107
ModLoaderLog .error ("User profile with the name of \" %s \" does not exist." % old_profile_name , LOG_NAME )
108
108
return false
109
+ <<<<<< < HEAD
109
110
110
111
# Verify that the new profile_name is not already in use
111
112
if ModLoaderStore .user_profiles .has (new_profile_name ):
@@ -123,6 +124,25 @@ static func rename_profile(old_profile_name: String, new_profile_name: String) -
123
124
# Set it as the current profile
124
125
if ModLoaderStore .current_user_profile == old_profile_name :
125
126
ModLoaderStore .current_user_profile = new_profile_name
127
+ ====== =
128
+
129
+ # Verify that the new profile_name is not already in use
130
+ if ModLoaderStore .user_profiles .has (new_profile_name ):
131
+ ModLoaderLog .error ("User profile with the name of \" %s \" already exists." % new_profile_name , LOG_NAME )
132
+ return false
133
+
134
+ # Rename user profile
135
+ var profile_to_rename = ModLoaderStore .user_profiles [old_profile_name ].duplicate (true )
136
+ profile_to_rename .name = new_profile_name
137
+
138
+ # Remove old profile entry, replace it with new name entry in the ModLoaderStore
139
+ ModLoaderStore .user_profiles .erase (old_profile_name )
140
+ ModLoaderStore .user_profiles [new_profile_name ] = profile_to_rename
141
+
142
+ # Set it as the current profile
143
+ if ModLoaderStore .current_user_profile == ModLoaderStore .user_profiles [old_profile_name ]:
144
+ ModLoaderStore .current_user_profile [new_profile_name ]
145
+ >>>>>> > 5e66546 (Corrected false indentation and error )
126
146
127
147
# Store the new profile in the json file
128
148
var is_save_success := _save ()
0 commit comments