diff --git a/Settings/UI/MainSettings.cs b/Settings/UI/MainSettings.cs index 28108c1..ac0c313 100644 --- a/Settings/UI/MainSettings.cs +++ b/Settings/UI/MainSettings.cs @@ -613,6 +613,9 @@ public async void OnUpdateSaberOffset(float _) [UIAction("#profile-save")] public void OnProfileSave() => SaveProfile(); + [UIAction("#profile-list-reload")] + public void OnProfileListReload() => RefreshProfileList(); + public void Awake() { if (ProfileManager.profilesPresent) @@ -722,11 +725,7 @@ private void DeleteProfile() bool deleteSuccessful = ProfileManager.DeleteProfile(profileName, out string statusMsg); // Refresh UI - ProfileManager.LoadProfiles(); - ddlsProfiles.values = ProfileManager.profileNames; - profileListSelected = ddlsProfiles.values[0].ToString(); - ddlsProfiles.UpdateChoices(); - parserParams.EmitEvent("refresh-profile-list"); + RefreshProfileList(); if (!deleteSuccessful) { @@ -782,6 +781,15 @@ private void SaveProfile() ProfileStatusText.text = statusMsg; } + private void RefreshProfileList() + { + ProfileManager.LoadProfiles(); + ddlsProfiles.values = ProfileManager.profileNames; + profileListSelected = ddlsProfiles.values[0].ToString(); + ddlsProfiles.UpdateChoices(); + parserParams.EmitEvent("refresh-profile-list"); + } + private void UpdateSaberPosIncrement(PositionUnit unit) { switch (unit) diff --git a/Settings/UI/Views/mainsettings.bsml b/Settings/UI/Views/mainsettings.bsml index 476c313..e7f817f 100644 --- a/Settings/UI/Views/mainsettings.bsml +++ b/Settings/UI/Views/mainsettings.bsml @@ -266,8 +266,9 @@ - - + +