Allow to select default profile

This commit is contained in:
Kamil Trzciński 2022-12-04 20:32:23 +01:00
parent f4431105e3
commit 271cb5d94e
4 changed files with 92 additions and 6 deletions

View file

@ -38,6 +38,11 @@ namespace SteamController
public Controller()
{
// Set available profiles
ProfilesSettings.Helpers.ProfileNameConverter.Profiles = context.Profiles.
Where((profile) => profile.Visible).
Select((profile) => profile.Name).ToArray();
Instance.RunOnce(TitleWithVersion, "Global\\SteamController");
var contextMenu = new ContextMenuStrip(components);
@ -114,7 +119,8 @@ namespace SteamController
context.SelectDefault = () =>
{
context.SelectProfile(Settings.Default.StartupProfile);
if (!context.SelectProfile(Settings.Default.DefaultProfile))
context.SelectProfile(context.Profiles.First().Name);
};
context.BackToDefault();