Skip to content

Commit

Permalink
GameMode: Fixed layout loading with "On Start" action
Browse files Browse the repository at this point in the history
  • Loading branch information
brianferguson committed Oct 9, 2022
1 parent f665399 commit c47f2a6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Library/GameMode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,14 @@ void GameMode::EnterGameMode()
rainmeter.DeleteAllUnmanagedSkins();
rainmeter.DeleteAllSkins();
rainmeter.DeleteAllUnmanagedSkins(); // Redelete unmanaged windows caused by OnCloseAction

m_State = State::Enabled;
}
else
{
LoadLayout(m_OnStartAction);
m_State = State::LayoutEnabled;
}

m_State = State::Enabled;
}

void GameMode::ExitGameMode(bool force)
Expand Down
2 changes: 2 additions & 0 deletions Library/GameMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class GameMode

bool IsDisabled() { return m_State == State::Disabled; }
bool IsEnabled() { return m_State == State::Enabled; }
bool IsLayoutEnabled() { return m_State == State::LayoutEnabled; }
bool IsForcedExit() { return m_State == State::ForcedExit; }

std::wstring& GetOnStartAction() { return m_OnStartAction; }
Expand Down Expand Up @@ -48,6 +49,7 @@ class GameMode
{
Disabled = 0U,
Enabled,
LayoutEnabled,
ForcedExit = 999U
};

Expand Down
2 changes: 1 addition & 1 deletion Library/Rainmeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ bool Rainmeter::LoadLayout(const std::wstring& name)
}

// Game mode: Only load layouts if game is disabled. Enabled or "ForcedExit" should not any skins.
if (GetGameMode().IsDisabled())
if (GetGameMode().IsDisabled() || GetGameMode().IsLayoutEnabled())
{
ReloadSettings();

Expand Down

0 comments on commit c47f2a6

Please sign in to comment.