Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a method to rename a user profile to ModLoaderUserProfile #287

Open
1 task
Tracked by #340
KANAjetzt opened this issue Jun 20, 2023 · 3 comments · May be fixed by #352
Open
1 task
Tracked by #340

Add a method to rename a user profile to ModLoaderUserProfile #287

KANAjetzt opened this issue Jun 20, 2023 · 3 comments · May be fixed by #352
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@KANAjetzt
Copy link
Collaborator

KANAjetzt commented Jun 20, 2023

hello_wö̶͛r̴͗͜l̶̽͠d̵̃͋ ♦ — Today at 20:59
other note (cant rename custom profile names)

@KANAjetzt KANAjetzt added the enhancement New feature or request label Jun 20, 2023
@KANAjetzt KANAjetzt added this to the v6.1.0 milestone Jun 20, 2023
@KANAjetzt KANAjetzt self-assigned this Jun 20, 2023
@KANAjetzt KANAjetzt modified the milestones: v6.2.0, v6.3.0 Jul 4, 2023
@kyooosukedn
Copy link

Hi, would love to contribute

@KANAjetzt
Copy link
Collaborator Author

@kyooosukedn, sure thing! Let me know if you have any questions. You can start by looking at profile.gd.

Here is the function that creates a profile:

static func create_profile(profile_name: String) -> bool:
# Verify that the profile name is not already in use
if ModLoaderStore.user_profiles.has(profile_name):
ModLoaderLog.error("User profile with the name of \"%s\" already exists." % profile_name, LOG_NAME)
return false
var mod_list := _generate_mod_list()
var new_profile := _create_new_profile(profile_name, mod_list)
# If there was an error creating the new user profile return
if not new_profile:
return false
# Store the new profile in the ModLoaderStore
ModLoaderStore.user_profiles[profile_name] = new_profile
# Set it as the current profile
ModLoaderStore.current_user_profile = ModLoaderStore.user_profiles[profile_name]
# Store the new profile in the json file
var is_save_success := _save()
if is_save_success:
ModLoaderLog.debug("Created new user profile \"%s\"" % profile_name, LOG_NAME)
return is_save_success

There, you can see how profiles are stored. Let me know if something is unclear.

You can also read the Contributing Guidelines to get an idea of how you can start contributing.

@kyooosukedn
Copy link

Thank you for welcoming :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants