Skip to content

Commit

Permalink
add transient setting for hiding seekbar via cli
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilNarayana committed May 25, 2021
1 parent a07c3da commit bae5f24
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 2 additions & 0 deletions Source/Core/Core/ConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ struct SConfig : NonCopyable
bool m_InterfaceToolbar;
bool m_InterfaceStatusbar;
bool m_InterfaceSeekbar;
// a transient setting for when a program hides the seekbar via the command line
bool m_CLIHideSeekbar = false;
bool m_InterfaceLogWindow;
bool m_InterfaceLogConfigWindow;
bool m_InterfaceExtendedFPSInfo;
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Core/Slippi/SlippiPlayback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ void SlippiPlaybackStatus::SavestateThread()
processInitialState(iState);
inSlippiPlayback = true;
}
else if (SConfig::GetInstance().m_InterfaceSeekbar && !hasStateBeenProcessed && !isStartFrame)
else if (SConfig::GetInstance().m_InterfaceSeekbar && !SConfig::GetInstance().m_CLIHideSeekbar &&
!hasStateBeenProcessed && !isStartFrame)
{
INFO_LOG(SLIPPI, "saving diff at frame: %d", fixedFrameNumber);
State::SaveToBuffer(cState);
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/DolphinWX/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,8 @@ void CFrame::ParseHotkeys()
// Slippi replay hotkeys and setup
if (IsHotkey(HK_HIDE_SEEKBAR))
SConfig::GetInstance().m_InterfaceSeekbar = !SConfig::GetInstance().m_InterfaceSeekbar;
if (SConfig::GetInstance().m_InterfaceSeekbar && g_playbackStatus && g_playbackStatus->inSlippiPlayback)
if (SConfig::GetInstance().m_InterfaceSeekbar && !SConfig::GetInstance().m_CLIHideSeekbar && g_playbackStatus &&
g_playbackStatus->inSlippiPlayback)
{
if (IsHotkey(HK_JUMP_BACK))
g_playbackStatus->shouldJumpBack = true;
Expand Down
9 changes: 1 addition & 8 deletions Source/Core/DolphinWX/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,7 @@ bool DolphinApp::OnInit()
SConfig::GetInstance().m_strSlippiInput = "Slippi/playback.txt";

if (m_hide_seekbar) // Hide seekbar if necessary by cmd line (mostly for external recording applications)
{
m_prev_seekbar = SConfig::GetInstance().m_InterfaceSeekbar;
SConfig::GetInstance().m_InterfaceSeekbar = false;
}
SConfig::GetInstance().m_CLIHideSeekbar = true;

if (m_enable_cout) // Enable cout if necessary by cmd line (mostly for external recording applications)
SConfig::GetInstance().m_coutEnabled = true;
Expand Down Expand Up @@ -554,10 +551,6 @@ void DolphinApp::OnEndSession(wxCloseEvent &event)

int DolphinApp::OnExit()
{
if (m_hide_seekbar) // retain the seekbar setting from before cmd line switch
{
SConfig::GetInstance().m_InterfaceSeekbar = m_prev_seekbar;
}
Core::Shutdown();
UICommon::Shutdown();

Expand Down

0 comments on commit bae5f24

Please sign in to comment.