Fix incorrect CurrentProfile in SteamController

This commit is contained in:
Kamil Trzciński 2022-11-26 12:15:38 +01:00
parent a16a8d5387
commit 3947dbc4ec
2 changed files with 4 additions and 7 deletions

View file

@ -2,6 +2,7 @@
- Introduce SteamController that provides 3 main modes of operation Desktop, X360 and Steam
- Fix `FanControl` broken context menu
- Fix incorrect `CurrentProfile` of `SteamController`
## 0.4.x

View file

@ -154,15 +154,12 @@ namespace SteamController
{
if (sharedData.GetValue(out var value) && value.DesiredProfile != "")
{
lock (context)
{
context.SelectProfile(value.DesiredProfile);
}
context.SelectProfile(value.DesiredProfile);
}
sharedData.SetValue(new SteamControllerSetting()
{
CurrentProfile = context.Profiles.FirstOrDefault((profile) => profile.Selected(context))?.Name,
CurrentProfile = context.OrderedProfiles.FirstOrDefault((profile) => profile.Selected(context))?.Name ?? "",
SelectableProfiles = context.Profiles.Where((profile) => profile.Selected(context) || profile.Visible).JoinWithN((profile) => profile.Name),
});
}
@ -172,10 +169,9 @@ namespace SteamController
lock (context)
{
context.Tick();
SharedData_Update();
}
SharedData_Update();
if (!context.Mouse.Valid)
{
notifyIcon.Text = TitleWithVersion + ". Cannot send input.";