Add ability to remove the status bar

This commit is contained in:
zilmar 2021-03-18 11:02:37 +10:30
parent e063083803
commit 1249e1f9f0
21 changed files with 147 additions and 116 deletions

View File

@ -246,6 +246,8 @@
#470# "American Retail 64DD IPL ROM Path:"
#471# "Development 64DD IPL ROM Path:"
#472# "Disk Save Type:"
#473# "Enable Enhancements"
#474# "Show Status Bar"
//ROM Browser Tab
#480# "Max # of ROMs remembered (0-10):"

View File

@ -270,6 +270,7 @@ enum LanguageStringID
OPTION_IPL_ROM_TOOL_PATH = 471,
OPTION_DISKSAVETYPE = 472,
OPTION_ENABLE_ENHANCEMENTS = 473,
OPTION_SHOW_STATUS_BAR = 474,
//Rom Browser Tab
RB_MAX_ROMS = 480,

View File

@ -236,6 +236,7 @@ void CLanguage::LoadDefaultStrings(void)
DEF_STR(OPTION_IPL_ROM_TOOL_PATH, "Development 64DD IPL ROM Path:");
DEF_STR(OPTION_DISKSAVETYPE, "Disk Save Type:");
DEF_STR(OPTION_ENABLE_ENHANCEMENTS, "Enable Enhancements");
DEF_STR(OPTION_SHOW_STATUS_BAR, "Show Status Bar");
//ROM Browser Tab
DEF_STR(RB_MAX_ROMS, "Max # of ROMs remembered (0-10):");

View File

@ -329,7 +329,7 @@ enum SettingID
Logging_LogRomHeader,
Logging_LogUnknown,
FirstUISettings, LastUISettings = FirstUISettings + MaxPluginSetting,
FirstUISettings = MaxPluginSetting + 1, LastUISettings = FirstUISettings + MaxPluginSetting,
FirstRSPDefaultSet, LastRSPDefaultSet = FirstRSPDefaultSet + MaxPluginSetting,
FirstRSPSettings, LastRSPSettings = FirstRSPSettings + MaxPluginSetting,
FirstGfxDefaultSet, LastGfxDefaultSet = FirstGfxDefaultSet + MaxPluginSetting,

View File

@ -384,6 +384,10 @@ void SetWindowDisplaySize(HWND hWnd)
{
hStatusBar = FindWindowEx(hWnd, NULL, L"msctls_statusbar32", NULL);
}
if (hStatusBar != nullptr && !IsWindowVisible(hStatusBar))
{
hStatusBar = nullptr;
}
if (hToolBar != NULL)
{
GetWindowRect(hToolBar, &toolbarRect);

View File

@ -10,7 +10,7 @@ CGuiSettings::CGuiSettings()
if (m_RefCount == 1)
{
g_Settings->RegisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + Setting_AutoSleep),NULL,RefreshSettings);
g_Settings->RegisterChangeCB((SettingID)Setting_AutoSleep,NULL,RefreshSettings);
RefreshSettings(NULL);
}
}
@ -21,12 +21,12 @@ CGuiSettings::~CGuiSettings()
if (m_RefCount == 0)
{
g_Settings->UnregisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + Setting_AutoSleep),NULL,RefreshSettings);
g_Settings->UnregisterChangeCB((SettingID)Setting_AutoSleep,NULL,RefreshSettings);
}
}
void CGuiSettings::RefreshSettings(void *)
{
m_bCPURunning = g_Settings->LoadBool(GameRunning_CPU_Running);
m_bAutoSleep = UISettingsLoadBool(Setting_AutoSleep);
m_bCPURunning = g_Settings->LoadBool(GameRunning_CPU_Running);
m_bAutoSleep = g_Settings->LoadBool((SettingID)Setting_AutoSleep);
}

View File

@ -10,13 +10,13 @@ CNotificationSettings::~CNotificationSettings()
{
if (g_Settings)
{
g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + UserInterface_InFullScreen), this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->UnregisterChangeCB((SettingID)UserInterface_InFullScreen, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
}
}
void CNotificationSettings::RegisterNotifications()
{
g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + UserInterface_InFullScreen), this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->RegisterChangeCB((SettingID)UserInterface_InFullScreen, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
RefreshSettings();
}

View File

@ -8,152 +8,159 @@
#include <Project64-core/Settings/SettingType/SettingsType-SelectedDirectory.h>
#include <Project64-core/Settings/SettingType/SettingsType-TempBool.h>
void AddUISetting(UISettingID TypeID, CSettingType * Handler)
{
g_Settings->AddHandler((SettingID)TypeID, Handler);
}
void RegisterUISettings (void)
{
// Information - temporary keys
g_Settings->AddHandler((SettingID)(FirstUISettings + Info_ShortCutsChanged), new CSettingTypeTempBool(false));
AddUISetting(Info_ShortCutsChanged, new CSettingTypeTempBool(false));
// Support files
g_Settings->AddHandler((SettingID)(FirstUISettings + SupportFile_ShortCuts), new CSettingTypeApplicationPath("", "ShortCuts", (SettingID)(FirstUISettings + SupportFile_ShortCutsDefault)));
g_Settings->AddHandler((SettingID)(FirstUISettings + SupportFile_ShortCutsDefault), new CSettingTypeRelativePath("Config", "Project64.sc3"));
AddUISetting(SupportFile_ShortCuts, new CSettingTypeApplicationPath("", "ShortCuts", (SettingID)SupportFile_ShortCutsDefault));
AddUISetting(SupportFile_ShortCutsDefault, new CSettingTypeRelativePath("Config", "Project64.sc3"));
// Settings location
g_Settings->AddHandler((SettingID)(FirstUISettings + Setting_PluginPageFirst), new CSettingTypeApplication("Settings", "Plugin Page First", false));
g_Settings->AddHandler((SettingID)(FirstUISettings + Setting_DisableScrSaver), new CSettingTypeApplication("Settings", "Disable Screen Saver", (uint32_t)true));
g_Settings->AddHandler((SettingID)(FirstUISettings + Setting_EnableDiscordRPC), new CSettingTypeApplication("Settings", "Enable Discord RPC", true));
g_Settings->AddHandler((SettingID)(FirstUISettings + Setting_AutoSleep), new CSettingTypeApplication("Settings", "Auto Sleep", (uint32_t)true));
g_Settings->AddHandler((SettingID)(FirstUISettings + Setting_AutoFullscreen), new CSettingTypeApplication("Settings", "Auto Full Screen", (uint32_t)false));
AddUISetting(Setting_PluginPageFirst, new CSettingTypeApplication("Settings", "Plugin Page First", false));
AddUISetting(Setting_DisableScrSaver, new CSettingTypeApplication("Settings", "Disable Screen Saver", (uint32_t)true));
AddUISetting(Setting_EnableDiscordRPC, new CSettingTypeApplication("Settings", "Enable Discord RPC", true));
AddUISetting(Setting_AutoSleep, new CSettingTypeApplication("Settings", "Auto Sleep", (uint32_t)true));
AddUISetting(Setting_AutoFullscreen, new CSettingTypeApplication("Settings", "Auto Full Screen", (uint32_t)false));
// RDB settings
g_Settings->AddHandler((SettingID)(FirstUISettings + Rdb_Status), new CSettingTypeRomDatabase("Status", "Unknown"));
g_Settings->AddHandler((SettingID)(FirstUISettings + Rdb_NotesCore), new CSettingTypeRomDatabase("Core Note", ""));
g_Settings->AddHandler((SettingID)(FirstUISettings + Rdb_NotesPlugin), new CSettingTypeRomDatabase("Plugin Note", ""));
AddUISetting(Rdb_Status, new CSettingTypeRomDatabase("Status", "Unknown"));
AddUISetting(Rdb_NotesCore, new CSettingTypeRomDatabase("Core Note", ""));
AddUISetting(Rdb_NotesPlugin, new CSettingTypeRomDatabase("Plugin Note", ""));
// User interface
g_Settings->AddHandler((SettingID)(FirstUISettings + UserInterface_InFullScreen), new CSettingTypeTempBool(false));
g_Settings->AddHandler((SettingID)(FirstUISettings + UserInterface_MainWindowTop), new CSettingTypeApplication("Main Window", "Top", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + UserInterface_MainWindowLeft), new CSettingTypeApplication("Main Window", "Left", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + UserInterface_AlwaysOnTop), new CSettingTypeApplication("", "Always on top", (uint32_t)false));
AddUISetting(UserInterface_InFullScreen, new CSettingTypeTempBool(false));
AddUISetting(UserInterface_MainWindowTop, new CSettingTypeApplication("Main Window", "Top", Default_None));
AddUISetting(UserInterface_MainWindowLeft, new CSettingTypeApplication("Main Window", "Left", Default_None));
AddUISetting(UserInterface_AlwaysOnTop, new CSettingTypeApplication("Settings", "Always on top", (uint32_t)false));
AddUISetting(UserInterface_ShowStatusBar, new CSettingTypeApplication("Settings", "Show Status Bar", true));
g_Settings->AddHandler((SettingID)(FirstUISettings + RomBrowser_Enabled), new CSettingTypeApplication("Rom Browser", "Rom Browser", true));
g_Settings->AddHandler((SettingID)(FirstUISettings + RomBrowser_ColoumnsChanged), new CSettingTypeTempBool(false));
g_Settings->AddHandler((SettingID)(FirstUISettings + RomBrowser_Top), new CSettingTypeApplication("Rom Browser", "Top", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + RomBrowser_Left), new CSettingTypeApplication("Rom Browser", "Left", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + RomBrowser_Width), new CSettingTypeApplication("Rom Browser", "Width", (uint32_t)(640 * DPIScale())));
g_Settings->AddHandler((SettingID)(FirstUISettings + RomBrowser_Height), new CSettingTypeApplication("Rom Browser", "Height", (uint32_t)(480 * DPIScale())));
g_Settings->AddHandler((SettingID)(FirstUISettings + RomBrowser_PosIndex), new CSettingTypeApplicationIndex("Rom Browser\\Field Pos", "Field", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + RomBrowser_WidthIndex), new CSettingTypeApplicationIndex("Rom Browser\\Field Width", "Field", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + RomBrowser_SortFieldIndex), new CSettingTypeApplicationIndex("Rom Browser", "Sort Field", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + RomBrowser_SortAscendingIndex), new CSettingTypeApplicationIndex("Rom Browser", "Sort Ascending", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + RomBrowser_Maximized), new CSettingTypeApplication("Rom Browser", "Maximized", false));
AddUISetting(RomBrowser_Enabled, new CSettingTypeApplication("Rom Browser", "Rom Browser", true));
AddUISetting(RomBrowser_ColoumnsChanged, new CSettingTypeTempBool(false));
AddUISetting(RomBrowser_Top, new CSettingTypeApplication("Rom Browser", "Top", Default_None));
AddUISetting(RomBrowser_Left, new CSettingTypeApplication("Rom Browser", "Left", Default_None));
AddUISetting(RomBrowser_Width, new CSettingTypeApplication("Rom Browser", "Width", (uint32_t)(640 * DPIScale())));
AddUISetting(RomBrowser_Height, new CSettingTypeApplication("Rom Browser", "Height", (uint32_t)(480 * DPIScale())));
AddUISetting(RomBrowser_PosIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Pos", "Field", Default_None));
AddUISetting(RomBrowser_WidthIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Width", "Field", Default_None));
AddUISetting(RomBrowser_SortFieldIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Field", Default_None));
AddUISetting(RomBrowser_SortAscendingIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Ascending", Default_None));
AddUISetting(RomBrowser_Maximized, new CSettingTypeApplication("Rom Browser", "Maximized", false));
g_Settings->AddHandler((SettingID)(FirstUISettings + Directory_RecentGameDirCount), new CSettingTypeApplication("", "Remembered Rom Dirs", (uint32_t)10));
g_Settings->AddHandler((SettingID)(FirstUISettings + Directory_RecentGameDirIndex), new CSettingTypeApplicationIndex("Recent Dir", "Recent Dir", Default_None));
AddUISetting(Directory_RecentGameDirCount, new CSettingTypeApplication("Settings", "Remembered Rom Dirs", (uint32_t)10));
AddUISetting(Directory_RecentGameDirIndex, new CSettingTypeApplicationIndex("Recent Dir", "Recent Dir", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + Directory_LastSave), new CSettingTypeApplication("Directory", "Last Save Directory", Directory_InstantSave));
g_Settings->AddHandler((SettingID)(FirstUISettings + File_RecentGameFileCount), new CSettingTypeApplication("", "Remembered Rom Files", (uint32_t)10));
g_Settings->AddHandler((SettingID)(FirstUISettings + File_RecentGameFileIndex), new CSettingTypeApplicationIndex("Recent File", "Recent Rom", Default_None));
AddUISetting(Directory_LastSave, new CSettingTypeApplication("Directory", "Last Save Directory", Directory_InstantSave));
AddUISetting(File_RecentGameFileCount, new CSettingTypeApplication("Settings", "Remembered Rom Files", (uint32_t)10));
AddUISetting(File_RecentGameFileIndex, new CSettingTypeApplicationIndex("Recent File", "Recent Rom", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + SupportWindows_RunCount), new CSettingTypeApplication("Support Project64", "Run Count", (uint32_t)0));
AddUISetting(SupportWindows_RunCount, new CSettingTypeApplication("Support Project64", "Run Count", (uint32_t)0));
// Debugger UI
g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_CommandsPos), new CSettingTypeApplication("Debugger UI", "Commands Pos", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_MemoryPos), new CSettingTypeApplication("Debugger UI", "Memory Pos", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_MemoryDumpPos), new CSettingTypeApplication("Debugger UI", "Memory Dump Pos", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_MemorySearchPos), new CSettingTypeApplication("Debugger UI", "Memory Search Pos", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_DMALogPos), new CSettingTypeApplication("Debugger UI", "DMA Log Pos", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_CPULogPos), new CSettingTypeApplication("Debugger UI", "CPU Log Pos", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_ScriptsPos), new CSettingTypeApplication("Debugger UI", "Scripts Pos", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_StackPos), new CSettingTypeApplication("Debugger UI", "Stack Pos", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_StackTracePos), new CSettingTypeApplication("Debugger UI", "Stack Trace Pos", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_SymbolsPos), new CSettingTypeApplication("Debugger UI", "Symbols Pos", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_TLBPos), new CSettingTypeApplication("Debugger UI", "TLB Pos", Default_None));
g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_ExceptionBPPos), new CSettingTypeApplication("Debugger UI", "Exception BP Pos", Default_None));
AddUISetting(DebuggerUI_CommandsPos, new CSettingTypeApplication("Debugger UI", "Commands Pos", Default_None));
AddUISetting(DebuggerUI_MemoryPos, new CSettingTypeApplication("Debugger UI", "Memory Pos", Default_None));
AddUISetting(DebuggerUI_MemoryDumpPos, new CSettingTypeApplication("Debugger UI", "Memory Dump Pos", Default_None));
AddUISetting(DebuggerUI_MemorySearchPos, new CSettingTypeApplication("Debugger UI", "Memory Search Pos", Default_None));
AddUISetting(DebuggerUI_DMALogPos, new CSettingTypeApplication("Debugger UI", "DMA Log Pos", Default_None));
AddUISetting(DebuggerUI_CPULogPos, new CSettingTypeApplication("Debugger UI", "CPU Log Pos", Default_None));
AddUISetting(DebuggerUI_ScriptsPos, new CSettingTypeApplication("Debugger UI", "Scripts Pos", Default_None));
AddUISetting(DebuggerUI_StackPos, new CSettingTypeApplication("Debugger UI", "Stack Pos", Default_None));
AddUISetting(DebuggerUI_StackTracePos, new CSettingTypeApplication("Debugger UI", "Stack Trace Pos", Default_None));
AddUISetting(DebuggerUI_SymbolsPos, new CSettingTypeApplication("Debugger UI", "Symbols Pos", Default_None));
AddUISetting(DebuggerUI_TLBPos, new CSettingTypeApplication("Debugger UI", "TLB Pos", Default_None));
AddUISetting(DebuggerUI_ExceptionBPPos, new CSettingTypeApplication("Debugger UI", "Exception BP Pos", Default_None));
}
float DPIScale(void) {
float DPIScale(void)
{
return CClientDC(0).GetDeviceCaps(LOGPIXELSX) / 96.0f;
}
void UISettingsSaveBool(UISettingID Type, bool Value)
{
g_Settings->SaveBool((SettingID)(FirstUISettings + Type), Value);
g_Settings->SaveBool((SettingID)Type, Value);
}
void UISettingsSaveBoolIndex(UISettingID Type, int32_t index, bool Value)
{
g_Settings->SaveBoolIndex((SettingID)(FirstUISettings + Type), index, Value);
g_Settings->SaveBoolIndex((SettingID)Type, index, Value);
}
void UISettingsSaveDword(UISettingID Type, uint32_t Value)
{
g_Settings->SaveDword((SettingID)(FirstUISettings + Type), Value);
g_Settings->SaveDword((SettingID)Type, Value);
}
void UISettingsSaveDwordIndex(UISettingID Type, int32_t index, uint32_t Value)
{
g_Settings->SaveDwordIndex((SettingID)(FirstUISettings + Type), index, Value);
g_Settings->SaveDwordIndex((SettingID)Type, index, Value);
}
void UISettingsSaveString(UISettingID Type, const std::string & Value)
{
g_Settings->SaveString((SettingID)(FirstUISettings + Type), Value);
g_Settings->SaveString((SettingID)Type, Value);
}
void UISettingsSaveStringIndex(UISettingID Type, int32_t index, const std::string & Value)
{
g_Settings->SaveStringIndex((SettingID)(FirstUISettings + Type), index, Value);
g_Settings->SaveStringIndex((SettingID)Type, index, Value);
}
void UISettingsDeleteSettingIndex(UISettingID Type, int32_t index)
{
g_Settings->DeleteSettingIndex((SettingID)(FirstUISettings + Type), index);
g_Settings->DeleteSettingIndex((SettingID)Type, index);
}
bool UISettingsLoadBool(UISettingID Type)
{
return g_Settings->LoadBool((SettingID)(FirstUISettings + Type));
return g_Settings->LoadBool((SettingID)Type);
}
bool UISettingsLoadBoolIndex(UISettingID Type, int32_t index)
{
return g_Settings->LoadBoolIndex((SettingID)(FirstUISettings + Type),index);
return g_Settings->LoadBoolIndex((SettingID)Type,index);
}
uint32_t UISettingsLoadDword(UISettingID Type)
{
return g_Settings->LoadDword((SettingID)(FirstUISettings + Type));
return g_Settings->LoadDword((SettingID)Type);
}
bool UISettingsLoadDword(UISettingID Type, uint32_t & Value)
{
return g_Settings->LoadDword((SettingID)(FirstUISettings + Type), Value);
return g_Settings->LoadDword((SettingID)Type, Value);
}
bool UISettingsLoadDwordIndex(UISettingID Type, int index, uint32_t & Value)
{
return g_Settings->LoadDwordIndex((SettingID)(FirstUISettings + Type), index, Value);
return g_Settings->LoadDwordIndex((SettingID)Type, index, Value);
}
bool UISettingsLoadStringIndex(UISettingID Type, int32_t index, std::string & Value)
{
stdstr ValueRes;
bool res = g_Settings->LoadStringIndex((SettingID)(FirstUISettings + Type), index, ValueRes);
bool res = g_Settings->LoadStringIndex((SettingID)Type, index, ValueRes);
Value = ValueRes;
return res;
}
std::string UISettingsLoadStringIndex(UISettingID Type, int32_t index)
{
return g_Settings->LoadStringIndex((SettingID)(FirstUISettings + Type), index);
return g_Settings->LoadStringIndex((SettingID)Type, index);
}
std::string UISettingsLoadStringVal(UISettingID Type)
{
return g_Settings->LoadStringVal((SettingID)(FirstUISettings + Type));
return g_Settings->LoadStringVal((SettingID)Type);
}
bool UISettingsLoadStringVal(UISettingID Type, char * Buffer, int32_t BufferSize)
{
return g_Settings->LoadStringVal((SettingID)(FirstUISettings + Type),Buffer,BufferSize);
return g_Settings->LoadStringVal((SettingID)Type,Buffer,BufferSize);
}

View File

@ -4,6 +4,8 @@
enum UISettingID
{
StartUISetting = SettingID::FirstUISettings,
// Information - temporary keys
Info_ShortCutsChanged,
@ -28,6 +30,7 @@ enum UISettingID
UserInterface_MainWindowTop,
UserInterface_MainWindowLeft,
UserInterface_AlwaysOnTop,
UserInterface_ShowStatusBar,
RomBrowser_Enabled,
RomBrowser_ColoumnsChanged,

View File

@ -57,7 +57,7 @@ CMainMenu::CMainMenu(CMainGui * hMainWindow) :
for (UISettingList::const_iterator iter = m_ChangeUISettingList.begin(); iter != m_ChangeUISettingList.end(); iter++)
{
g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + *iter), this, (CSettings::SettingChangedFunc)SettingsChanged);
g_Settings->RegisterChangeCB((SettingID)*iter, this, (CSettings::SettingChangedFunc)SettingsChanged);
}
for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++)
{
@ -69,7 +69,7 @@ CMainMenu::~CMainMenu()
{
for (UISettingList::const_iterator iter = m_ChangeUISettingList.begin(); iter != m_ChangeUISettingList.end(); iter++)
{
g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + *iter), this, (CSettings::SettingChangedFunc)SettingsChanged);
g_Settings->UnregisterChangeCB((SettingID)*iter, this, (CSettings::SettingChangedFunc)SettingsChanged);
}
for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++)
{

View File

@ -38,15 +38,16 @@ CMainGui::CMainGui(bool bMainWindow, const char * WindowTitle) :
if (m_bMainWindow)
{
g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + RomBrowser_Enabled), this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged);
g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + RomBrowser_ColoumnsChanged), this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + Setting_EnableDiscordRPC), this, (CSettings::SettingChangedFunc)DiscordRPCChanged);
g_Settings->RegisterChangeCB((SettingID)RomBrowser_Enabled, this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged);
g_Settings->RegisterChangeCB((SettingID)RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
g_Settings->RegisterChangeCB((SettingID)Setting_EnableDiscordRPC, this, (CSettings::SettingChangedFunc)DiscordRPCChanged);
g_Settings->RegisterChangeCB(RomList_GameDirRecursive, this, (CSettings::SettingChangedFunc)RomBrowserListChanged);
g_Settings->RegisterChangeCB(RomList_ShowFileExtensions, this, (CSettings::SettingChangedFunc)RomBrowserListChanged);
g_Settings->RegisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged);
g_Settings->RegisterChangeCB(GameRunning_CPU_Running, this, (CSettings::SettingChangedFunc)GameCpuRunning);
g_Settings->RegisterChangeCB(GameRunning_CPU_Paused, this, (CSettings::SettingChangedFunc)GamePaused);
g_Settings->RegisterChangeCB(Game_File, this, (CSettings::SettingChangedFunc)GameLoaded);
g_Settings->RegisterChangeCB((SettingID)UserInterface_ShowStatusBar, this, (CSettings::SettingChangedFunc)ShowStatusBarChanged);
if (UISettingsLoadBool(Setting_EnableDiscordRPC))
{
@ -65,16 +66,17 @@ CMainGui::~CMainGui(void)
WriteTrace(TraceUserInterface, TraceDebug, "Start");
if (m_bMainWindow)
{
g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + RomBrowser_Enabled), this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged);
g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + RomBrowser_ColoumnsChanged), this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + Setting_EnableDiscordRPC), this, (CSettings::SettingChangedFunc)DiscordRPCChanged);
g_Settings->UnregisterChangeCB((SettingID)RomBrowser_Enabled, this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged);
g_Settings->UnregisterChangeCB((SettingID)RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
g_Settings->UnregisterChangeCB((SettingID)Setting_EnableDiscordRPC, this, (CSettings::SettingChangedFunc)DiscordRPCChanged);
g_Settings->UnregisterChangeCB(RomList_GameDirRecursive, this, (CSettings::SettingChangedFunc)RomBrowserListChanged);
g_Settings->UnregisterChangeCB(RomList_ShowFileExtensions, this, (CSettings::SettingChangedFunc)RomBrowserListChanged);
g_Settings->UnregisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged);
g_Settings->UnregisterChangeCB(GameRunning_CPU_Running, this, (CSettings::SettingChangedFunc)GameCpuRunning);
g_Settings->UnregisterChangeCB(GameRunning_CPU_Paused, this, (CSettings::SettingChangedFunc)GamePaused);
g_Settings->UnregisterChangeCB(Game_File, this, (CSettings::SettingChangedFunc)GameLoaded);
g_Settings->UnregisterChangeCB((SettingID)UserInterface_ShowStatusBar, this, (CSettings::SettingChangedFunc)ShowStatusBarChanged);
if (UISettingsLoadBool(Setting_EnableDiscordRPC))
{
CDiscord::Shutdown();
@ -253,6 +255,18 @@ void CMainGui::GameCpuRunning(CMainGui * Gui)
}
}
void CMainGui::ShowStatusBarChanged(CMainGui * Gui)
{
if (!Gui->bCPURunning())
{
ShowWindow(Gui->m_hStatusWnd, g_Settings->LoadBool((SettingID)UserInterface_ShowStatusBar) ? SW_SHOW : SW_HIDE);
RECT rc;
GetClientRect(Gui->m_hMainWindow, &rc);
Gui->ResizeRomList((WORD)(rc.right - rc.left), (WORD)(rc.bottom - rc.top));
}
}
void RomBowserColoumnsChanged(CMainGui * Gui)
{
Gui->ResetRomBrowserColomuns();
@ -286,9 +300,9 @@ void CMainGui::ChangeWinSize(long width, long height)
wndpl.length = sizeof(wndpl);
GetWindowPlacement(m_hMainWindow, &wndpl);
if ((HWND)m_hStatusWnd != NULL)
if (m_hStatusWnd != nullptr && IsWindowVisible(m_hStatusWnd))
{
GetClientRect((HWND)m_hStatusWnd, &swrect);
GetClientRect(m_hStatusWnd, &swrect);
SetRect(&rc1, 0, 0, width, height + swrect.bottom);
}
else
@ -301,6 +315,11 @@ void CMainGui::ChangeWinSize(long width, long height)
MoveWindow(m_hMainWindow, wndpl.rcNormalPosition.left, wndpl.rcNormalPosition.top, rc1.right - rc1.left, rc1.bottom - rc1.top, TRUE);
}
void * CMainGui::GetStatusBar(void) const
{
return g_Settings->LoadBool((SettingID)UserInterface_ShowStatusBar) ? m_hStatusWnd : nullptr;
}
void * CMainGui::GetModuleInstance(void) const
{
return GetModuleHandle(NULL);
@ -378,6 +397,7 @@ void CMainGui::CreateStatusBar(void)
{
m_hStatusWnd = (HWND)CreateStatusWindow(WS_CHILD | WS_VISIBLE, L"", m_hMainWindow, StatusBarID);
SendMessage((HWND)m_hStatusWnd, SB_SETTEXT, 0, (LPARAM)"");
ShowWindow(m_hStatusWnd, g_Settings->LoadBool((SettingID)UserInterface_ShowStatusBar) ? SW_SHOW : SW_HIDE);
}
WPARAM CMainGui::ProcessAllMessages(void)
@ -431,14 +451,14 @@ void CMainGui::Resize(DWORD /*fwSizeType*/, WORD nWidth, WORD nHeight)
{
RECT clrect, swrect;
GetClientRect(m_hMainWindow, &clrect);
GetClientRect((HWND)m_hStatusWnd, &swrect);
GetClientRect(m_hStatusWnd, &swrect);
int Parts[2];
Parts[0] = (int) (nWidth - 135 * DPIScale(m_hStatusWnd));
Parts[1] = nWidth;
SendMessage((HWND)m_hStatusWnd, SB_SETPARTS, 2, (LPARAM)&Parts[0]);
MoveWindow((HWND)m_hStatusWnd, 0, clrect.bottom - swrect.bottom, nWidth, nHeight, TRUE);
SendMessage(m_hStatusWnd, SB_SETPARTS, 2, (LPARAM)&Parts[0]);
MoveWindow(m_hStatusWnd, 0, clrect.bottom - swrect.bottom, nWidth, nHeight, TRUE);
}
void CMainGui::Show(bool Visible)
@ -481,7 +501,8 @@ int CMainGui::Width(void)
return rect.right - rect.left;
}
float CMainGui::DPIScale(HWND hWnd) {
float CMainGui::DPIScale(HWND hWnd)
{
return CClientDC(hWnd).GetDeviceCaps(LOGPIXELSX) / 96.0f;
}
@ -530,16 +551,17 @@ void CMainGui::SetStatusText(int Panel, const wchar_t * Text)
Msg[(sizeof(Message[0]) / sizeof(Message[0][0])) - 1] = 0;
if (GetCurrentThreadId() == m_ThreadId)
{
SendMessage((HWND)m_hStatusWnd, SB_SETTEXT, Panel, (LPARAM)Msg);
SendMessage(m_hStatusWnd, SB_SETTEXT, Panel, (LPARAM)Msg);
}
else {
PostMessage((HWND)m_hStatusWnd, SB_SETTEXT, Panel, (LPARAM)Msg);
else
{
PostMessage(m_hStatusWnd, SB_SETTEXT, Panel, (LPARAM)Msg);
}
}
void CMainGui::ShowStatusBar(bool ShowBar)
{
ShowWindow((HWND)m_hStatusWnd, ShowBar ? SW_SHOW : SW_HIDE);
ShowWindow(m_hStatusWnd, ShowBar ? SW_SHOW : SW_HIDE);
}
void CMainGui::SaveWindowLoc(void)

View File

@ -70,7 +70,7 @@ public:
void DisplayEnhancements(bool BlockExecution);
void * GetWindowHandle(void) const { return m_hMainWindow; }
void * GetStatusBar(void) const { return m_hStatusWnd; }
void * GetStatusBar(void) const;
void * GetModuleInstance(void) const;
inline CProjectSupport & Support(void) { return m_Support; }
@ -103,7 +103,8 @@ private:
static void GameLoaded(CMainGui * Gui);
static void GamePaused(CMainGui * Gui);
static void GameCpuRunning(CMainGui * Gui);
static void ShowStatusBarChanged(CMainGui * Gui);
CBaseMenu * m_Menu;
HWND m_hMainWindow, m_hStatusWnd;

View File

@ -434,11 +434,11 @@ void CRomBrowser::ResizeRomList(WORD nWidth, WORD nHeight)
UISettingsSaveDword(RomBrowser_Height, nHeight);
}
}
if (IsWindow((HWND)m_StatusWindow))
if (IsWindow(m_StatusWindow) && IsWindowVisible(m_StatusWindow))
{
RECT rc;
GetWindowRect((HWND)m_StatusWindow, &rc);
GetWindowRect(m_StatusWindow, &rc);
nHeight -= (WORD)(rc.bottom - rc.top);
}
MoveWindow(m_hRomList, 0, 0, nWidth, nHeight, TRUE);

View File

@ -18,6 +18,7 @@ CAdvancedOptionsPage::CAdvancedOptionsPage(HWND hParent, const RECT & rcDispay)
SetDlgItemText(IDC_CHECK_RUNNING, wGS(OPTION_CHECK_RUNNING).c_str());
SetDlgItemText(IDC_ENABLE_ENHANCEMENTS, wGS(OPTION_ENABLE_ENHANCEMENTS).c_str());
SetDlgItemText(IDC_DISPLAY_FRAMERATE, wGS(OPTION_CHANGE_FR).c_str());
SetDlgItemText(IDC_SHOW_STATUS_BAR, wGS(OPTION_SHOW_STATUS_BAR).c_str());
AddModCheckBox(GetDlgItem(IDC_START_ON_ROM_OPEN), Setting_AutoStart);
AddModCheckBox(GetDlgItem(IDC_ZIP), Setting_AutoZipInstantSave);
@ -28,6 +29,7 @@ CAdvancedOptionsPage::CAdvancedOptionsPage(HWND hParent, const RECT & rcDispay)
AddModCheckBox(GetDlgItem(IDC_CHECK_RUNNING), Setting_CheckEmuRunning);
AddModCheckBox(GetDlgItem(IDC_ENABLE_ENHANCEMENTS), Setting_Enhancement);
AddModCheckBox(GetDlgItem(IDC_DISPLAY_FRAMERATE), UserInterface_DisplayFrameRate);
AddModCheckBox(GetDlgItem(IDC_SHOW_STATUS_BAR), (SettingID)UserInterface_ShowStatusBar);
CModifiedComboBox * ComboBox;
ComboBox = AddModComboBox(GetDlgItem(IDC_FRAME_DISPLAY_TYPE), UserInterface_FrameDisplayType);

View File

@ -15,6 +15,7 @@ class CAdvancedOptionsPage :
COMMAND_ID_HANDLER_EX(IDC_ENABLE_ENHANCEMENTS, CheckBoxChanged)
COMMAND_ID_HANDLER_EX(IDC_UNIQUE_SAVE_DIR, CheckBoxChanged)
COMMAND_ID_HANDLER_EX(IDC_DISPLAY_FRAMERATE, CheckBoxChanged)
COMMAND_ID_HANDLER_EX(IDC_SHOW_STATUS_BAR, CheckBoxChanged)
COMMAND_HANDLER_EX(IDC_FRAME_DISPLAY_TYPE,LBN_SELCHANGE,ComboBoxChanged)
END_MSG_MAP()

View File

@ -16,7 +16,7 @@ CGameStatusPage::CGameStatusPage(HWND hParent, const RECT & rcDispay)
stdstr Status = UISettingsLoadStringVal(Rdb_Status);
CModifiedComboBoxTxt * ComboBox;
ComboBox = AddModComboBoxTxt(GetDlgItem(IDC_STATUS_TYPE), Rdb_Status);
ComboBox = AddModComboBoxTxt(GetDlgItem(IDC_STATUS_TYPE), (SettingID)Rdb_Status);
if (ComboBox)
{
for (CIniFile::strlist::iterator item = Keys.begin(); item != Keys.end(); item++)
@ -28,9 +28,9 @@ CGameStatusPage::CGameStatusPage(HWND hParent, const RECT & rcDispay)
ComboBox->SetTextField(GetDlgItem(IDC_STATUS_TEXT));
}
CModifiedEditBox * TxtBox;
TxtBox = AddModTextBox(GetDlgItem(IDC_NOTES_CORE), Rdb_NotesCore, true);
TxtBox = AddModTextBox(GetDlgItem(IDC_NOTES_CORE), (SettingID)Rdb_NotesCore, true);
TxtBox->SetTextField(GetDlgItem(IDC_NOTES_CORE_TEXT));
TxtBox = AddModTextBox(GetDlgItem(IDC_NOTES_PLUGIN), Rdb_NotesPlugin, true);
TxtBox = AddModTextBox(GetDlgItem(IDC_NOTES_PLUGIN), (SettingID)Rdb_NotesPlugin, true);
TxtBox->SetTextField(GetDlgItem(IDC_NOTES_PLUGIN_TEXT));
UpdatePageSettings();

View File

@ -23,7 +23,7 @@ COptionsGameBrowserPage::COptionsGameBrowserPage(HWND hParent, const RECT & rcDi
SetDlgItemText(IDC_UP, wGS(RB_UP).c_str());
SetDlgItemText(IDC_DOWN, wGS(RB_DOWN).c_str());
AddModCheckBox(GetDlgItem(IDC_USE_ROMBROWSER), RomBrowser_Enabled);
AddModCheckBox(GetDlgItem(IDC_USE_ROMBROWSER), (SettingID)RomBrowser_Enabled);
AddModCheckBox(GetDlgItem(IDC_RECURSION), RomList_GameDirRecursive);
AddModCheckBox(GetDlgItem(IDC_SHOW_FILE_EXTENSIONS), RomList_ShowFileExtensions);

View File

@ -21,16 +21,16 @@ m_SettingsConfig(SettingsConfig)
SetDlgItemText(IDC_ROMSEL_TEXT4, wGS(RB_DIRS).c_str());
SetDlgItemText(IDC_IPLDIR_TXT, wGS(OPTION_IPL_ROM_PATH).c_str());
AddModCheckBox(GetDlgItem(IDC_AUTOSLEEP), Setting_AutoSleep);
AddModCheckBox(GetDlgItem(IDC_LOAD_FULLSCREEN), Setting_AutoFullscreen);
AddModCheckBox(GetDlgItem(IDC_SCREEN_SAVER), Setting_DisableScrSaver);
AddModCheckBox(GetDlgItem(IDC_DISCORD_RPC), Setting_EnableDiscordRPC);
AddModCheckBox(GetDlgItem(IDC_AUTOSLEEP), (SettingID)Setting_AutoSleep);
AddModCheckBox(GetDlgItem(IDC_LOAD_FULLSCREEN), (SettingID)Setting_AutoFullscreen);
AddModCheckBox(GetDlgItem(IDC_SCREEN_SAVER), (SettingID)Setting_DisableScrSaver);
AddModCheckBox(GetDlgItem(IDC_DISCORD_RPC), (SettingID)Setting_EnableDiscordRPC);
AddModCheckBox(GetDlgItem(IDC_BASIC_MODE), UserInterface_BasicMode);
CModifiedEditBox * TxtBox = AddModTextBox(GetDlgItem(IDC_REMEMBER), File_RecentGameFileCount, false);
CModifiedEditBox * TxtBox = AddModTextBox(GetDlgItem(IDC_REMEMBER), (SettingID)File_RecentGameFileCount, false);
TxtBox->SetTextField(GetDlgItem(IDC_MAXROMS_TXT));
TxtBox = AddModTextBox(GetDlgItem(IDC_REMEMBERDIR), Directory_RecentGameDirCount, false);
TxtBox = AddModTextBox(GetDlgItem(IDC_REMEMBERDIR), (SettingID)Directory_RecentGameDirCount, false);
TxtBox->SetTextField(GetDlgItem(IDC_MAXROMDIR_TXT));
UpdatePageSettings();

View File

@ -174,11 +174,6 @@ protected:
return NULL;
}
CModifiedEditBox * AddModTextBox(HWND hWnd, UISettingID Type, bool bString)
{
return AddModTextBox(hWnd, (SettingID)(FirstUISettings + Type), bString);
}
void AddModCheckBox(HWND hWnd, SettingID Type)
{
ButtonList::iterator item = m_ButtonList.find(Type);
@ -195,11 +190,6 @@ protected:
}
}
void AddModCheckBox(HWND hWnd, UISettingID Type)
{
AddModCheckBox(hWnd, (SettingID)(FirstUISettings + Type));
}
CModifiedComboBox * AddModComboBox(HWND hWnd, SettingID Type)
{
ComboBoxList::iterator item = m_ComboBoxList.find(Type);
@ -236,11 +226,6 @@ protected:
return ComboBox;
}
CModifiedComboBoxTxt * AddModComboBoxTxt(HWND hWnd, UISettingID Type)
{
return AddModComboBoxTxt(hWnd, (SettingID)(FirstUISettings + Type));
}
void UpdateCheckBoxes(void)
{
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter++)

View File

@ -348,6 +348,7 @@ BEGIN
CONTROL "Unique Game Save Directory",IDC_UNIQUE_SAVE_DIR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,113,189,10
CONTROL "Frame rate display",IDC_DISPLAY_FRAMERATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,128,86,10
COMBOBOX IDC_FRAME_DISPLAY_TYPE,101,129,99,57,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "Show Status Bar",IDC_SHOW_STATUS_BAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,144,189,10
END
IDD_Settings_ShellInt DIALOGEX 0, 0, 231, 206

View File

@ -333,6 +333,7 @@
#define IDC_ENABLE_ENHANCEMENTS 1146
#define IDC_USA 1147
#define IDC_R14_EDIT 1147
#define IDC_SHOW_STATUS_BAR 1147
#define IDC_R15_EDIT 1148
#define IDC_SHELL_INT_TEXT 1149
#define IDC_COUNTFACT 1151