[Project] Separate out UI settings from core settings
This commit is contained in:
parent
500ebf70af
commit
d2d0cc7e2e
|
@ -21,9 +21,6 @@ enum SettingID
|
||||||
Default_None,
|
Default_None,
|
||||||
Default_Constant,
|
Default_Constant,
|
||||||
|
|
||||||
//information - temp keys
|
|
||||||
Info_ShortCutsChanged,
|
|
||||||
|
|
||||||
//Command Settings
|
//Command Settings
|
||||||
Cmd_BaseDirectory,
|
Cmd_BaseDirectory,
|
||||||
Cmd_RomFile,
|
Cmd_RomFile,
|
||||||
|
@ -42,23 +39,13 @@ enum SettingID
|
||||||
SupportFile_NotesDefault,
|
SupportFile_NotesDefault,
|
||||||
SupportFile_ExtInfo,
|
SupportFile_ExtInfo,
|
||||||
SupportFile_ExtInfoDefault,
|
SupportFile_ExtInfoDefault,
|
||||||
SupportFile_ShortCuts,
|
|
||||||
SupportFile_ShortCutsDefault,
|
|
||||||
SupportFile_RomListCache,
|
|
||||||
SupportFile_RomListCacheDefault,
|
|
||||||
SupportFile_7zipCache,
|
|
||||||
SupportFile_7zipCacheDefault,
|
|
||||||
|
|
||||||
//Settings
|
//Settings
|
||||||
Setting_ApplicationName,
|
Setting_ApplicationName,
|
||||||
Setting_UseFromRegistry,
|
Setting_UseFromRegistry,
|
||||||
Setting_RdbEditor,
|
Setting_RdbEditor,
|
||||||
Setting_CN64TimeCritical,
|
Setting_CN64TimeCritical,
|
||||||
Setting_PluginPageFirst,
|
|
||||||
Setting_DisableScrSaver,
|
|
||||||
Setting_AutoSleep,
|
|
||||||
Setting_AutoStart,
|
Setting_AutoStart,
|
||||||
Setting_AutoFullscreen,
|
|
||||||
Setting_CheckEmuRunning,
|
Setting_CheckEmuRunning,
|
||||||
Setting_EraseGameDefaults,
|
Setting_EraseGameDefaults,
|
||||||
|
|
||||||
|
@ -69,7 +56,7 @@ enum SettingID
|
||||||
Setting_CurrentLanguage,
|
Setting_CurrentLanguage,
|
||||||
Setting_EnableDisk,
|
Setting_EnableDisk,
|
||||||
|
|
||||||
//RDB TLB Settings
|
//RDB Settings
|
||||||
Rdb_GoodName,
|
Rdb_GoodName,
|
||||||
Rdb_SaveChip,
|
Rdb_SaveChip,
|
||||||
Rdb_CpuType,
|
Rdb_CpuType,
|
||||||
|
@ -80,9 +67,6 @@ enum SettingID
|
||||||
Rdb_DelaySi,
|
Rdb_DelaySi,
|
||||||
Rdb_32Bit,
|
Rdb_32Bit,
|
||||||
Rdb_FastSP,
|
Rdb_FastSP,
|
||||||
Rdb_Status,
|
|
||||||
Rdb_NotesCore,
|
|
||||||
Rdb_NotesPlugin,
|
|
||||||
Rdb_FixedAudio,
|
Rdb_FixedAudio,
|
||||||
Rdb_SyncViaAudio,
|
Rdb_SyncViaAudio,
|
||||||
Rdb_RspAudioSignal,
|
Rdb_RspAudioSignal,
|
||||||
|
@ -174,33 +158,9 @@ enum SettingID
|
||||||
UserInterface_BasicMode,
|
UserInterface_BasicMode,
|
||||||
UserInterface_ShowCPUPer,
|
UserInterface_ShowCPUPer,
|
||||||
UserInterface_DisplayFrameRate,
|
UserInterface_DisplayFrameRate,
|
||||||
UserInterface_InFullScreen,
|
|
||||||
UserInterface_FrameDisplayType,
|
UserInterface_FrameDisplayType,
|
||||||
UserInterface_MainWindowTop,
|
|
||||||
UserInterface_MainWindowLeft,
|
|
||||||
UserInterface_AlwaysOnTop,
|
|
||||||
|
|
||||||
RomBrowser_Enabled,
|
|
||||||
RomBrowser_ColoumnsChanged,
|
|
||||||
RomBrowser_Top,
|
|
||||||
RomBrowser_Left,
|
|
||||||
RomBrowser_Width,
|
|
||||||
RomBrowser_Height,
|
|
||||||
RomBrowser_PosIndex,
|
|
||||||
RomBrowser_WidthIndex,
|
|
||||||
RomBrowser_SortFieldIndex,
|
|
||||||
RomBrowser_SortAscendingIndex,
|
|
||||||
RomBrowser_Recursive,
|
|
||||||
RomBrowser_Maximized,
|
|
||||||
|
|
||||||
//Directory Info
|
//Directory Info
|
||||||
Directory_LastSave,
|
|
||||||
Directory_RecentGameDirCount,
|
|
||||||
Directory_RecentGameDirIndex,
|
|
||||||
Directory_Game,
|
|
||||||
Directory_GameInitial,
|
|
||||||
Directory_GameSelected,
|
|
||||||
Directory_GameUseSelected,
|
|
||||||
Directory_Plugin,
|
Directory_Plugin,
|
||||||
Directory_PluginInitial,
|
Directory_PluginInitial,
|
||||||
Directory_PluginSelected,
|
Directory_PluginSelected,
|
||||||
|
@ -227,9 +187,18 @@ enum SettingID
|
||||||
Directory_LogSelected,
|
Directory_LogSelected,
|
||||||
Directory_LogUseSelected,
|
Directory_LogUseSelected,
|
||||||
|
|
||||||
|
//Rom List
|
||||||
|
RomList_RomListCache,
|
||||||
|
RomList_RomListCacheDefault,
|
||||||
|
RomList_GameDir,
|
||||||
|
RomList_GameDirInitial,
|
||||||
|
RomList_GameDirSelected,
|
||||||
|
RomList_GameDirUseSelected,
|
||||||
|
RomList_GameDirRecursive,
|
||||||
|
RomList_7zipCache,
|
||||||
|
RomList_7zipCacheDefault,
|
||||||
|
|
||||||
//File Info
|
//File Info
|
||||||
File_RecentGameFileCount,
|
|
||||||
File_RecentGameFileIndex,
|
|
||||||
File_DiskIPLPath,
|
File_DiskIPLPath,
|
||||||
|
|
||||||
//Debugger
|
//Debugger
|
||||||
|
@ -265,6 +234,7 @@ enum SettingID
|
||||||
Debugger_TraceTLB,
|
Debugger_TraceTLB,
|
||||||
Debugger_TraceProtectedMEM,
|
Debugger_TraceProtectedMEM,
|
||||||
Debugger_TraceUserInterface,
|
Debugger_TraceUserInterface,
|
||||||
|
Debugger_TraceRomList,
|
||||||
|
|
||||||
//Plugins
|
//Plugins
|
||||||
Plugin_RSP_Current,
|
Plugin_RSP_Current,
|
||||||
|
@ -313,6 +283,7 @@ enum SettingID
|
||||||
Cheat_Range,
|
Cheat_Range,
|
||||||
Cheat_RangeNotes,
|
Cheat_RangeNotes,
|
||||||
|
|
||||||
|
FirstUISettings, LastUISettings = FirstUISettings + MaxPluginSetting,
|
||||||
FirstRSPDefaultSet, LastRSPDefaultSet = FirstRSPDefaultSet + MaxPluginSetting,
|
FirstRSPDefaultSet, LastRSPDefaultSet = FirstRSPDefaultSet + MaxPluginSetting,
|
||||||
FirstRSPSettings, LastRSPSettings = FirstRSPSettings + MaxPluginSetting,
|
FirstRSPSettings, LastRSPSettings = FirstRSPSettings + MaxPluginSetting,
|
||||||
FirstGfxDefaultSet, LastGfxDefaultSet = FirstGfxDefaultSet + MaxPluginSetting,
|
FirstGfxDefaultSet, LastGfxDefaultSet = FirstGfxDefaultSet + MaxPluginSetting,
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
CSettings * g_Settings = NULL;
|
CSettings * g_Settings = NULL;
|
||||||
|
|
||||||
CSettings::CSettings() :
|
CSettings::CSettings() :
|
||||||
m_NextAutoSettingId(0x200000)
|
m_NextAutoSettingId(0x200000)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,9 +84,6 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceAppInit, TraceDebug, "Start");
|
WriteTrace(TraceAppInit, TraceDebug, "Start");
|
||||||
|
|
||||||
//information - temp keys
|
|
||||||
AddHandler(Info_ShortCutsChanged, new CSettingTypeTempBool(false));
|
|
||||||
|
|
||||||
//Command Settings
|
//Command Settings
|
||||||
AddHandler(Cmd_BaseDirectory, new CSettingTypeTempString(BaseDirectory));
|
AddHandler(Cmd_BaseDirectory, new CSettingTypeTempString(BaseDirectory));
|
||||||
AddHandler(Cmd_ShowHelp, new CSettingTypeTempBool(false));
|
AddHandler(Cmd_ShowHelp, new CSettingTypeTempBool(false));
|
||||||
|
@ -105,12 +102,6 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
|
||||||
AddHandler(SupportFile_NotesDefault, new CSettingTypeRelativePath("Config", "Project64.rdn"));
|
AddHandler(SupportFile_NotesDefault, new CSettingTypeRelativePath("Config", "Project64.rdn"));
|
||||||
AddHandler(SupportFile_ExtInfo, new CSettingTypeApplicationPath("", "ExtInfo", SupportFile_ExtInfoDefault));
|
AddHandler(SupportFile_ExtInfo, new CSettingTypeApplicationPath("", "ExtInfo", SupportFile_ExtInfoDefault));
|
||||||
AddHandler(SupportFile_ExtInfoDefault, new CSettingTypeRelativePath("Config", "Project64.rdx"));
|
AddHandler(SupportFile_ExtInfoDefault, new CSettingTypeRelativePath("Config", "Project64.rdx"));
|
||||||
AddHandler(SupportFile_ShortCuts, new CSettingTypeApplicationPath("", "ShortCuts", SupportFile_ShortCutsDefault));
|
|
||||||
AddHandler(SupportFile_ShortCutsDefault, new CSettingTypeRelativePath("Config", "Project64.sc3"));
|
|
||||||
AddHandler(SupportFile_RomListCache, new CSettingTypeApplicationPath("", "RomListCache", SupportFile_RomListCacheDefault));
|
|
||||||
AddHandler(SupportFile_RomListCacheDefault, new CSettingTypeRelativePath("Config", "Project64.cache3"));
|
|
||||||
AddHandler(SupportFile_7zipCache, new CSettingTypeApplicationPath("", "7zipCache", SupportFile_7zipCacheDefault));
|
|
||||||
AddHandler(SupportFile_7zipCacheDefault, new CSettingTypeRelativePath("Config", "Project64.zcache"));
|
|
||||||
|
|
||||||
//AddHandler(SyncPluginDir, new CSettingTypeRelativePath("SyncPlugin",""));
|
//AddHandler(SyncPluginDir, new CSettingTypeRelativePath("SyncPlugin",""));
|
||||||
|
|
||||||
|
@ -119,11 +110,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
|
||||||
AddHandler(Setting_UseFromRegistry, new CSettingTypeApplication("Settings", "Use Registry", (uint32_t)false));
|
AddHandler(Setting_UseFromRegistry, new CSettingTypeApplication("Settings", "Use Registry", (uint32_t)false));
|
||||||
AddHandler(Setting_RdbEditor, new CSettingTypeApplication("", "Rdb Editor", false));
|
AddHandler(Setting_RdbEditor, new CSettingTypeApplication("", "Rdb Editor", false));
|
||||||
AddHandler(Setting_CN64TimeCritical, new CSettingTypeApplication("", "CN64TimeCritical", false));
|
AddHandler(Setting_CN64TimeCritical, new CSettingTypeApplication("", "CN64TimeCritical", false));
|
||||||
AddHandler(Setting_PluginPageFirst, new CSettingTypeApplication("", "Plugin Page First", false));
|
|
||||||
AddHandler(Setting_DisableScrSaver, new CSettingTypeApplication("", "Disable Screen Saver", (uint32_t)true));
|
|
||||||
AddHandler(Setting_AutoSleep, new CSettingTypeApplication("", "Auto Sleep", (uint32_t)true));
|
|
||||||
AddHandler(Setting_AutoStart, new CSettingTypeApplication("", "Auto Start", (uint32_t)true));
|
AddHandler(Setting_AutoStart, new CSettingTypeApplication("", "Auto Start", (uint32_t)true));
|
||||||
AddHandler(Setting_AutoFullscreen, new CSettingTypeApplication("", "Auto Full Screen", (uint32_t)false));
|
|
||||||
AddHandler(Setting_AutoZipInstantSave, new CSettingTypeApplication("", "Auto Zip Saves", (uint32_t)true));
|
AddHandler(Setting_AutoZipInstantSave, new CSettingTypeApplication("", "Auto Zip Saves", (uint32_t)true));
|
||||||
AddHandler(Setting_EraseGameDefaults, new CSettingTypeApplication("", "Erase on default", (uint32_t)true));
|
AddHandler(Setting_EraseGameDefaults, new CSettingTypeApplication("", "Erase on default", (uint32_t)true));
|
||||||
AddHandler(Setting_CheckEmuRunning, new CSettingTypeApplication("", "Check Running", (uint32_t)true));
|
AddHandler(Setting_CheckEmuRunning, new CSettingTypeApplication("", "Check Running", (uint32_t)true));
|
||||||
|
@ -152,9 +139,6 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
|
||||||
AddHandler(Rdb_DelaySi, new CSettingTypeRDBYesNo("Delay SI", false));
|
AddHandler(Rdb_DelaySi, new CSettingTypeRDBYesNo("Delay SI", false));
|
||||||
AddHandler(Rdb_32Bit, new CSettingTypeRDBYesNo("32bit", true));
|
AddHandler(Rdb_32Bit, new CSettingTypeRDBYesNo("32bit", true));
|
||||||
AddHandler(Rdb_FastSP, new CSettingTypeRDBYesNo("Fast SP", true));
|
AddHandler(Rdb_FastSP, new CSettingTypeRDBYesNo("Fast SP", true));
|
||||||
AddHandler(Rdb_Status, new CSettingTypeRomDatabase("Status", "Unknown"));
|
|
||||||
AddHandler(Rdb_NotesCore, new CSettingTypeRomDatabase("Core Note", ""));
|
|
||||||
AddHandler(Rdb_NotesPlugin, new CSettingTypeRomDatabase("Plugin Note", ""));
|
|
||||||
AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", true));
|
AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", true));
|
||||||
AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Sync Audio", false));
|
AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Sync Audio", false));
|
||||||
AddHandler(Rdb_RspAudioSignal, new CSettingTypeRDBYesNo("Audio Signal", false));
|
AddHandler(Rdb_RspAudioSignal, new CSettingTypeRDBYesNo("Audio Signal", false));
|
||||||
|
@ -232,39 +216,11 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
|
||||||
AddHandler(Game_Transferpak_Sav, new CSettingTypeGame("Tpak-Sav-dir", Default_None));
|
AddHandler(Game_Transferpak_Sav, new CSettingTypeGame("Tpak-Sav-dir", Default_None));
|
||||||
|
|
||||||
//User Interface
|
//User Interface
|
||||||
AddHandler(UserInterface_BasicMode, new CSettingTypeApplication("", "Basic Mode", (uint32_t)true));
|
|
||||||
AddHandler(UserInterface_ShowCPUPer, new CSettingTypeApplication("", "Display CPU Usage", (uint32_t)false));
|
AddHandler(UserInterface_ShowCPUPer, new CSettingTypeApplication("", "Display CPU Usage", (uint32_t)false));
|
||||||
AddHandler(UserInterface_DisplayFrameRate, new CSettingTypeApplication("", "Display Frame Rate", (uint32_t)true));
|
AddHandler(UserInterface_DisplayFrameRate, new CSettingTypeApplication("", "Display Frame Rate", (uint32_t)true));
|
||||||
AddHandler(UserInterface_InFullScreen, new CSettingTypeTempBool(false));
|
|
||||||
AddHandler(UserInterface_FrameDisplayType, new CSettingTypeApplication("", "Frame Rate Display Type", (uint32_t)FR_VIs));
|
AddHandler(UserInterface_FrameDisplayType, new CSettingTypeApplication("", "Frame Rate Display Type", (uint32_t)FR_VIs));
|
||||||
AddHandler(UserInterface_MainWindowTop, new CSettingTypeApplication("Main Window", "Top", Default_None));
|
|
||||||
AddHandler(UserInterface_MainWindowLeft, new CSettingTypeApplication("Main Window", "Left", Default_None));
|
|
||||||
AddHandler(UserInterface_AlwaysOnTop, new CSettingTypeApplication("", "Always on top", (uint32_t)false));
|
|
||||||
|
|
||||||
AddHandler(RomBrowser_Enabled, new CSettingTypeApplication("Rom Browser", "Rom Browser", true));
|
|
||||||
AddHandler(RomBrowser_ColoumnsChanged, new CSettingTypeTempBool(false));
|
|
||||||
AddHandler(RomBrowser_Top, new CSettingTypeApplication("Rom Browser", "Top", Default_None));
|
|
||||||
AddHandler(RomBrowser_Left, new CSettingTypeApplication("Rom Browser", "Left", Default_None));
|
|
||||||
AddHandler(RomBrowser_Width, new CSettingTypeApplication("Rom Browser", "Width", (uint32_t)640));
|
|
||||||
AddHandler(RomBrowser_Height, new CSettingTypeApplication("Rom Browser", "Height", (uint32_t)480));
|
|
||||||
AddHandler(RomBrowser_PosIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Pos", "Field", Default_None));
|
|
||||||
AddHandler(RomBrowser_WidthIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Width", "Field", Default_None));
|
|
||||||
AddHandler(RomBrowser_SortFieldIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Field", Default_None));
|
|
||||||
AddHandler(RomBrowser_SortAscendingIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Ascending", Default_None));
|
|
||||||
AddHandler(RomBrowser_Recursive, new CSettingTypeApplication("Rom Browser", "Recursive", false));
|
|
||||||
AddHandler(RomBrowser_Maximized, new CSettingTypeApplication("Rom Browser", "Maximized", false));
|
|
||||||
|
|
||||||
AddHandler(Directory_RecentGameDirCount, new CSettingTypeApplication("", "Remembered Rom Dirs", (uint32_t)10));
|
|
||||||
AddHandler(Directory_RecentGameDirIndex, new CSettingTypeApplicationIndex("Recent Dir", "Recent Dir", Default_None));
|
|
||||||
|
|
||||||
//Directory_Game,
|
|
||||||
AddHandler(Directory_Game, new CSettingTypeSelectedDirectory("Dir:Game", Directory_GameInitial, Directory_GameSelected, Directory_GameUseSelected, Directory_Game));
|
|
||||||
AddHandler(Directory_GameInitial, new CSettingTypeRelativePath("Game Directory", ""));
|
|
||||||
AddHandler(Directory_GameSelected, new CSettingTypeApplication("Directory", "Game", Directory_GameInitial));
|
|
||||||
AddHandler(Directory_GameUseSelected, new CSettingTypeApplication("Directory", "Game - Use Selected", false));
|
|
||||||
|
|
||||||
AddHandler(Directory_Plugin, new CSettingTypeSelectedDirectory("Dir:Plugin", Directory_PluginInitial, Directory_PluginSelected, Directory_PluginUseSelected, Directory_Plugin));
|
AddHandler(Directory_Plugin, new CSettingTypeSelectedDirectory("Dir:Plugin", Directory_PluginInitial, Directory_PluginSelected, Directory_PluginUseSelected, Directory_Plugin));
|
||||||
#ifdef _M_IX86
|
#ifndef _M_X64
|
||||||
AddHandler(Directory_PluginInitial, new CSettingTypeRelativePath("Plugin", ""));
|
AddHandler(Directory_PluginInitial, new CSettingTypeRelativePath("Plugin", ""));
|
||||||
AddHandler(Directory_PluginSelected, new CSettingTypeApplicationPath("Directory", "Plugin", Directory_PluginInitial));
|
AddHandler(Directory_PluginSelected, new CSettingTypeApplicationPath("Directory", "Plugin", Directory_PluginInitial));
|
||||||
AddHandler(Directory_PluginUseSelected, new CSettingTypeApplication("Directory", "Plugin - Use Selected", false));
|
AddHandler(Directory_PluginUseSelected, new CSettingTypeApplication("Directory", "Plugin - Use Selected", false));
|
||||||
|
@ -301,7 +257,15 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
|
||||||
AddHandler(Directory_LogSelected, new CSettingTypeApplicationPath("Directory", "Log Dir", Directory_InstantSaveInitial));
|
AddHandler(Directory_LogSelected, new CSettingTypeApplicationPath("Directory", "Log Dir", Directory_InstantSaveInitial));
|
||||||
AddHandler(Directory_LogUseSelected, new CSettingTypeApplication("Directory", "Log Dir - Use Selected", false));
|
AddHandler(Directory_LogUseSelected, new CSettingTypeApplication("Directory", "Log Dir - Use Selected", false));
|
||||||
|
|
||||||
AddHandler(Directory_LastSave, new CSettingTypeApplication("Directory", "Last Save Directory", Directory_InstantSave));
|
AddHandler(RomList_RomListCacheDefault, new CSettingTypeRelativePath("Config", "Project64.cache3"));
|
||||||
|
AddHandler(RomList_RomListCache, new CSettingTypeApplicationPath("", "RomListCache", RomList_RomListCacheDefault));
|
||||||
|
AddHandler(RomList_GameDir, new CSettingTypeSelectedDirectory("Dir:Game", RomList_GameDirInitial, RomList_GameDirSelected, RomList_GameDirUseSelected, RomList_GameDir));
|
||||||
|
AddHandler(RomList_GameDirInitial, new CSettingTypeRelativePath("Game Directory", ""));
|
||||||
|
AddHandler(RomList_GameDirSelected, new CSettingTypeApplication("Game Directory", "Directory", RomList_GameDirInitial));
|
||||||
|
AddHandler(RomList_GameDirUseSelected, new CSettingTypeApplication("Game Directory", "Use Selected", false));
|
||||||
|
AddHandler(RomList_GameDirRecursive, new CSettingTypeApplication("Game Directory", "Recursive", false));
|
||||||
|
AddHandler(RomList_7zipCache, new CSettingTypeApplicationPath("", "7zipCache", RomList_7zipCacheDefault));
|
||||||
|
AddHandler(RomList_7zipCacheDefault, new CSettingTypeRelativePath("Config", "Project64.zcache"));
|
||||||
|
|
||||||
AddHandler(GameRunning_LoadingInProgress, new CSettingTypeTempBool(false));
|
AddHandler(GameRunning_LoadingInProgress, new CSettingTypeTempBool(false));
|
||||||
AddHandler(GameRunning_CPU_Running, new CSettingTypeTempBool(false));
|
AddHandler(GameRunning_CPU_Running, new CSettingTypeTempBool(false));
|
||||||
|
@ -312,8 +276,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
|
||||||
AddHandler(GameRunning_ScreenHertz, new CSettingTypeTempNumber(60));
|
AddHandler(GameRunning_ScreenHertz, new CSettingTypeTempNumber(60));
|
||||||
AddHandler(GameRunning_InReset, new CSettingTypeTempBool(false));
|
AddHandler(GameRunning_InReset, new CSettingTypeTempBool(false));
|
||||||
|
|
||||||
AddHandler(File_RecentGameFileCount, new CSettingTypeApplication("", "Remembered Rom Files", (uint32_t)10));
|
AddHandler(UserInterface_BasicMode, new CSettingTypeApplication("", "Basic Mode", (uint32_t)true));
|
||||||
AddHandler(File_RecentGameFileIndex, new CSettingTypeApplicationIndex("Recent File", "Recent Rom", Default_None));
|
|
||||||
AddHandler(File_DiskIPLPath, new CSettingTypeApplicationPath("", "Disk IPL ROM Path", Default_None));
|
AddHandler(File_DiskIPLPath, new CSettingTypeApplicationPath("", "Disk IPL ROM Path", Default_None));
|
||||||
|
|
||||||
AddHandler(Debugger_Enabled, new CSettingTypeApplication("Debugger", "Debugger", false));
|
AddHandler(Debugger_Enabled, new CSettingTypeApplication("Debugger", "Debugger", false));
|
||||||
|
@ -347,6 +310,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
|
||||||
AddHandler(Debugger_TraceTLB, new CSettingTypeApplication("Logging", "TLB", (uint32_t)g_ModuleLogLevel[TraceTLB]));
|
AddHandler(Debugger_TraceTLB, new CSettingTypeApplication("Logging", "TLB", (uint32_t)g_ModuleLogLevel[TraceTLB]));
|
||||||
AddHandler(Debugger_TraceProtectedMEM, new CSettingTypeApplication("Logging", "Protected MEM", (uint32_t)g_ModuleLogLevel[TraceProtectedMem]));
|
AddHandler(Debugger_TraceProtectedMEM, new CSettingTypeApplication("Logging", "Protected MEM", (uint32_t)g_ModuleLogLevel[TraceProtectedMem]));
|
||||||
AddHandler(Debugger_TraceUserInterface, new CSettingTypeApplication("Logging", "User Interface", (uint32_t)g_ModuleLogLevel[TraceUserInterface]));
|
AddHandler(Debugger_TraceUserInterface, new CSettingTypeApplication("Logging", "User Interface", (uint32_t)g_ModuleLogLevel[TraceUserInterface]));
|
||||||
|
AddHandler(Debugger_TraceRomList, new CSettingTypeApplication("Logging", "Rom List", (uint32_t)g_ModuleLogLevel[TraceUserInterface]));
|
||||||
|
|
||||||
//Plugin
|
//Plugin
|
||||||
AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin", "RSP Dll", "RSP\\RSP 1.7.dll"));
|
AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin", "RSP Dll", "RSP\\RSP 1.7.dll"));
|
||||||
|
@ -469,8 +433,8 @@ void CSettings::SetSettingSz(CSettings * _this, SettingID ID, const char * Value
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID DefaultID, SettingDataType DataType,
|
void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID DefaultID, SettingDataType DataType,
|
||||||
SettingType Type, const char * Category, const char * DefaultStr,
|
SettingType Type, const char * Category, const char * DefaultStr,
|
||||||
uint32_t Value)
|
uint32_t Value)
|
||||||
{
|
{
|
||||||
switch (Type)
|
switch (Type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -103,9 +103,9 @@ public:
|
||||||
|
|
||||||
//Notification
|
//Notification
|
||||||
void NotifyCallBacks(SettingID Type);
|
void NotifyCallBacks(SettingID Type);
|
||||||
|
void AddHandler(SettingID TypeID, CSettingType * Handler);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AddHandler(SettingID TypeID, CSettingType * Handler);
|
|
||||||
void AddHowToHandleSetting(const char * BaseDirectory);
|
void AddHowToHandleSetting(const char * BaseDirectory);
|
||||||
void UnknownSetting(SettingID Type);
|
void UnknownSetting(SettingID Type);
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
<ClCompile Include="Plugins\PluginList.cpp" />
|
<ClCompile Include="Plugins\PluginList.cpp" />
|
||||||
<ClCompile Include="Settings\GuiSettings.cpp" />
|
<ClCompile Include="Settings\GuiSettings.cpp" />
|
||||||
<ClCompile Include="Settings\NotificationSettings.cpp" />
|
<ClCompile Include="Settings\NotificationSettings.cpp" />
|
||||||
|
<ClCompile Include="Settings\UISettings.cpp" />
|
||||||
<ClCompile Include="stdafx.cpp">
|
<ClCompile Include="stdafx.cpp">
|
||||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -91,6 +92,9 @@
|
||||||
<ClInclude Include="N64System\Debugger\Debugger-ViewMemory.h" />
|
<ClInclude Include="N64System\Debugger\Debugger-ViewMemory.h" />
|
||||||
<ClInclude Include="N64System\Debugger\debugger.h" />
|
<ClInclude Include="N64System\Debugger\debugger.h" />
|
||||||
<ClInclude Include="N64System\Debugger\DebuggerUI.h" />
|
<ClInclude Include="N64System\Debugger\DebuggerUI.h" />
|
||||||
|
<ClInclude Include="Settings\GuiSettings.h" />
|
||||||
|
<ClInclude Include="Settings\NotificationSettings.h" />
|
||||||
|
<ClInclude Include="Settings\UISettings.h" />
|
||||||
<ClInclude Include="stdafx.h" />
|
<ClInclude Include="stdafx.h" />
|
||||||
<ClInclude Include="Support.h" />
|
<ClInclude Include="Support.h" />
|
||||||
<ClInclude Include="UserInterface.h" />
|
<ClInclude Include="UserInterface.h" />
|
||||||
|
|
|
@ -52,6 +52,9 @@
|
||||||
<Filter Include="Header Files\N64 System Headers\Debugger Headers">
|
<Filter Include="Header Files\N64 System Headers\Debugger Headers">
|
||||||
<UniqueIdentifier>{c4249d55-df70-4453-b017-b548514ad094}</UniqueIdentifier>
|
<UniqueIdentifier>{c4249d55-df70-4453-b017-b548514ad094}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Header Files\Settings">
|
||||||
|
<UniqueIdentifier>{8eaf5c00-c88d-418e-a27c-d658c547ab79}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="stdafx.cpp">
|
<ClCompile Include="stdafx.cpp">
|
||||||
|
@ -156,6 +159,9 @@
|
||||||
<ClCompile Include="UserInterface\RomInformationClass.cpp">
|
<ClCompile Include="UserInterface\RomInformationClass.cpp">
|
||||||
<Filter>Source Files\User Interface Source</Filter>
|
<Filter>Source Files\User Interface Source</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="Settings\UISettings.cpp">
|
||||||
|
<Filter>Source Files\Settings Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="UserInterface\resource.h">
|
<ClInclude Include="UserInterface\resource.h">
|
||||||
|
@ -278,6 +284,15 @@
|
||||||
<ClInclude Include="UserInterface\RomInformationClass.h">
|
<ClInclude Include="UserInterface\RomInformationClass.h">
|
||||||
<Filter>Header Files\User Interface Headers</Filter>
|
<Filter>Header Files\User Interface Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="Settings\GuiSettings.h">
|
||||||
|
<Filter>Header Files\Settings</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Settings\NotificationSettings.h">
|
||||||
|
<Filter>Header Files\Settings</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Settings\UISettings.h">
|
||||||
|
<Filter>Header Files\Settings</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="res\divider.cur">
|
<None Include="res\divider.cur">
|
||||||
|
|
|
@ -16,28 +16,27 @@ bool CGuiSettings::m_bAutoSleep;
|
||||||
|
|
||||||
CGuiSettings::CGuiSettings()
|
CGuiSettings::CGuiSettings()
|
||||||
{
|
{
|
||||||
m_RefCount += 1;
|
m_RefCount += 1;
|
||||||
if (m_RefCount == 1)
|
if (m_RefCount == 1)
|
||||||
{
|
{
|
||||||
g_Settings->RegisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
|
g_Settings->RegisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
|
||||||
g_Settings->RegisterChangeCB(Setting_AutoSleep,NULL,RefreshSettings);
|
g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + Setting_AutoSleep),NULL,RefreshSettings);
|
||||||
RefreshSettings(NULL);
|
RefreshSettings(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CGuiSettings::~CGuiSettings()
|
CGuiSettings::~CGuiSettings()
|
||||||
{
|
{
|
||||||
m_RefCount -= 1;
|
m_RefCount -= 1;
|
||||||
if (m_RefCount == 0)
|
if (m_RefCount == 0)
|
||||||
{
|
{
|
||||||
g_Settings->UnregisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
|
g_Settings->UnregisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
|
||||||
g_Settings->UnregisterChangeCB(Setting_AutoSleep,NULL,RefreshSettings);
|
g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + Setting_AutoSleep),NULL,RefreshSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGuiSettings::RefreshSettings(void *)
|
void CGuiSettings::RefreshSettings(void *)
|
||||||
{
|
{
|
||||||
m_bCPURunning = g_Settings->LoadBool(GameRunning_CPU_Running);
|
m_bCPURunning = g_Settings->LoadBool(GameRunning_CPU_Running);
|
||||||
m_bAutoSleep = g_Settings->LoadBool(Setting_AutoSleep);
|
m_bAutoSleep = UISettingsLoadBool(Setting_AutoSleep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,17 +20,17 @@ CNotificationSettings::~CNotificationSettings()
|
||||||
{
|
{
|
||||||
if (g_Settings)
|
if (g_Settings)
|
||||||
{
|
{
|
||||||
g_Settings->UnregisterChangeCB(UserInterface_InFullScreen, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
|
g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + UserInterface_InFullScreen), this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNotificationSettings::RegisterNotifications()
|
void CNotificationSettings::RegisterNotifications()
|
||||||
{
|
{
|
||||||
g_Settings->RegisterChangeCB(UserInterface_InFullScreen, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
|
g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + UserInterface_InFullScreen), this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
|
||||||
RefreshSettings();
|
RefreshSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNotificationSettings::RefreshSettings()
|
void CNotificationSettings::RefreshSettings()
|
||||||
{
|
{
|
||||||
m_bInFullScreen = g_Settings->LoadBool(UserInterface_InFullScreen);
|
m_bInFullScreen = UISettingsLoadBool(UserInterface_InFullScreen);
|
||||||
}
|
}
|
|
@ -47,9 +47,9 @@ CMainGui::CMainGui(bool bMainWindow, const char * WindowTitle) :
|
||||||
|
|
||||||
if (m_bMainWindow)
|
if (m_bMainWindow)
|
||||||
{
|
{
|
||||||
g_Settings->RegisterChangeCB(RomBrowser_Enabled, this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged);
|
g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + RomBrowser_Enabled), this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged);
|
||||||
g_Settings->RegisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
|
g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + RomBrowser_ColoumnsChanged), this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
|
||||||
g_Settings->RegisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
|
g_Settings->RegisterChangeCB(RomList_GameDirRecursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
|
||||||
g_Settings->RegisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged);
|
g_Settings->RegisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged);
|
||||||
g_Settings->RegisterChangeCB(GameRunning_CPU_Running, this, (CSettings::SettingChangedFunc)GameCpuRunning);
|
g_Settings->RegisterChangeCB(GameRunning_CPU_Running, this, (CSettings::SettingChangedFunc)GameCpuRunning);
|
||||||
g_Settings->RegisterChangeCB(GameRunning_CPU_Paused, this, (CSettings::SettingChangedFunc)GamePaused);
|
g_Settings->RegisterChangeCB(GameRunning_CPU_Paused, this, (CSettings::SettingChangedFunc)GamePaused);
|
||||||
|
@ -66,9 +66,9 @@ CMainGui::~CMainGui(void)
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "Start");
|
WriteTrace(TraceUserInterface, TraceDebug, "Start");
|
||||||
if (m_bMainWindow)
|
if (m_bMainWindow)
|
||||||
{
|
{
|
||||||
g_Settings->UnregisterChangeCB(RomBrowser_Enabled, this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged);
|
g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + RomBrowser_Enabled), this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged);
|
||||||
g_Settings->UnregisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
|
g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + RomBrowser_ColoumnsChanged), this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
|
||||||
g_Settings->UnregisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
|
g_Settings->UnregisterChangeCB(RomList_GameDirRecursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
|
||||||
g_Settings->UnregisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged);
|
g_Settings->UnregisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged);
|
||||||
g_Settings->UnregisterChangeCB(GameRunning_CPU_Running, this, (CSettings::SettingChangedFunc)GameCpuRunning);
|
g_Settings->UnregisterChangeCB(GameRunning_CPU_Running, this, (CSettings::SettingChangedFunc)GameCpuRunning);
|
||||||
g_Settings->UnregisterChangeCB(GameRunning_CPU_Paused, this, (CSettings::SettingChangedFunc)GamePaused);
|
g_Settings->UnregisterChangeCB(GameRunning_CPU_Paused, this, (CSettings::SettingChangedFunc)GamePaused);
|
||||||
|
@ -107,12 +107,12 @@ void CMainGui::AddRecentRom(const char * ImagePath)
|
||||||
if (HIWORD(ImagePath) == NULL) { return; }
|
if (HIWORD(ImagePath) == NULL) { return; }
|
||||||
|
|
||||||
//Get Information about the stored rom list
|
//Get Information about the stored rom list
|
||||||
size_t MaxRememberedFiles = g_Settings->LoadDword(File_RecentGameFileCount);
|
size_t MaxRememberedFiles = UISettingsLoadDword(File_RecentGameFileCount);
|
||||||
strlist RecentGames;
|
strlist RecentGames;
|
||||||
size_t i;
|
size_t i;
|
||||||
for (i = 0; i < MaxRememberedFiles; i++)
|
for (i = 0; i < MaxRememberedFiles; i++)
|
||||||
{
|
{
|
||||||
stdstr RecentGame = g_Settings->LoadStringIndex(File_RecentGameFileIndex, i);
|
stdstr RecentGame = UISettingsLoadStringIndex(File_RecentGameFileIndex, i);
|
||||||
if (RecentGame.empty())
|
if (RecentGame.empty())
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -139,7 +139,7 @@ void CMainGui::AddRecentRom(const char * ImagePath)
|
||||||
|
|
||||||
for (i = 0, iter = RecentGames.begin(); iter != RecentGames.end(); iter++, i++)
|
for (i = 0, iter = RecentGames.begin(); iter != RecentGames.end(); iter++, i++)
|
||||||
{
|
{
|
||||||
g_Settings->SaveStringIndex(File_RecentGameFileIndex, i, *iter);
|
UISettingsSaveStringIndex(File_RecentGameFileIndex, i, *iter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,14 +148,14 @@ void CMainGui::SetWindowCaption(const wchar_t * title)
|
||||||
static const size_t TITLE_SIZE = 256;
|
static const size_t TITLE_SIZE = 256;
|
||||||
wchar_t WinTitle[TITLE_SIZE];
|
wchar_t WinTitle[TITLE_SIZE];
|
||||||
|
|
||||||
_snwprintf(WinTitle, TITLE_SIZE, L"%s - %s", title, g_Settings->LoadStringVal(Setting_ApplicationName).ToUTF16().c_str());
|
_snwprintf(WinTitle, TITLE_SIZE, L"%s - %s", title, stdstr(g_Settings->LoadStringVal(Setting_ApplicationName)).ToUTF16().c_str());
|
||||||
WinTitle[TITLE_SIZE - 1] = 0;
|
WinTitle[TITLE_SIZE - 1] = 0;
|
||||||
Caption(WinTitle);
|
Caption(WinTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMainGui::ShowRomBrowser(void)
|
void CMainGui::ShowRomBrowser(void)
|
||||||
{
|
{
|
||||||
if (g_Settings->LoadDword(RomBrowser_Enabled))
|
if (UISettingsLoadBool(RomBrowser_Enabled))
|
||||||
{
|
{
|
||||||
ShowRomList();
|
ShowRomList();
|
||||||
HighLightLastRom();
|
HighLightLastRom();
|
||||||
|
@ -164,7 +164,7 @@ void CMainGui::ShowRomBrowser(void)
|
||||||
|
|
||||||
void RomBowserEnabledChanged(CMainGui * Gui)
|
void RomBowserEnabledChanged(CMainGui * Gui)
|
||||||
{
|
{
|
||||||
if (Gui && g_Settings->LoadBool(RomBrowser_Enabled))
|
if (Gui && UISettingsLoadBool(RomBrowser_Enabled))
|
||||||
{
|
{
|
||||||
if (!Gui->RomBrowserVisible())
|
if (!Gui->RomBrowserVisible())
|
||||||
{
|
{
|
||||||
|
@ -186,7 +186,7 @@ void CMainGui::LoadingInProgressChanged(CMainGui * Gui)
|
||||||
if (!g_Settings->LoadBool(GameRunning_LoadingInProgress) && g_Settings->LoadStringVal(Game_File).length() == 0)
|
if (!g_Settings->LoadBool(GameRunning_LoadingInProgress) && g_Settings->LoadStringVal(Game_File).length() == 0)
|
||||||
{
|
{
|
||||||
Notify().WindowMode();
|
Notify().WindowMode();
|
||||||
if (g_Settings->LoadDword(RomBrowser_Enabled))
|
if (UISettingsLoadBool(RomBrowser_Enabled))
|
||||||
{
|
{
|
||||||
Gui->ShowRomBrowser();
|
Gui->ShowRomBrowser();
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ void CMainGui::GameLoaded(CMainGui * Gui)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "Add Recent Rom");
|
WriteTrace(TraceUserInterface, TraceDebug, "Add Recent Rom");
|
||||||
Gui->AddRecentRom(FileLoc.c_str());
|
Gui->AddRecentRom(FileLoc.c_str());
|
||||||
Gui->SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str());
|
Gui->SetWindowCaption(stdstr(g_Settings->LoadStringVal(Game_GoodName)).ToUTF16().c_str());
|
||||||
Gui->HideRomList();
|
Gui->HideRomList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,12 +215,12 @@ void CMainGui::GameCpuRunning(CMainGui * Gui)
|
||||||
{
|
{
|
||||||
if (g_Settings->LoadBool(GameRunning_CPU_Running))
|
if (g_Settings->LoadBool(GameRunning_CPU_Running))
|
||||||
{
|
{
|
||||||
Gui->MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop));
|
Gui->MakeWindowOnTop(UISettingsLoadBool(UserInterface_AlwaysOnTop));
|
||||||
if (g_Settings->LoadBool(Setting_AutoFullscreen))
|
if (UISettingsLoadBool(Setting_AutoFullscreen))
|
||||||
{
|
{
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "15");
|
WriteTrace(TraceUserInterface, TraceDebug, "15");
|
||||||
CIniFile RomIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
|
CIniFile RomIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
|
||||||
stdstr Status = g_Settings->LoadStringVal(Rdb_Status);
|
std::string Status = UISettingsLoadStringVal(Rdb_Status);
|
||||||
|
|
||||||
char String[100];
|
char String[100];
|
||||||
RomIniFile.GetString("Rom Status", stdstr_f("%s.AutoFullScreen", Status.c_str()).c_str(), "true", String, sizeof(String));
|
RomIniFile.GetString("Rom Status", stdstr_f("%s.AutoFullScreen", Status.c_str()).c_str(), "true", String, sizeof(String));
|
||||||
|
@ -633,16 +633,16 @@ void CMainGui::SaveWindowLoc(void)
|
||||||
if (m_SaveMainWindowPos)
|
if (m_SaveMainWindowPos)
|
||||||
{
|
{
|
||||||
m_SaveMainWindowPos = false;
|
m_SaveMainWindowPos = false;
|
||||||
g_Settings->SaveDword(UserInterface_MainWindowTop, m_SaveMainWindowTop);
|
UISettingsSaveDword(UserInterface_MainWindowTop, m_SaveMainWindowTop);
|
||||||
g_Settings->SaveDword(UserInterface_MainWindowLeft, m_SaveMainWindowLeft);
|
UISettingsSaveDword(UserInterface_MainWindowLeft, m_SaveMainWindowLeft);
|
||||||
flush = true;
|
flush = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_SaveRomBrowserPos)
|
if (m_SaveRomBrowserPos)
|
||||||
{
|
{
|
||||||
m_SaveRomBrowserPos = false;
|
m_SaveRomBrowserPos = false;
|
||||||
g_Settings->SaveDword(RomBrowser_Top, m_SaveRomBrowserTop);
|
UISettingsSaveDword(RomBrowser_Top, m_SaveRomBrowserTop);
|
||||||
g_Settings->SaveDword(RomBrowser_Left, m_SaveRomBrowserLeft);
|
UISettingsSaveDword(RomBrowser_Left, m_SaveRomBrowserLeft);
|
||||||
flush = true;
|
flush = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -670,8 +670,8 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
|
||||||
int X = (GetSystemMetrics(SM_CXSCREEN) - _this->Width()) / 2;
|
int X = (GetSystemMetrics(SM_CXSCREEN) - _this->Width()) / 2;
|
||||||
int Y = (GetSystemMetrics(SM_CYSCREEN) - _this->Height()) / 2;
|
int Y = (GetSystemMetrics(SM_CYSCREEN) - _this->Height()) / 2;
|
||||||
|
|
||||||
g_Settings->LoadDword(UserInterface_MainWindowTop, (uint32_t &)Y);
|
UISettingsLoadDword(UserInterface_MainWindowTop, (uint32_t &)Y);
|
||||||
g_Settings->LoadDword(UserInterface_MainWindowLeft, (uint32_t &)X);
|
UISettingsLoadDword(UserInterface_MainWindowLeft, (uint32_t &)X);
|
||||||
|
|
||||||
_this->SetPos(X, Y);
|
_this->SetPos(X, Y);
|
||||||
|
|
||||||
|
@ -687,7 +687,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
|
||||||
if (_this &&
|
if (_this &&
|
||||||
_this->bCPURunning() &&
|
_this->bCPURunning() &&
|
||||||
!g_Settings->LoadBool(GameRunning_CPU_Paused) &&
|
!g_Settings->LoadBool(GameRunning_CPU_Paused) &&
|
||||||
g_Settings->LoadDword(Setting_DisableScrSaver))
|
UISettingsLoadBool(Setting_DisableScrSaver))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -906,7 +906,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
|
||||||
}
|
}
|
||||||
if (_this->m_bMainWindow && bCPURunning())
|
if (_this->m_bMainWindow && bCPURunning())
|
||||||
{
|
{
|
||||||
if (!fActive && g_Settings->LoadBool(UserInterface_InFullScreen))
|
if (!fActive && UISettingsLoadBool(UserInterface_InFullScreen))
|
||||||
{
|
{
|
||||||
Notify().WindowMode();
|
Notify().WindowMode();
|
||||||
if (bAutoSleep() && g_BaseSystem)
|
if (bAutoSleep() && g_BaseSystem)
|
||||||
|
@ -962,7 +962,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
|
||||||
{
|
{
|
||||||
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
|
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
|
||||||
Notify().WindowMode();
|
Notify().WindowMode();
|
||||||
if (g_Settings->LoadDword(RomBrowser_Enabled))
|
if (UISettingsLoadBool(RomBrowser_Enabled))
|
||||||
{
|
{
|
||||||
_this->ShowRomBrowser();
|
_this->ShowRomBrowser();
|
||||||
}
|
}
|
||||||
|
@ -991,7 +991,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
|
||||||
memset(&FileName, 0, sizeof(FileName));
|
memset(&FileName, 0, sizeof(FileName));
|
||||||
memset(&openfilename, 0, sizeof(openfilename));
|
memset(&openfilename, 0, sizeof(openfilename));
|
||||||
|
|
||||||
strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str());
|
strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
|
||||||
|
|
||||||
openfilename.lStructSize = sizeof(openfilename);
|
openfilename.lStructSize = sizeof(openfilename);
|
||||||
openfilename.hwndOwner = (HWND)hWnd;
|
openfilename.hwndOwner = (HWND)hWnd;
|
||||||
|
@ -1022,7 +1022,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
|
||||||
memset(&FileName, 0, sizeof(FileName));
|
memset(&FileName, 0, sizeof(FileName));
|
||||||
memset(&openfilename, 0, sizeof(openfilename));
|
memset(&openfilename, 0, sizeof(openfilename));
|
||||||
|
|
||||||
strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str());
|
strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
|
||||||
|
|
||||||
openfilename.lStructSize = sizeof(openfilename);
|
openfilename.lStructSize = sizeof(openfilename);
|
||||||
openfilename.hwndOwner = (HWND)hWnd;
|
openfilename.hwndOwner = (HWND)hWnd;
|
||||||
|
@ -1163,7 +1163,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
|
||||||
memset(&FileName, 0, sizeof(FileName));
|
memset(&FileName, 0, sizeof(FileName));
|
||||||
memset(&openfilename, 0, sizeof(openfilename));
|
memset(&openfilename, 0, sizeof(openfilename));
|
||||||
|
|
||||||
strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str());
|
strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
|
||||||
openfilename.lStructSize = sizeof(openfilename);
|
openfilename.lStructSize = sizeof(openfilename);
|
||||||
openfilename.hwndOwner = (HWND)hWnd;
|
openfilename.hwndOwner = (HWND)hWnd;
|
||||||
openfilename.lpstrFilter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
openfilename.lpstrFilter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
||||||
|
@ -1210,7 +1210,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam)
|
DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD /*lParam*/)
|
||||||
{
|
{
|
||||||
static HBITMAP hbmpBackgroundTop = NULL;
|
static HBITMAP hbmpBackgroundTop = NULL;
|
||||||
static HFONT hPageHeadingFont = NULL;
|
static HFONT hPageHeadingFont = NULL;
|
||||||
|
|
|
@ -13,10 +13,10 @@ CMainMenu::CMainMenu(CMainGui * hMainWindow) :
|
||||||
|
|
||||||
hMainWindow->SetWindowMenu(this);
|
hMainWindow->SetWindowMenu(this);
|
||||||
|
|
||||||
m_ChangeSettingList.push_back(Info_ShortCutsChanged);
|
m_ChangeUISettingList.push_back(Info_ShortCutsChanged);
|
||||||
m_ChangeSettingList.push_back(GameRunning_LimitFPS);
|
m_ChangeSettingList.push_back(GameRunning_LimitFPS);
|
||||||
m_ChangeSettingList.push_back(UserInterface_InFullScreen);
|
m_ChangeUISettingList.push_back(UserInterface_InFullScreen);
|
||||||
m_ChangeSettingList.push_back(UserInterface_AlwaysOnTop);
|
m_ChangeUISettingList.push_back(UserInterface_AlwaysOnTop);
|
||||||
m_ChangeSettingList.push_back(UserInterface_ShowCPUPer);
|
m_ChangeSettingList.push_back(UserInterface_ShowCPUPer);
|
||||||
m_ChangeSettingList.push_back(Logging_GenerateLog);
|
m_ChangeSettingList.push_back(Logging_GenerateLog);
|
||||||
m_ChangeSettingList.push_back(Debugger_ProfileCode);
|
m_ChangeSettingList.push_back(Debugger_ProfileCode);
|
||||||
|
@ -50,6 +50,10 @@ CMainMenu::CMainMenu(CMainGui * hMainWindow) :
|
||||||
m_ChangeSettingList.push_back(Game_CurrentSaveState);
|
m_ChangeSettingList.push_back(Game_CurrentSaveState);
|
||||||
m_ChangeSettingList.push_back(Setting_CurrentLanguage);
|
m_ChangeSettingList.push_back(Setting_CurrentLanguage);
|
||||||
|
|
||||||
|
for (UISettingList::const_iterator iter = m_ChangeUISettingList.begin(); iter != m_ChangeUISettingList.end(); iter++)
|
||||||
|
{
|
||||||
|
g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + *iter), this, (CSettings::SettingChangedFunc)SettingsChanged);
|
||||||
|
}
|
||||||
for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++)
|
for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++)
|
||||||
{
|
{
|
||||||
g_Settings->RegisterChangeCB(*iter, this, (CSettings::SettingChangedFunc)SettingsChanged);
|
g_Settings->RegisterChangeCB(*iter, this, (CSettings::SettingChangedFunc)SettingsChanged);
|
||||||
|
@ -58,6 +62,10 @@ CMainMenu::CMainMenu(CMainGui * hMainWindow) :
|
||||||
|
|
||||||
CMainMenu::~CMainMenu()
|
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);
|
||||||
|
}
|
||||||
for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++)
|
for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++)
|
||||||
{
|
{
|
||||||
g_Settings->UnregisterChangeCB(*iter, this, (CSettings::SettingChangedFunc)SettingsChanged);
|
g_Settings->UnregisterChangeCB(*iter, this, (CSettings::SettingChangedFunc)SettingsChanged);
|
||||||
|
@ -88,7 +96,7 @@ stdstr CMainMenu::ChooseFileToOpen(HWND hParent)
|
||||||
memset(&FileName, 0, sizeof(FileName));
|
memset(&FileName, 0, sizeof(FileName));
|
||||||
memset(&openfilename, 0, sizeof(openfilename));
|
memset(&openfilename, 0, sizeof(openfilename));
|
||||||
|
|
||||||
strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str());
|
strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
|
||||||
|
|
||||||
openfilename.lStructSize = sizeof(openfilename);
|
openfilename.lStructSize = sizeof(openfilename);
|
||||||
openfilename.hwndOwner = (HWND)hParent;
|
openfilename.hwndOwner = (HWND)hParent;
|
||||||
|
@ -140,7 +148,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
|
||||||
memset(&FileName, 0, sizeof(FileName));
|
memset(&FileName, 0, sizeof(FileName));
|
||||||
memset(&openfilename, 0, sizeof(openfilename));
|
memset(&openfilename, 0, sizeof(openfilename));
|
||||||
|
|
||||||
strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str());
|
strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
|
||||||
openfilename.lStructSize = sizeof(openfilename);
|
openfilename.lStructSize = sizeof(openfilename);
|
||||||
openfilename.hwndOwner = (HWND)hWnd;
|
openfilename.hwndOwner = (HWND)hWnd;
|
||||||
openfilename.lpstrFilter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
openfilename.lpstrFilter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
||||||
|
@ -234,7 +242,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
|
||||||
memset(&SaveFile, 0, sizeof(SaveFile));
|
memset(&SaveFile, 0, sizeof(SaveFile));
|
||||||
memset(&openfilename, 0, sizeof(openfilename));
|
memset(&openfilename, 0, sizeof(openfilename));
|
||||||
|
|
||||||
g_Settings->LoadStringVal(Directory_LastSave, Directory, sizeof(Directory));
|
UISettingsLoadStringVal(Directory_LastSave, Directory, sizeof(Directory));
|
||||||
|
|
||||||
openfilename.lStructSize = sizeof(openfilename);
|
openfilename.lStructSize = sizeof(openfilename);
|
||||||
openfilename.hwndOwner = (HWND)hWnd;
|
openfilename.hwndOwner = (HWND)hWnd;
|
||||||
|
@ -261,7 +269,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
|
||||||
|
|
||||||
char SaveDir[MAX_PATH];
|
char SaveDir[MAX_PATH];
|
||||||
_makepath(SaveDir, drive, dir, NULL, NULL);
|
_makepath(SaveDir, drive, dir, NULL, NULL);
|
||||||
g_Settings->SaveString(Directory_LastSave, SaveDir);
|
UISettingsSaveString(Directory_LastSave, SaveDir);
|
||||||
g_BaseSystem->ExternalEvent(SysEvent_SaveMachineState);
|
g_BaseSystem->ExternalEvent(SysEvent_SaveMachineState);
|
||||||
}
|
}
|
||||||
g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_SaveGame);
|
g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_SaveGame);
|
||||||
|
@ -276,7 +284,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
|
||||||
memset(&SaveFile, 0, sizeof(SaveFile));
|
memset(&SaveFile, 0, sizeof(SaveFile));
|
||||||
memset(&openfilename, 0, sizeof(openfilename));
|
memset(&openfilename, 0, sizeof(openfilename));
|
||||||
|
|
||||||
g_Settings->LoadStringVal(Directory_LastSave, Directory, sizeof(Directory));
|
UISettingsLoadStringVal(Directory_LastSave, Directory, sizeof(Directory));
|
||||||
|
|
||||||
openfilename.lStructSize = sizeof(openfilename);
|
openfilename.lStructSize = sizeof(openfilename);
|
||||||
openfilename.hwndOwner = (HWND)hWnd;
|
openfilename.hwndOwner = (HWND)hWnd;
|
||||||
|
@ -293,7 +301,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
|
||||||
char SaveDir[MAX_PATH], drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
|
char SaveDir[MAX_PATH], drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
|
||||||
_splitpath(SaveFile, drive, dir, fname, ext);
|
_splitpath(SaveFile, drive, dir, fname, ext);
|
||||||
_makepath(SaveDir, drive, dir, NULL, NULL);
|
_makepath(SaveDir, drive, dir, NULL, NULL);
|
||||||
g_Settings->SaveString(Directory_LastSave, SaveDir);
|
UISettingsSaveString(Directory_LastSave, SaveDir);
|
||||||
g_System->LoadState();
|
g_System->LoadState();
|
||||||
}
|
}
|
||||||
g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_LoadGame);
|
g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_LoadGame);
|
||||||
|
@ -335,7 +343,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
|
||||||
g_BaseSystem->ExternalEvent(SysEvent_ChangingFullScreen);
|
g_BaseSystem->ExternalEvent(SysEvent_ChangingFullScreen);
|
||||||
break;
|
break;
|
||||||
case ID_OPTIONS_FULLSCREEN2:
|
case ID_OPTIONS_FULLSCREEN2:
|
||||||
if (g_Settings->LoadBool(UserInterface_InFullScreen))
|
if (UISettingsLoadBool(UserInterface_InFullScreen))
|
||||||
{
|
{
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN a");
|
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN a");
|
||||||
m_Gui->MakeWindowOnTop(false);
|
m_Gui->MakeWindowOnTop(false);
|
||||||
|
@ -345,8 +353,8 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
|
||||||
WriteTrace(TraceGFXPlugin, TraceDebug, "ChangeWindow: Done");
|
WriteTrace(TraceGFXPlugin, TraceDebug, "ChangeWindow: Done");
|
||||||
ShowCursor(true);
|
ShowCursor(true);
|
||||||
m_Gui->ShowStatusBar(true);
|
m_Gui->ShowStatusBar(true);
|
||||||
m_Gui->MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop));
|
m_Gui->MakeWindowOnTop(UISettingsLoadBool(UserInterface_AlwaysOnTop));
|
||||||
g_Settings->SaveBool(UserInterface_InFullScreen, (DWORD)false);
|
UISettingsSaveBool(UserInterface_InFullScreen, (DWORD)false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -373,20 +381,20 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN b 5");
|
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN b 5");
|
||||||
Notify().SetGfxPlugin(g_Plugins->Gfx());
|
Notify().SetGfxPlugin(g_Plugins->Gfx());
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN b 3");
|
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN b 3");
|
||||||
g_Settings->SaveBool(UserInterface_InFullScreen, true);
|
UISettingsSaveBool(UserInterface_InFullScreen, true);
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN b 6");
|
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN b 6");
|
||||||
}
|
}
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN 1");
|
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN 1");
|
||||||
break;
|
break;
|
||||||
case ID_OPTIONS_ALWAYSONTOP:
|
case ID_OPTIONS_ALWAYSONTOP:
|
||||||
if (g_Settings->LoadDword(UserInterface_AlwaysOnTop))
|
if (UISettingsLoadBool(UserInterface_AlwaysOnTop))
|
||||||
{
|
{
|
||||||
g_Settings->SaveBool(UserInterface_AlwaysOnTop, false);
|
UISettingsSaveBool(UserInterface_AlwaysOnTop, false);
|
||||||
m_Gui->MakeWindowOnTop(false);
|
m_Gui->MakeWindowOnTop(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_Settings->SaveBool(UserInterface_AlwaysOnTop, true);
|
UISettingsSaveBool(UserInterface_AlwaysOnTop, true);
|
||||||
m_Gui->MakeWindowOnTop(g_Settings->LoadBool(GameRunning_CPU_Running));
|
m_Gui->MakeWindowOnTop(g_Settings->LoadBool(GameRunning_CPU_Running));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -517,7 +525,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
|
||||||
if (MenuID >= ID_RECENT_ROM_START && MenuID < ID_RECENT_ROM_END)
|
if (MenuID >= ID_RECENT_ROM_START && MenuID < ID_RECENT_ROM_END)
|
||||||
{
|
{
|
||||||
stdstr FileName;
|
stdstr FileName;
|
||||||
if (g_Settings->LoadStringIndex(File_RecentGameFileIndex, MenuID - ID_RECENT_ROM_START, FileName) &&
|
if (UISettingsLoadStringIndex(File_RecentGameFileIndex, MenuID - ID_RECENT_ROM_START, FileName) &&
|
||||||
FileName.length() > 0)
|
FileName.length() > 0)
|
||||||
{
|
{
|
||||||
g_BaseSystem->RunFileImage(FileName.c_str());
|
g_BaseSystem->RunFileImage(FileName.c_str());
|
||||||
|
@ -526,10 +534,10 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
|
||||||
if (MenuID >= ID_RECENT_DIR_START && MenuID < ID_RECENT_DIR_END)
|
if (MenuID >= ID_RECENT_DIR_START && MenuID < ID_RECENT_DIR_END)
|
||||||
{
|
{
|
||||||
int Offset = MenuID - ID_RECENT_DIR_START;
|
int Offset = MenuID - ID_RECENT_DIR_START;
|
||||||
stdstr Dir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex, Offset);
|
stdstr Dir = UISettingsLoadStringIndex(Directory_RecentGameDirIndex, Offset);
|
||||||
if (Dir.length() > 0)
|
if (Dir.length() > 0)
|
||||||
{
|
{
|
||||||
g_Settings->SaveString(Directory_Game, Dir.c_str());
|
g_Settings->SaveString(RomList_GameDir, Dir.c_str());
|
||||||
Notify().AddRecentDir(Dir.c_str());
|
Notify().AddRecentDir(Dir.c_str());
|
||||||
m_Gui->RefreshMenu();
|
m_Gui->RefreshMenu();
|
||||||
if (m_Gui->RomBrowserVisible())
|
if (m_Gui->RomBrowserVisible())
|
||||||
|
@ -668,12 +676,12 @@ void CMainMenu::FillOutMenu(HMENU hMenu)
|
||||||
bool CPURunning = g_Settings->LoadBool(GameRunning_CPU_Running);
|
bool CPURunning = g_Settings->LoadBool(GameRunning_CPU_Running);
|
||||||
bool RomLoading = g_Settings->LoadBool(GameRunning_LoadingInProgress);
|
bool RomLoading = g_Settings->LoadBool(GameRunning_LoadingInProgress);
|
||||||
bool RomLoaded = g_Settings->LoadStringVal(Game_GameName).length() > 0;
|
bool RomLoaded = g_Settings->LoadStringVal(Game_GameName).length() > 0;
|
||||||
bool RomList = g_Settings->LoadBool(RomBrowser_Enabled) && !CPURunning;
|
bool RomList = UISettingsLoadBool(RomBrowser_Enabled) && !CPURunning;
|
||||||
|
|
||||||
CMenuShortCutKey::ACCESS_MODE AccessLevel = CMenuShortCutKey::GAME_NOT_RUNNING;
|
CMenuShortCutKey::ACCESS_MODE AccessLevel = CMenuShortCutKey::GAME_NOT_RUNNING;
|
||||||
if (g_Settings->LoadBool(GameRunning_CPU_Running))
|
if (g_Settings->LoadBool(GameRunning_CPU_Running))
|
||||||
{
|
{
|
||||||
AccessLevel = g_Settings->LoadBool(UserInterface_InFullScreen) ? CMenuShortCutKey::GAME_RUNNING_FULLSCREEN : CMenuShortCutKey::GAME_RUNNING_WINDOW;
|
AccessLevel = UISettingsLoadBool(UserInterface_InFullScreen) ? CMenuShortCutKey::GAME_RUNNING_FULLSCREEN : CMenuShortCutKey::GAME_RUNNING_WINDOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get the system information to make the menu
|
//Get the system information to make the menu
|
||||||
|
@ -693,11 +701,11 @@ void CMainMenu::FillOutMenu(HMENU hMenu)
|
||||||
|
|
||||||
//Go through the settings to create a list of Recent Roms
|
//Go through the settings to create a list of Recent Roms
|
||||||
MenuItemList RecentRomMenu;
|
MenuItemList RecentRomMenu;
|
||||||
DWORD count, RomsToRemember = g_Settings->LoadDword(File_RecentGameFileCount);
|
DWORD count, RomsToRemember = UISettingsLoadDword(File_RecentGameFileCount);
|
||||||
|
|
||||||
for (count = 0; count < RomsToRemember; count++)
|
for (count = 0; count < RomsToRemember; count++)
|
||||||
{
|
{
|
||||||
stdstr LastRom = g_Settings->LoadStringIndex(File_RecentGameFileIndex, count);
|
stdstr LastRom = UISettingsLoadStringIndex(File_RecentGameFileIndex, count);
|
||||||
if (LastRom.empty())
|
if (LastRom.empty())
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -710,11 +718,11 @@ void CMainMenu::FillOutMenu(HMENU hMenu)
|
||||||
/* Recent Dir
|
/* Recent Dir
|
||||||
****************/
|
****************/
|
||||||
MenuItemList RecentDirMenu;
|
MenuItemList RecentDirMenu;
|
||||||
DWORD DirsToRemember = g_Settings->LoadDword(Directory_RecentGameDirCount);
|
DWORD DirsToRemember = UISettingsLoadDword(Directory_RecentGameDirCount);
|
||||||
|
|
||||||
for (count = 0; count < DirsToRemember; count++)
|
for (count = 0; count < DirsToRemember; count++)
|
||||||
{
|
{
|
||||||
stdstr LastDir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex, count);
|
stdstr LastDir = UISettingsLoadStringIndex(Directory_RecentGameDirIndex, count);
|
||||||
if (LastDir.empty())
|
if (LastDir.empty())
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -886,7 +894,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu)
|
||||||
if (!inBasicMode)
|
if (!inBasicMode)
|
||||||
{
|
{
|
||||||
Item.Reset(ID_OPTIONS_ALWAYSONTOP, MENU_ON_TOP, m_ShortCuts.ShortCutString(ID_OPTIONS_ALWAYSONTOP, AccessLevel));
|
Item.Reset(ID_OPTIONS_ALWAYSONTOP, MENU_ON_TOP, m_ShortCuts.ShortCutString(ID_OPTIONS_ALWAYSONTOP, AccessLevel));
|
||||||
if (g_Settings->LoadDword(UserInterface_AlwaysOnTop)) { Item.SetItemTicked(true); }
|
if (UISettingsLoadDword(UserInterface_AlwaysOnTop)) { Item.SetItemTicked(true); }
|
||||||
Item.SetItemEnabled(CPURunning);
|
Item.SetItemEnabled(CPURunning);
|
||||||
OptionMenu.push_back(Item);
|
OptionMenu.push_back(Item);
|
||||||
}
|
}
|
||||||
|
@ -1241,7 +1249,7 @@ void CMainMenu::RebuildAccelerators(void)
|
||||||
void CMainMenu::ResetMenu(void)
|
void CMainMenu::ResetMenu(void)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "Start");
|
WriteTrace(TraceUserInterface, TraceDebug, "Start");
|
||||||
if (!g_Settings->LoadBool(UserInterface_InFullScreen))
|
if (!UISettingsLoadBool(UserInterface_InFullScreen))
|
||||||
{
|
{
|
||||||
//Create a new window with all the items
|
//Create a new window with all the items
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "Create Menu");
|
WriteTrace(TraceUserInterface, TraceDebug, "Create Menu");
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include <Project64/Settings/UISettings.h>
|
||||||
|
|
||||||
enum MainMenuID
|
enum MainMenuID
|
||||||
{
|
{
|
||||||
|
@ -82,12 +83,14 @@ private:
|
||||||
static void SettingsChanged(CMainMenu * _this);
|
static void SettingsChanged(CMainMenu * _this);
|
||||||
|
|
||||||
typedef std::list<SettingID> SettingList;
|
typedef std::list<SettingID> SettingList;
|
||||||
|
typedef std::list<UISettingID> UISettingList;
|
||||||
|
|
||||||
CMainGui * m_Gui;
|
CMainGui * m_Gui;
|
||||||
|
|
||||||
void * m_AccelTable;
|
void * m_AccelTable;
|
||||||
bool m_ResetAccelerators;
|
bool m_ResetAccelerators;
|
||||||
CShortCuts m_ShortCuts;
|
CShortCuts m_ShortCuts;
|
||||||
SettingList m_ChangeSettingList;
|
SettingList m_ChangeSettingList;
|
||||||
|
UISettingList m_ChangeUISettingList;
|
||||||
CriticalSection m_CS;
|
CriticalSection m_CS;
|
||||||
};
|
};
|
||||||
|
|
|
@ -350,7 +350,7 @@ void CShortCuts::Load(bool InitialValues)
|
||||||
AddShortCut(ID_OPTIONS_CPU_USAGE, STR_SHORTCUT_OPTIONS, MENU_SHOW_CPU, CMenuShortCutKey::GAME_RUNNING);
|
AddShortCut(ID_OPTIONS_CPU_USAGE, STR_SHORTCUT_OPTIONS, MENU_SHOW_CPU, CMenuShortCutKey::GAME_RUNNING);
|
||||||
AddShortCut(ID_OPTIONS_SETTINGS, STR_SHORTCUT_OPTIONS, MENU_SETTINGS, CMenuShortCutKey::NOT_IN_FULLSCREEN);
|
AddShortCut(ID_OPTIONS_SETTINGS, STR_SHORTCUT_OPTIONS, MENU_SETTINGS, CMenuShortCutKey::NOT_IN_FULLSCREEN);
|
||||||
|
|
||||||
CPath ShortCutFile = g_Settings->LoadStringVal(SupportFile_ShortCuts);
|
CPath ShortCutFile = UISettingsLoadStringVal(SupportFile_ShortCuts);
|
||||||
if (!ShortCutFile.Exists() || InitialValues)
|
if (!ShortCutFile.Exists() || InitialValues)
|
||||||
{
|
{
|
||||||
m_ShortCuts.find(ID_FILE_OPEN_ROM)->second.AddShortCut('O', TRUE, false, false, CMenuShortCutKey::GAME_RUNNING);
|
m_ShortCuts.find(ID_FILE_OPEN_ROM)->second.AddShortCut('O', TRUE, false, false, CMenuShortCutKey::GAME_RUNNING);
|
||||||
|
@ -422,7 +422,7 @@ void CShortCuts::Save(void)
|
||||||
{
|
{
|
||||||
CGuard CS(m_CS);
|
CGuard CS(m_CS);
|
||||||
|
|
||||||
stdstr FileName = g_Settings->LoadStringVal(SupportFile_ShortCuts);
|
stdstr FileName = UISettingsLoadStringVal(SupportFile_ShortCuts);
|
||||||
FILE *file = fopen(FileName.c_str(), "w");
|
FILE *file = fopen(FileName.c_str(), "w");
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
{
|
{
|
||||||
|
@ -455,9 +455,7 @@ HACCEL CShortCuts::GetAcceleratorTable(void)
|
||||||
CMenuShortCutKey::ACCESS_MODE AccessLevel = CMenuShortCutKey::GAME_NOT_RUNNING;
|
CMenuShortCutKey::ACCESS_MODE AccessLevel = CMenuShortCutKey::GAME_NOT_RUNNING;
|
||||||
if (g_Settings->LoadBool(GameRunning_CPU_Running))
|
if (g_Settings->LoadBool(GameRunning_CPU_Running))
|
||||||
{
|
{
|
||||||
AccessLevel = g_Settings->LoadBool(UserInterface_InFullScreen) ?
|
AccessLevel = UISettingsLoadBool(UserInterface_InFullScreen) ? CMenuShortCutKey::GAME_RUNNING_FULLSCREEN : CMenuShortCutKey::GAME_RUNNING_WINDOW;
|
||||||
CMenuShortCutKey::GAME_RUNNING_FULLSCREEN :
|
|
||||||
CMenuShortCutKey::GAME_RUNNING_WINDOW;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int size = 0, MaxSize = m_ShortCuts.size() * 5;
|
int size = 0, MaxSize = m_ShortCuts.size() * 5;
|
||||||
|
|
|
@ -17,6 +17,7 @@ CNotificationImp::CNotificationImp() :
|
||||||
|
|
||||||
void CNotificationImp::AppInitDone(void)
|
void CNotificationImp::AppInitDone(void)
|
||||||
{
|
{
|
||||||
|
RegisterUISettings();
|
||||||
CNotificationSettings::RegisterNotifications();
|
CNotificationSettings::RegisterNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,12 +160,12 @@ void CNotificationImp::AddRecentDir(const char * RomDir)
|
||||||
if (HIWORD(RomDir) == NULL) { return; }
|
if (HIWORD(RomDir) == NULL) { return; }
|
||||||
|
|
||||||
//Get Information about the stored rom list
|
//Get Information about the stored rom list
|
||||||
size_t MaxRememberedDirs = g_Settings->LoadDword(Directory_RecentGameDirCount);
|
size_t MaxRememberedDirs = UISettingsLoadDword(Directory_RecentGameDirCount);
|
||||||
strlist RecentDirs;
|
strlist RecentDirs;
|
||||||
size_t i;
|
size_t i;
|
||||||
for (i = 0; i < MaxRememberedDirs; i++)
|
for (i = 0; i < MaxRememberedDirs; i++)
|
||||||
{
|
{
|
||||||
stdstr RecentDir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex, i);
|
stdstr RecentDir = UISettingsLoadStringIndex(Directory_RecentGameDirIndex, i);
|
||||||
if (RecentDir.empty())
|
if (RecentDir.empty())
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -191,7 +192,7 @@ void CNotificationImp::AddRecentDir(const char * RomDir)
|
||||||
|
|
||||||
for (i = 0, iter = RecentDirs.begin(); iter != RecentDirs.end(); iter++, i++)
|
for (i = 0, iter = RecentDirs.begin(); iter != RecentDirs.end(); iter++, i++)
|
||||||
{
|
{
|
||||||
g_Settings->SaveStringIndex(Directory_RecentGameDirIndex, i, *iter);
|
UISettingsSaveStringIndex(Directory_RecentGameDirIndex, i, *iter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,7 +212,7 @@ void CNotificationImp::HideRomBrowser(void)
|
||||||
void CNotificationImp::ShowRomBrowser(void)
|
void CNotificationImp::ShowRomBrowser(void)
|
||||||
{
|
{
|
||||||
if (m_hWnd == NULL) { return; }
|
if (m_hWnd == NULL) { return; }
|
||||||
if (g_Settings->LoadDword(RomBrowser_Enabled))
|
if (UISettingsLoadBool(RomBrowser_Enabled))
|
||||||
{
|
{
|
||||||
//Display the rom browser
|
//Display the rom browser
|
||||||
m_hWnd->ShowRomList();
|
m_hWnd->ShowRomList();
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <Project64/Settings/UISettings.h>
|
||||||
|
|
||||||
class CMainGui;
|
class CMainGui;
|
||||||
class CPlugins;
|
class CPlugins;
|
||||||
|
@ -37,8 +38,8 @@ public:
|
||||||
{
|
{
|
||||||
if (!UseDefault)
|
if (!UseDefault)
|
||||||
{
|
{
|
||||||
m_PosChanged = g_Settings->LoadDwordIndex(RomBrowser_PosIndex, m_ID, (uint32_t &)m_Pos);
|
m_PosChanged = UISettingsLoadDwordIndex(RomBrowser_PosIndex, m_ID, (uint32_t &)m_Pos);
|
||||||
g_Settings->LoadDwordIndex(RomBrowser_WidthIndex, m_ID, m_ColWidth);
|
UISettingsLoadDwordIndex(RomBrowser_WidthIndex, m_ID, m_ColWidth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inline LPCSTR Name(void) const { return m_Name.c_str(); }
|
inline LPCSTR Name(void) const { return m_Name.c_str(); }
|
||||||
|
@ -51,18 +52,18 @@ public:
|
||||||
void SetColWidth(int ColWidth)
|
void SetColWidth(int ColWidth)
|
||||||
{
|
{
|
||||||
m_ColWidth = ColWidth;
|
m_ColWidth = ColWidth;
|
||||||
g_Settings->SaveDwordIndex(RomBrowser_WidthIndex, m_ID, m_ColWidth);
|
UISettingsSaveDwordIndex(RomBrowser_WidthIndex, m_ID, m_ColWidth);
|
||||||
}
|
}
|
||||||
void SetColPos(int Pos)
|
void SetColPos(int Pos)
|
||||||
{
|
{
|
||||||
m_Pos = Pos;
|
m_Pos = Pos;
|
||||||
g_Settings->SaveDwordIndex(RomBrowser_PosIndex, m_ID, m_Pos);
|
UISettingsSaveDwordIndex(RomBrowser_PosIndex, m_ID, m_Pos);
|
||||||
m_PosChanged = true;
|
m_PosChanged = true;
|
||||||
}
|
}
|
||||||
void ResetPos(void)
|
void ResetPos(void)
|
||||||
{
|
{
|
||||||
m_Pos = m_DefaultPos;
|
m_Pos = m_DefaultPos;
|
||||||
g_Settings->DeleteSettingIndex(RomBrowser_PosIndex, m_ID);
|
UISettingsDeleteSettingIndex(RomBrowser_PosIndex, m_ID);
|
||||||
m_PosChanged = false;
|
m_PosChanged = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -81,6 +82,28 @@ struct SORT_FIELD
|
||||||
class C7zip;
|
class C7zip;
|
||||||
class CRomBrowser
|
class CRomBrowser
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
CRomBrowser(HWND & hMainWindow, HWND & StatusWindow);
|
||||||
|
~CRomBrowser(void);
|
||||||
|
void HighLightLastRom(void);
|
||||||
|
void HideRomList(void);
|
||||||
|
void RefreshRomBrowser(void);
|
||||||
|
void ResetRomBrowserColomuns(void);
|
||||||
|
void ResizeRomList(WORD nWidth, WORD nHeight);
|
||||||
|
void RomBrowserToTop(void);
|
||||||
|
void RomBrowserMaximize(bool Mazimize);
|
||||||
|
bool RomBrowserVisible(void);
|
||||||
|
bool RomListDrawItem(int idCtrl, uint32_t lParam);
|
||||||
|
bool RomListNotify(int idCtrl, uint32_t pnmh);
|
||||||
|
void SaveRomListColoumnInfo(void);
|
||||||
|
void SelectRomDir(void);
|
||||||
|
void ShowRomList(void);
|
||||||
|
bool ShowingRomBrowser(void) { return m_ShowingRomBrowser; }
|
||||||
|
const char * CurrentedSelectedRom(void) { return m_SelectedRom.c_str(); }
|
||||||
|
|
||||||
|
static void GetFieldInfo(ROMBROWSER_FIELDS_LIST & Fields, bool UseDefault = false);
|
||||||
|
|
||||||
|
private:
|
||||||
enum { IDC_ROMLIST = 223 };
|
enum { IDC_ROMLIST = 223 };
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -136,24 +159,6 @@ class CRomBrowser
|
||||||
|
|
||||||
typedef std::vector<ROM_INFO> ROMINFO_LIST;
|
typedef std::vector<ROM_INFO> ROMINFO_LIST;
|
||||||
|
|
||||||
HWND & m_MainWindow;
|
|
||||||
HWND & m_StatusWindow;
|
|
||||||
HWND m_hRomList;
|
|
||||||
ROMBROWSER_FIELDS_LIST m_Fields;
|
|
||||||
FIELD_TYPE_LIST m_FieldType;
|
|
||||||
ROMINFO_LIST m_RomInfo;
|
|
||||||
std::string m_SelectedRom;
|
|
||||||
bool m_Visible;
|
|
||||||
bool m_ShowingRomBrowser;
|
|
||||||
HANDLE m_RefreshThread;
|
|
||||||
bool m_StopRefresh;
|
|
||||||
CIniFile * m_RomIniFile;
|
|
||||||
CIniFile * m_NotesIniFile;
|
|
||||||
CIniFile * m_ExtIniFile;
|
|
||||||
CIniFile * m_ZipIniFile;
|
|
||||||
bool m_AllowSelectionLastRom;
|
|
||||||
static std::wstring m_UnknownGoodName;
|
|
||||||
|
|
||||||
void AddFileNameToList(strlist & FileList, const stdstr & Directory, CPath & File);
|
void AddFileNameToList(strlist & FileList, const stdstr & Directory, CPath & File);
|
||||||
void AddRomToList(const char * RomLocation, const char * lpLastRom);
|
void AddRomToList(const char * RomLocation, const char * lpLastRom);
|
||||||
void AddRomInfoToList(ROM_INFO &RomInfo, const char * lpLastRom);
|
void AddRomInfoToList(ROM_INFO &RomInfo, const char * lpLastRom);
|
||||||
|
@ -164,7 +169,7 @@ class CRomBrowser
|
||||||
void DeallocateBrushs(void);
|
void DeallocateBrushs(void);
|
||||||
void FillRomExtensionInfo(ROM_INFO * pRomInfo);
|
void FillRomExtensionInfo(ROM_INFO * pRomInfo);
|
||||||
bool FillRomInfo(ROM_INFO * pRomInfo);
|
bool FillRomInfo(ROM_INFO * pRomInfo);
|
||||||
void FillRomList(strlist & FileList, const CPath & BaseDirectory, const stdstr & Directory, const char * lpLastRom);
|
void FillRomList(strlist & FileList, const CPath & BaseDirectory, const char * Directory, const char * lpLastRom);
|
||||||
void FixRomListWindow(void);
|
void FixRomListWindow(void);
|
||||||
static int32_t GetCicChipID(uint8_t * RomData);
|
static int32_t GetCicChipID(uint8_t * RomData);
|
||||||
bool LoadDataFromRomFile(const char * FileName, uint8_t * Data, int32_t DataLen, int32_t * RomSize, FILE_FORMAT & FileFormat);
|
bool LoadDataFromRomFile(const char * FileName, uint8_t * Data, int32_t DataLen, int32_t * RomSize, FILE_FORMAT & FileFormat);
|
||||||
|
@ -176,7 +181,7 @@ class CRomBrowser
|
||||||
void RomList_OpenRom(uint32_t pnmh);
|
void RomList_OpenRom(uint32_t pnmh);
|
||||||
void RomList_PopupMenu(uint32_t pnmh);
|
void RomList_PopupMenu(uint32_t pnmh);
|
||||||
void RomList_SortList(void);
|
void RomList_SortList(void);
|
||||||
bool GetRomFileNames(strlist & FileList, const CPath & BaseDirectory, const stdstr & Directory, bool InWatchThread);
|
bool GetRomFileNames(strlist & FileList, const CPath & BaseDirectory, const std::string & Directory, bool InWatchThread);
|
||||||
MD5 RomListHash(strlist & FileList);
|
MD5 RomListHash(strlist & FileList);
|
||||||
|
|
||||||
static void NotificationCB(const char * Status, CRomBrowser * _this);
|
static void NotificationCB(const char * Status, CRomBrowser * _this);
|
||||||
|
@ -196,24 +201,21 @@ class CRomBrowser
|
||||||
static int CALLBACK SelectRomDirCallBack(HWND hwnd, uint32_t uMsg, uint32_t lp, uint32_t lpData);
|
static int CALLBACK SelectRomDirCallBack(HWND hwnd, uint32_t uMsg, uint32_t lp, uint32_t lpData);
|
||||||
static int CALLBACK RomList_CompareItems(uint32_t lParam1, uint32_t lParam2, uint32_t lParamSort);
|
static int CALLBACK RomList_CompareItems(uint32_t lParam1, uint32_t lParam2, uint32_t lParamSort);
|
||||||
|
|
||||||
public:
|
HWND & m_MainWindow;
|
||||||
CRomBrowser(HWND & hMainWindow, HWND & StatusWindow);
|
HWND & m_StatusWindow;
|
||||||
~CRomBrowser(void);
|
HWND m_hRomList;
|
||||||
void HighLightLastRom(void);
|
ROMBROWSER_FIELDS_LIST m_Fields;
|
||||||
void HideRomList(void);
|
FIELD_TYPE_LIST m_FieldType;
|
||||||
void RefreshRomBrowser(void);
|
ROMINFO_LIST m_RomInfo;
|
||||||
void ResetRomBrowserColomuns(void);
|
std::string m_SelectedRom;
|
||||||
void ResizeRomList(WORD nWidth, WORD nHeight);
|
bool m_Visible;
|
||||||
void RomBrowserToTop(void);
|
bool m_ShowingRomBrowser;
|
||||||
void RomBrowserMaximize(bool Mazimize);
|
HANDLE m_RefreshThread;
|
||||||
bool RomBrowserVisible(void);
|
bool m_StopRefresh;
|
||||||
bool RomListDrawItem(int idCtrl, uint32_t lParam);
|
CIniFile * m_RomIniFile;
|
||||||
bool RomListNotify(int idCtrl, uint32_t pnmh);
|
CIniFile * m_NotesIniFile;
|
||||||
void SaveRomListColoumnInfo(void);
|
CIniFile * m_ExtIniFile;
|
||||||
void SelectRomDir(void);
|
CIniFile * m_ZipIniFile;
|
||||||
void ShowRomList(void);
|
bool m_AllowSelectionLastRom;
|
||||||
bool ShowingRomBrowser(void) { return m_ShowingRomBrowser; }
|
static std::wstring m_UnknownGoodName;
|
||||||
const char * CurrentedSelectedRom(void) { return m_SelectedRom.c_str(); }
|
|
||||||
|
|
||||||
static void GetFieldInfo(ROMBROWSER_FIELDS_LIST & Fields, bool UseDefault = false);
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
* *
|
* *
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include <Project64/Settings/UISettings.h>
|
||||||
|
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
|
@ -16,23 +17,23 @@
|
||||||
std::wstring CRomBrowser::m_UnknownGoodName;
|
std::wstring CRomBrowser::m_UnknownGoodName;
|
||||||
|
|
||||||
CRomBrowser::CRomBrowser(HWND & MainWindow, HWND & StatusWindow) :
|
CRomBrowser::CRomBrowser(HWND & MainWindow, HWND & StatusWindow) :
|
||||||
m_MainWindow(MainWindow),
|
m_MainWindow(MainWindow),
|
||||||
m_StatusWindow(StatusWindow),
|
m_StatusWindow(StatusWindow),
|
||||||
m_ShowingRomBrowser(false),
|
m_ShowingRomBrowser(false),
|
||||||
m_RefreshThread(NULL),
|
m_RefreshThread(NULL),
|
||||||
m_RomIniFile(NULL),
|
m_RomIniFile(NULL),
|
||||||
m_NotesIniFile(NULL),
|
m_NotesIniFile(NULL),
|
||||||
m_ExtIniFile(NULL),
|
m_ExtIniFile(NULL),
|
||||||
m_ZipIniFile(NULL),
|
m_ZipIniFile(NULL),
|
||||||
m_AllowSelectionLastRom(true),
|
m_AllowSelectionLastRom(true),
|
||||||
m_WatchThreadID(0)
|
m_WatchThreadID(0)
|
||||||
{
|
{
|
||||||
if (g_Settings)
|
if (g_Settings)
|
||||||
{
|
{
|
||||||
m_RomIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
|
m_RomIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
|
||||||
m_NotesIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Notes).c_str());
|
m_NotesIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Notes).c_str());
|
||||||
m_ExtIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_ExtInfo).c_str());
|
m_ExtIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_ExtInfo).c_str());
|
||||||
m_ZipIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_7zipCache).c_str());
|
m_ZipIniFile = new CIniFile(g_Settings->LoadStringVal(RomList_7zipCache).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_hRomList = 0;
|
m_hRomList = 0;
|
||||||
|
@ -114,7 +115,7 @@ int32_t CRomBrowser::CalcSortPosition(uint32_t lParam)
|
||||||
|
|
||||||
for (int32_t SortIndex = NoOfSortKeys; SortIndex >= 0; SortIndex--)
|
for (int32_t SortIndex = NoOfSortKeys; SortIndex >= 0; SortIndex--)
|
||||||
{
|
{
|
||||||
stdstr SortFieldName = g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex, SortIndex);
|
std::string SortFieldName = UISettingsLoadStringIndex(RomBrowser_SortFieldIndex, SortIndex);
|
||||||
if (SortFieldName.length() == 0)
|
if (SortFieldName.length() == 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
@ -134,7 +135,7 @@ int32_t CRomBrowser::CalcSortPosition(uint32_t lParam)
|
||||||
SORT_FIELD SortFieldInfo;
|
SORT_FIELD SortFieldInfo;
|
||||||
SortFieldInfo._this = this;
|
SortFieldInfo._this = this;
|
||||||
SortFieldInfo.Key = index;
|
SortFieldInfo.Key = index;
|
||||||
SortFieldInfo.KeyAscend = g_Settings->LoadBoolIndex(RomBrowser_SortAscendingIndex, SortIndex);
|
SortFieldInfo.KeyAscend = UISettingsLoadBoolIndex(RomBrowser_SortAscendingIndex, SortIndex);
|
||||||
|
|
||||||
//calc new start and end
|
//calc new start and end
|
||||||
int32_t LastTestPos = -1;
|
int32_t LastTestPos = -1;
|
||||||
|
@ -253,7 +254,7 @@ int32_t CRomBrowser::CalcSortPosition(uint32_t lParam)
|
||||||
//Compare end with item to see if we should do it after or before it
|
//Compare end with item to see if we should do it after or before it
|
||||||
for (int32_t SortIndex = 0; SortIndex < NoOfSortKeys; SortIndex++)
|
for (int32_t SortIndex = 0; SortIndex < NoOfSortKeys; SortIndex++)
|
||||||
{
|
{
|
||||||
stdstr SortFieldName = g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex, SortIndex);
|
std::string SortFieldName = UISettingsLoadStringIndex(RomBrowser_SortFieldIndex, SortIndex);
|
||||||
if (SortFieldName.length() == 0)
|
if (SortFieldName.length() == 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
@ -268,7 +269,7 @@ int32_t CRomBrowser::CalcSortPosition(uint32_t lParam)
|
||||||
SORT_FIELD SortFieldInfo;
|
SORT_FIELD SortFieldInfo;
|
||||||
SortFieldInfo._this = this;
|
SortFieldInfo._this = this;
|
||||||
SortFieldInfo.Key = index;
|
SortFieldInfo.Key = index;
|
||||||
SortFieldInfo.KeyAscend = g_Settings->LoadBoolIndex(RomBrowser_SortAscendingIndex, SortIndex) != 0;
|
SortFieldInfo.KeyAscend = UISettingsLoadBoolIndex(RomBrowser_SortAscendingIndex, SortIndex) != 0;
|
||||||
|
|
||||||
LVITEMW lvItem;
|
LVITEMW lvItem;
|
||||||
memset(&lvItem, 0, sizeof(LVITEMW));
|
memset(&lvItem, 0, sizeof(LVITEMW));
|
||||||
|
@ -312,9 +313,7 @@ void CRomBrowser::AddRomInfoToList(ROM_INFO &RomInfo, const char * lpLastRom)
|
||||||
lvItem.pszText = LPSTR_TEXTCALLBACKW;
|
lvItem.pszText = LPSTR_TEXTCALLBACKW;
|
||||||
|
|
||||||
int32_t index = ListView_InsertItem(m_hRomList, &lvItem);
|
int32_t index = ListView_InsertItem(m_hRomList, &lvItem);
|
||||||
|
|
||||||
int32_t iItem = ListView_GetNextItem(m_hRomList, -1, LVNI_SELECTED);
|
int32_t iItem = ListView_GetNextItem(m_hRomList, -1, LVNI_SELECTED);
|
||||||
//if (iItem == -1) { return; }
|
|
||||||
|
|
||||||
//if the last rom then highlight the item
|
//if the last rom then highlight the item
|
||||||
if (iItem < 0 && _stricmp(RomInfo.szFullFileName, lpLastRom) == 0)
|
if (iItem < 0 && _stricmp(RomInfo.szFullFileName, lpLastRom) == 0)
|
||||||
|
@ -511,7 +510,7 @@ bool CRomBrowser::FillRomInfo(ROM_INFO * pRomInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CRomBrowser::GetRomFileNames(strlist & FileList, const CPath & BaseDirectory, const stdstr & Directory, bool InWatchThread)
|
bool CRomBrowser::GetRomFileNames(strlist & FileList, const CPath & BaseDirectory, const std::string & Directory, bool InWatchThread)
|
||||||
{
|
{
|
||||||
if (!BaseDirectory.DirectoryExists())
|
if (!BaseDirectory.DirectoryExists())
|
||||||
{
|
{
|
||||||
|
@ -534,9 +533,10 @@ bool CRomBrowser::GetRomFileNames(strlist & FileList, const CPath & BaseDirector
|
||||||
|
|
||||||
if (SearchPath.IsDirectory())
|
if (SearchPath.IsDirectory())
|
||||||
{
|
{
|
||||||
if (g_Settings->LoadDword(RomBrowser_Recursive))
|
if (g_Settings->LoadBool(RomList_GameDirRecursive))
|
||||||
{
|
{
|
||||||
stdstr CurrentDir = Directory + SearchPath.GetLastDirectory() + "\\";
|
CPath CurrentDir(Directory);
|
||||||
|
CurrentDir.AppendDirectory(SearchPath.GetLastDirectory().c_str());
|
||||||
GetRomFileNames(FileList, BaseDirectory, CurrentDir, InWatchThread);
|
GetRomFileNames(FileList, BaseDirectory, CurrentDir, InWatchThread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -582,10 +582,10 @@ void CRomBrowser::AddFileNameToList(strlist & FileList, const stdstr & Directory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, const stdstr & Directory, const char * lpLastRom)
|
void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, const char * Directory, const char * lpLastRom)
|
||||||
{
|
{
|
||||||
CPath SearchPath(BaseDirectory, "*.*");
|
CPath SearchPath(BaseDirectory, "*");
|
||||||
SearchPath.AppendDirectory(Directory.c_str());
|
SearchPath.AppendDirectory(Directory);
|
||||||
|
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "1 %s", (const char *)SearchPath);
|
WriteTrace(TraceUserInterface, TraceDebug, "1 %s", (const char *)SearchPath);
|
||||||
if (!SearchPath.FindFirst(CPath::FIND_ATTRIBUTE_ALLFILES))
|
if (!SearchPath.FindFirst(CPath::FIND_ATTRIBUTE_ALLFILES))
|
||||||
|
@ -604,9 +604,10 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
|
||||||
|
|
||||||
if (SearchPath.IsDirectory())
|
if (SearchPath.IsDirectory())
|
||||||
{
|
{
|
||||||
if (g_Settings->LoadDword(RomBrowser_Recursive))
|
if (g_Settings->LoadBool(RomList_GameDirRecursive))
|
||||||
{
|
{
|
||||||
stdstr CurrentDir = Directory + SearchPath.GetLastDirectory() + "\\";
|
CPath CurrentDir(Directory);
|
||||||
|
CurrentDir.AppendDirectory(SearchPath.GetLastDirectory().c_str());
|
||||||
FillRomList(FileList, BaseDirectory, CurrentDir, lpLastRom);
|
FillRomList(FileList, BaseDirectory, CurrentDir, lpLastRom);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
@ -614,8 +615,7 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
|
||||||
|
|
||||||
AddFileNameToList(FileList, Directory, SearchPath);
|
AddFileNameToList(FileList, Directory, SearchPath);
|
||||||
|
|
||||||
stdstr Extension = SearchPath.GetExtension();
|
stdstr Extension = stdstr(SearchPath.GetExtension()).ToLower();
|
||||||
Extension.ToLower();
|
|
||||||
|
|
||||||
for (ext_ID = 0; ext_ID < exts; ext_ID++)
|
for (ext_ID = 0; ext_ID < exts; ext_ID++)
|
||||||
{
|
{
|
||||||
|
@ -719,7 +719,7 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
|
||||||
const char backup_character = szHeader[2 * x + delimit_offset];
|
const char backup_character = szHeader[2 * x + delimit_offset];
|
||||||
|
|
||||||
szHeader[2 * x + delimit_offset] = '\0';
|
szHeader[2 * x + delimit_offset] = '\0';
|
||||||
*(uint32_t *)&RomData[x] = std::strtoul(&szHeader[2 * x], NULL, 16);
|
*(uint32_t *)&RomData[x] = strtoul(&szHeader[2 * x], NULL, 16);
|
||||||
szHeader[2 * x + delimit_offset] = backup_character;
|
szHeader[2 * x + delimit_offset] = backup_character;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -809,7 +809,7 @@ void CRomBrowser::HighLightLastRom(void)
|
||||||
if (!RomBrowserVisible()) { return; }
|
if (!RomBrowserVisible()) { return; }
|
||||||
|
|
||||||
//Get the string to the last rom
|
//Get the string to the last rom
|
||||||
stdstr LastRom = g_Settings->LoadStringIndex(File_RecentGameFileIndex, 0);
|
stdstr LastRom = UISettingsLoadStringIndex(File_RecentGameFileIndex, 0);
|
||||||
LPCSTR lpLastRom = LastRom.c_str();
|
LPCSTR lpLastRom = LastRom.c_str();
|
||||||
|
|
||||||
LVITEMW lvItem;
|
LVITEMW lvItem;
|
||||||
|
@ -858,8 +858,8 @@ bool CRomBrowser::LoadDataFromRomFile(const char * FileName, uint8_t * Data, int
|
||||||
if (file == NULL) { return false; }
|
if (file == NULL) { return false; }
|
||||||
|
|
||||||
port = unzGoToFirstFile(file);
|
port = unzGoToFirstFile(file);
|
||||||
FoundRom = FALSE;
|
FoundRom = false;
|
||||||
while (port == UNZ_OK && FoundRom == FALSE)
|
while (port == UNZ_OK && FoundRom == false)
|
||||||
{
|
{
|
||||||
unzGetCurrentFileInfo(file, &info, zname, 128, NULL, 0, NULL, 0);
|
unzGetCurrentFileInfo(file, &info, zname, 128, NULL, 0, NULL, 0);
|
||||||
if (unzLocateFile(file, zname, 1) != UNZ_OK)
|
if (unzLocateFile(file, zname, 1) != UNZ_OK)
|
||||||
|
@ -959,34 +959,35 @@ void CRomBrowser::ByteSwapRomData(uint8_t * Data, int32_t DataLen)
|
||||||
|
|
||||||
void CRomBrowser::LoadRomList(void)
|
void CRomBrowser::LoadRomList(void)
|
||||||
{
|
{
|
||||||
stdstr FileName = g_Settings->LoadStringVal(SupportFile_RomListCache);
|
CPath FileName(g_Settings->LoadStringVal(RomList_RomListCache));
|
||||||
|
CFile file(FileName, CFileBase::modeRead | CFileBase::modeNoTruncate);
|
||||||
|
|
||||||
//Open the cache file
|
if (!file.IsOpen())
|
||||||
HANDLE hFile = CreateFile(FileName.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
|
|
||||||
if (hFile == INVALID_HANDLE_VALUE)
|
|
||||||
{
|
{
|
||||||
//if file does not exist then refresh the data
|
//if file does not exist then refresh the data
|
||||||
RefreshRomBrowser();
|
RefreshRomBrowser();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD dwRead;
|
|
||||||
unsigned char md5[16];
|
unsigned char md5[16];
|
||||||
ReadFile(hFile, &md5, sizeof(md5), &dwRead, NULL);
|
if (!file.Read(md5, sizeof(md5)))
|
||||||
|
{
|
||||||
|
file.Close();
|
||||||
|
RefreshRomBrowser();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Read the size of ROM_INFO
|
//Read the size of ROM_INFO
|
||||||
int32_t RomInfoSize = 0;
|
int32_t RomInfoSize = 0;
|
||||||
ReadFile(hFile, &RomInfoSize, sizeof(RomInfoSize), &dwRead, NULL);
|
if (!file.Read(&RomInfoSize, sizeof(RomInfoSize)) || RomInfoSize != sizeof(ROM_INFO))
|
||||||
if (RomInfoSize != sizeof(ROM_INFO) || dwRead != sizeof(RomInfoSize))
|
|
||||||
{
|
{
|
||||||
CloseHandle(hFile);
|
file.Close();
|
||||||
RefreshRomBrowser();
|
RefreshRomBrowser();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Read the Number of entries
|
//Read the Number of entries
|
||||||
int32_t Entries = 0;
|
int32_t Entries = 0;
|
||||||
ReadFile(hFile, &Entries, sizeof(Entries), &dwRead, NULL);
|
file.Read(&Entries, sizeof(Entries));
|
||||||
|
|
||||||
//Read Every Entry
|
//Read Every Entry
|
||||||
DeallocateBrushs();
|
DeallocateBrushs();
|
||||||
|
@ -994,7 +995,7 @@ void CRomBrowser::LoadRomList(void)
|
||||||
for (int32_t count = 0; count < Entries; count++)
|
for (int32_t count = 0; count < Entries; count++)
|
||||||
{
|
{
|
||||||
ROM_INFO RomInfo;
|
ROM_INFO RomInfo;
|
||||||
ReadFile(hFile, &RomInfo, RomInfoSize, &dwRead, NULL);
|
file.Read(&RomInfo, RomInfoSize);
|
||||||
RomInfo.SelColorBrush = NULL;
|
RomInfo.SelColorBrush = NULL;
|
||||||
|
|
||||||
LVITEMW lvItem;
|
LVITEMW lvItem;
|
||||||
|
@ -1007,7 +1008,6 @@ void CRomBrowser::LoadRomList(void)
|
||||||
SendMessageW(m_hRomList, LVM_INSERTITEMW, 0, (LPARAM)&lvItem);
|
SendMessageW(m_hRomList, LVM_INSERTITEMW, 0, (LPARAM)&lvItem);
|
||||||
m_RomInfo.push_back(RomInfo);
|
m_RomInfo.push_back(RomInfo);
|
||||||
}
|
}
|
||||||
CloseHandle(hFile);
|
|
||||||
AllocateBrushs();
|
AllocateBrushs();
|
||||||
RomList_SortList();
|
RomList_SortList();
|
||||||
}
|
}
|
||||||
|
@ -1055,8 +1055,7 @@ void CRomBrowser::RefreshRomBrowserStatic(CRomBrowser * _this)
|
||||||
if (_this->m_hRomList == NULL) { return; }
|
if (_this->m_hRomList == NULL) { return; }
|
||||||
|
|
||||||
//delete cache
|
//delete cache
|
||||||
stdstr CacheFileName = g_Settings->LoadStringVal(SupportFile_RomListCache);
|
CPath(g_Settings->LoadStringVal(RomList_RomListCache)).Delete();
|
||||||
DeleteFile(CacheFileName.c_str());
|
|
||||||
|
|
||||||
//clear all current items
|
//clear all current items
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "1");
|
WriteTrace(TraceUserInterface, TraceDebug, "1");
|
||||||
|
@ -1068,7 +1067,7 @@ void CRomBrowser::RefreshRomBrowserStatic(CRomBrowser * _this)
|
||||||
Sleep(100);
|
Sleep(100);
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "3");
|
WriteTrace(TraceUserInterface, TraceDebug, "3");
|
||||||
|
|
||||||
if (_this->m_WatchRomDir != g_Settings->LoadStringVal(Directory_Game))
|
if (_this->m_WatchRomDir != g_Settings->LoadStringVal(RomList_GameDir))
|
||||||
{
|
{
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "4");
|
WriteTrace(TraceUserInterface, TraceDebug, "4");
|
||||||
_this->WatchThreadStop();
|
_this->WatchThreadStop();
|
||||||
|
@ -1078,12 +1077,12 @@ void CRomBrowser::RefreshRomBrowserStatic(CRomBrowser * _this)
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "7");
|
WriteTrace(TraceUserInterface, TraceDebug, "7");
|
||||||
stdstr RomDir = g_Settings->LoadStringVal(Directory_Game);
|
stdstr RomDir = g_Settings->LoadStringVal(RomList_GameDir);
|
||||||
stdstr LastRom = g_Settings->LoadStringIndex(File_RecentGameFileIndex, 0);
|
stdstr LastRom = UISettingsLoadStringIndex(File_RecentGameFileIndex, 0);
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "8");
|
WriteTrace(TraceUserInterface, TraceDebug, "8");
|
||||||
|
|
||||||
strlist FileNames;
|
strlist FileNames;
|
||||||
_this->FillRomList(FileNames, CPath(RomDir), stdstr(""), LastRom.c_str());
|
_this->FillRomList(FileNames, CPath(RomDir), "", LastRom.c_str());
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "9");
|
WriteTrace(TraceUserInterface, TraceDebug, "9");
|
||||||
_this->SaveRomList(FileNames);
|
_this->SaveRomList(FileNames);
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "10");
|
WriteTrace(TraceUserInterface, TraceDebug, "10");
|
||||||
|
@ -1141,15 +1140,15 @@ void CRomBrowser::ResizeRomList(WORD nWidth, WORD nHeight)
|
||||||
{
|
{
|
||||||
if (RomBrowserVisible())
|
if (RomBrowserVisible())
|
||||||
{
|
{
|
||||||
if (g_Settings->LoadDword(RomBrowser_Maximized) == 0 && nHeight != 0)
|
if (UISettingsLoadBool(RomBrowser_Maximized) == 0 && nHeight != 0)
|
||||||
{
|
{
|
||||||
if (g_Settings->LoadDword(RomBrowser_Width) != nWidth)
|
if (UISettingsLoadDword(RomBrowser_Width) != nWidth)
|
||||||
{
|
{
|
||||||
g_Settings->SaveDword(RomBrowser_Width, nWidth);
|
UISettingsSaveDword(RomBrowser_Width, nWidth);
|
||||||
}
|
}
|
||||||
if (g_Settings->LoadDword(RomBrowser_Height) != nHeight)
|
if (UISettingsLoadDword(RomBrowser_Height) != nHeight)
|
||||||
{
|
{
|
||||||
g_Settings->SaveDword(RomBrowser_Height, nHeight);
|
UISettingsSaveDword(RomBrowser_Height, nHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (IsWindow((HWND)m_StatusWindow))
|
if (IsWindow((HWND)m_StatusWindow))
|
||||||
|
@ -1179,7 +1178,7 @@ void CRomBrowser::RomBrowserToTop(void)
|
||||||
|
|
||||||
void CRomBrowser::RomBrowserMaximize(bool Mazimize)
|
void CRomBrowser::RomBrowserMaximize(bool Mazimize)
|
||||||
{
|
{
|
||||||
g_Settings->SaveDword(RomBrowser_Maximized, (uint32_t)Mazimize);
|
UISettingsSaveBool(RomBrowser_Maximized, Mazimize);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CRomBrowser::RomListDrawItem(int32_t idCtrl, uint32_t lParam)
|
bool CRomBrowser::RomListDrawItem(int32_t idCtrl, uint32_t lParam)
|
||||||
|
@ -1275,14 +1274,14 @@ bool CRomBrowser::RomListNotify(int32_t idCtrl, uint32_t pnmh)
|
||||||
case LVN_GETDISPINFOW: RomList_GetDispInfo(pnmh); break;
|
case LVN_GETDISPINFOW: RomList_GetDispInfo(pnmh); break;
|
||||||
case NM_RCLICK: RomList_PopupMenu(pnmh); break;
|
case NM_RCLICK: RomList_PopupMenu(pnmh); break;
|
||||||
case NM_CLICK:
|
case NM_CLICK:
|
||||||
{
|
|
||||||
LONG iItem = ListView_GetNextItem(m_hRomList, -1, LVNI_SELECTED);
|
|
||||||
if (iItem != -1)
|
|
||||||
{
|
{
|
||||||
m_AllowSelectionLastRom = false;
|
LONG iItem = ListView_GetNextItem(m_hRomList, -1, LVNI_SELECTED);
|
||||||
|
if (iItem != -1)
|
||||||
|
{
|
||||||
|
m_AllowSelectionLastRom = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1299,9 +1298,9 @@ void CRomBrowser::RomList_ColoumnSortList(uint32_t pnmh)
|
||||||
if (m_Fields[index].Pos() == (size_t)pnmv->iSubItem) { break; }
|
if (m_Fields[index].Pos() == (size_t)pnmv->iSubItem) { break; }
|
||||||
}
|
}
|
||||||
if (m_Fields.size() == index) { return; }
|
if (m_Fields.size() == index) { return; }
|
||||||
if (_stricmp(g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex, 0).c_str(), m_Fields[index].Name()) == 0)
|
if (_stricmp(UISettingsLoadStringIndex(RomBrowser_SortFieldIndex, 0).c_str(), m_Fields[index].Name()) == 0)
|
||||||
{
|
{
|
||||||
g_Settings->SaveBoolIndex(RomBrowser_SortAscendingIndex, 0, !g_Settings->LoadBoolIndex(RomBrowser_SortAscendingIndex, 0));
|
UISettingsSaveBoolIndex(RomBrowser_SortAscendingIndex, 0, !UISettingsLoadBoolIndex(RomBrowser_SortAscendingIndex, 0));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1309,11 +1308,11 @@ void CRomBrowser::RomList_ColoumnSortList(uint32_t pnmh)
|
||||||
|
|
||||||
for (count = NoOfSortKeys; count > 0; count--)
|
for (count = NoOfSortKeys; count > 0; count--)
|
||||||
{
|
{
|
||||||
g_Settings->SaveStringIndex(RomBrowser_SortFieldIndex, count, g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex, count - 1).c_str());
|
UISettingsSaveStringIndex(RomBrowser_SortFieldIndex, count, UISettingsLoadStringIndex(RomBrowser_SortFieldIndex, count - 1).c_str());
|
||||||
g_Settings->SaveBoolIndex(RomBrowser_SortAscendingIndex, count, g_Settings->LoadBoolIndex(RomBrowser_SortAscendingIndex, count - 1));
|
UISettingsSaveBoolIndex(RomBrowser_SortAscendingIndex, count, UISettingsLoadBoolIndex(RomBrowser_SortAscendingIndex, count - 1));
|
||||||
}
|
}
|
||||||
g_Settings->SaveStringIndex(RomBrowser_SortFieldIndex, 0, m_Fields[index].Name());
|
UISettingsSaveStringIndex(RomBrowser_SortFieldIndex, 0, m_Fields[index].Name());
|
||||||
g_Settings->SaveBoolIndex(RomBrowser_SortAscendingIndex, 0, true);
|
UISettingsSaveBoolIndex(RomBrowser_SortAscendingIndex, 0, true);
|
||||||
}
|
}
|
||||||
RomList_SortList();
|
RomList_SortList();
|
||||||
}
|
}
|
||||||
|
@ -1575,7 +1574,7 @@ void CRomBrowser::RomList_SortList(void)
|
||||||
|
|
||||||
for (int32_t count = NoOfSortKeys; count >= 0; count--)
|
for (int32_t count = NoOfSortKeys; count >= 0; count--)
|
||||||
{
|
{
|
||||||
stdstr SortFieldName = g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex, count);
|
stdstr SortFieldName = UISettingsLoadStringIndex(RomBrowser_SortFieldIndex, count);
|
||||||
|
|
||||||
size_t index;
|
size_t index;
|
||||||
for (index = 0; index < m_Fields.size(); index++)
|
for (index = 0; index < m_Fields.size(); index++)
|
||||||
|
@ -1585,7 +1584,7 @@ void CRomBrowser::RomList_SortList(void)
|
||||||
if (index >= m_Fields.size()) { continue; }
|
if (index >= m_Fields.size()) { continue; }
|
||||||
SortFieldInfo._this = this;
|
SortFieldInfo._this = this;
|
||||||
SortFieldInfo.Key = index;
|
SortFieldInfo.Key = index;
|
||||||
SortFieldInfo.KeyAscend = g_Settings->LoadBoolIndex(RomBrowser_SortAscendingIndex, count) != 0;
|
SortFieldInfo.KeyAscend = UISettingsLoadBoolIndex(RomBrowser_SortAscendingIndex, count) != 0;
|
||||||
ListView_SortItems(m_hRomList, RomList_CompareItems, &SortFieldInfo);
|
ListView_SortItems(m_hRomList, RomList_CompareItems, &SortFieldInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1598,29 +1597,26 @@ void CRomBrowser::SaveRomList(strlist & FileList)
|
||||||
{
|
{
|
||||||
MD5 ListHash = RomListHash(FileList);
|
MD5 ListHash = RomListHash(FileList);
|
||||||
|
|
||||||
stdstr FileName = g_Settings->LoadStringVal(SupportFile_RomListCache);
|
CPath FileName(g_Settings->LoadStringVal(RomList_RomListCache));
|
||||||
HANDLE hFile = CreateFile(FileName.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
|
CFile file(FileName, CFileBase::modeWrite | CFileBase::modeCreate);
|
||||||
|
file.Write(ListHash.raw_digest(), 16);
|
||||||
DWORD dwWritten;
|
|
||||||
WriteFile(hFile, ListHash.raw_digest(), 16, &dwWritten, NULL);
|
|
||||||
|
|
||||||
//Write the size of ROM_INFO
|
//Write the size of ROM_INFO
|
||||||
int32_t RomInfoSize = sizeof(ROM_INFO);
|
int32_t RomInfoSize = sizeof(ROM_INFO);
|
||||||
WriteFile(hFile, &RomInfoSize, sizeof(RomInfoSize), &dwWritten, NULL);
|
file.Write(&RomInfoSize, sizeof(RomInfoSize));
|
||||||
|
|
||||||
//Write the Number of entries
|
//Write the Number of entries
|
||||||
int32_t Entries = m_RomInfo.size();
|
int32_t Entries = m_RomInfo.size();
|
||||||
WriteFile(hFile, &Entries, sizeof(Entries), &dwWritten, NULL);
|
file.Write(&Entries, sizeof(Entries));
|
||||||
|
|
||||||
//Write Every Entry
|
//Write Every Entry
|
||||||
for (int32_t count = 0; count < Entries; count++)
|
for (int32_t count = 0; count < Entries; count++)
|
||||||
{
|
{
|
||||||
ROM_INFO * RomInfo = &m_RomInfo[count];
|
file.Write(&m_RomInfo[count], RomInfoSize);
|
||||||
WriteFile(hFile, RomInfo, RomInfoSize, &dwWritten, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Close the file handle
|
//Close the file handle
|
||||||
CloseHandle(hFile);
|
file.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRomBrowser::SaveRomListColoumnInfo(void)
|
void CRomBrowser::SaveRomListColoumnInfo(void)
|
||||||
|
@ -1683,7 +1679,7 @@ void CRomBrowser::SelectRomDir(void)
|
||||||
std::wstring title = wGS(SELECT_ROM_DIR);
|
std::wstring title = wGS(SELECT_ROM_DIR);
|
||||||
|
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "1");
|
WriteTrace(TraceUserInterface, TraceDebug, "1");
|
||||||
stdstr RomDir = g_Settings->LoadStringVal(Directory_Game);
|
stdstr RomDir = g_Settings->LoadStringVal(RomList_GameDir).c_str();
|
||||||
bi.hwndOwner = m_MainWindow;
|
bi.hwndOwner = m_MainWindow;
|
||||||
bi.pidlRoot = NULL;
|
bi.pidlRoot = NULL;
|
||||||
bi.pszDisplayName = SelectedDir;
|
bi.pszDisplayName = SelectedDir;
|
||||||
|
@ -1707,7 +1703,7 @@ void CRomBrowser::SelectRomDir(void)
|
||||||
}
|
}
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "5");
|
WriteTrace(TraceUserInterface, TraceDebug, "5");
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "6");
|
WriteTrace(TraceUserInterface, TraceDebug, "6");
|
||||||
g_Settings->SaveString(Directory_Game, Directory);
|
g_Settings->SaveString(RomList_GameDir, Directory);
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "7");
|
WriteTrace(TraceUserInterface, TraceDebug, "7");
|
||||||
Notify().AddRecentDir(Directory);
|
Notify().AddRecentDir(Directory);
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "8");
|
WriteTrace(TraceUserInterface, TraceDebug, "8");
|
||||||
|
@ -1732,14 +1728,14 @@ void CRomBrowser::FixRomListWindow(void)
|
||||||
int32_t Y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
|
int32_t Y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
|
||||||
|
|
||||||
//Load the value from settings, if none is available, default to above
|
//Load the value from settings, if none is available, default to above
|
||||||
g_Settings->LoadDword(RomBrowser_Top, (uint32_t &)Y);
|
UISettingsLoadDword(RomBrowser_Top, (uint32_t &)Y);
|
||||||
g_Settings->LoadDword(RomBrowser_Left, (uint32_t &)X);
|
UISettingsLoadDword(RomBrowser_Left, (uint32_t &)X);
|
||||||
|
|
||||||
SetWindowPos(m_MainWindow, NULL, X, Y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
|
SetWindowPos(m_MainWindow, NULL, X, Y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
|
||||||
|
|
||||||
//Fix height and width
|
//Fix height and width
|
||||||
int32_t Width = g_Settings->LoadDword(RomBrowser_Width);
|
int32_t Width = UISettingsLoadDword(RomBrowser_Width);
|
||||||
int32_t Height = g_Settings->LoadDword(RomBrowser_Height);
|
int32_t Height = UISettingsLoadDword(RomBrowser_Height);
|
||||||
|
|
||||||
if (Width < 200) { Width = 200; }
|
if (Width < 200) { Width = 200; }
|
||||||
if (Height < 200) { Height = 200; }
|
if (Height < 200) { Height = 200; }
|
||||||
|
@ -1803,7 +1799,7 @@ void CRomBrowser::HideRomList(void)
|
||||||
EnableWindow(m_hRomList, FALSE);
|
EnableWindow(m_hRomList, FALSE);
|
||||||
ShowWindow(m_hRomList, SW_HIDE);
|
ShowWindow(m_hRomList, SW_HIDE);
|
||||||
|
|
||||||
if (g_Settings->LoadBool(RomBrowser_Maximized)) { ShowWindow(m_MainWindow, SW_RESTORE); }
|
if (UISettingsLoadBool(RomBrowser_Maximized)) { ShowWindow(m_MainWindow, SW_RESTORE); }
|
||||||
|
|
||||||
//Change the window style
|
//Change the window style
|
||||||
long Style = GetWindowLong(m_MainWindow, GWL_STYLE) & ~(WS_SIZEBOX | WS_MAXIMIZEBOX);
|
long Style = GetWindowLong(m_MainWindow, GWL_STYLE) & ~(WS_SIZEBOX | WS_MAXIMIZEBOX);
|
||||||
|
@ -1814,8 +1810,8 @@ void CRomBrowser::HideRomList(void)
|
||||||
GetWindowRect(m_MainWindow, &rect);
|
GetWindowRect(m_MainWindow, &rect);
|
||||||
int32_t X = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
|
int32_t X = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
|
||||||
int32_t Y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
|
int32_t Y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
|
||||||
g_Settings->LoadDword(UserInterface_MainWindowTop, (uint32_t &)Y);
|
UISettingsLoadDword(UserInterface_MainWindowTop, (uint32_t &)Y);
|
||||||
g_Settings->LoadDword(UserInterface_MainWindowLeft, (uint32_t &)X);
|
UISettingsLoadDword(UserInterface_MainWindowLeft, (uint32_t &)X);
|
||||||
SetWindowPos(m_MainWindow, NULL, X, Y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
|
SetWindowPos(m_MainWindow, NULL, X, Y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
|
||||||
|
|
||||||
//Mark the window as not visible
|
//Mark the window as not visible
|
||||||
|
@ -1832,7 +1828,7 @@ bool CRomBrowser::RomDirNeedsRefresh(void)
|
||||||
bool InWatchThread = (m_WatchThreadID == GetCurrentThreadId());
|
bool InWatchThread = (m_WatchThreadID == GetCurrentThreadId());
|
||||||
|
|
||||||
//Get Old MD5 of file names
|
//Get Old MD5 of file names
|
||||||
stdstr FileName = g_Settings->LoadStringVal(SupportFile_RomListCache);
|
stdstr FileName = g_Settings->LoadStringVal(RomList_RomListCache);
|
||||||
HANDLE hFile = CreateFile(FileName.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
|
HANDLE hFile = CreateFile(FileName.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
|
||||||
if (hFile == INVALID_HANDLE_VALUE)
|
if (hFile == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
|
@ -1847,7 +1843,7 @@ bool CRomBrowser::RomDirNeedsRefresh(void)
|
||||||
|
|
||||||
//Get Current MD5 of file names
|
//Get Current MD5 of file names
|
||||||
strlist FileNames;
|
strlist FileNames;
|
||||||
if (!GetRomFileNames(FileNames, CPath(g_Settings->LoadStringVal(Directory_Game)), stdstr(""), InWatchThread))
|
if (!GetRomFileNames(FileNames, CPath(g_Settings->LoadStringVal(RomList_GameDir)), stdstr(""), InWatchThread))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1880,7 +1876,7 @@ void CRomBrowser::WatchRomDirChanged(CRomBrowser * _this)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "1");
|
WriteTrace(TraceUserInterface, TraceDebug, "1");
|
||||||
_this->m_WatchRomDir = g_Settings->LoadStringVal(Directory_Game);
|
_this->m_WatchRomDir = g_Settings->LoadStringVal(RomList_GameDir);
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "2");
|
WriteTrace(TraceUserInterface, TraceDebug, "2");
|
||||||
if (_this->RomDirNeedsRefresh())
|
if (_this->RomDirNeedsRefresh())
|
||||||
{
|
{
|
||||||
|
@ -1888,9 +1884,10 @@ void CRomBrowser::WatchRomDirChanged(CRomBrowser * _this)
|
||||||
PostMessage((HWND)_this->m_MainWindow, WM_COMMAND, ID_FILE_REFRESHROMLIST, 0);
|
PostMessage((HWND)_this->m_MainWindow, WM_COMMAND, ID_FILE_REFRESHROMLIST, 0);
|
||||||
}
|
}
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "3");
|
WriteTrace(TraceUserInterface, TraceDebug, "3");
|
||||||
HANDLE hChange[] = {
|
HANDLE hChange[] =
|
||||||
|
{
|
||||||
_this->m_WatchStopEvent,
|
_this->m_WatchStopEvent,
|
||||||
FindFirstChangeNotification(_this->m_WatchRomDir.c_str(), g_Settings->LoadDword(RomBrowser_Recursive), FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_SIZE),
|
FindFirstChangeNotification(_this->m_WatchRomDir.c_str(), g_Settings->LoadBool(RomList_GameDirRecursive), FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_SIZE),
|
||||||
};
|
};
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "4");
|
WriteTrace(TraceUserInterface, TraceDebug, "4");
|
||||||
for (;;)
|
for (;;)
|
||||||
|
@ -1927,7 +1924,10 @@ void CRomBrowser::WatchThreadStart(void)
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "1");
|
WriteTrace(TraceUserInterface, TraceDebug, "1");
|
||||||
WatchThreadStop();
|
WatchThreadStop();
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "2");
|
WriteTrace(TraceUserInterface, TraceDebug, "2");
|
||||||
m_WatchStopEvent = CreateEvent(NULL, true, false, NULL);
|
if (m_WatchStopEvent == NULL)
|
||||||
|
{
|
||||||
|
m_WatchStopEvent = CreateEvent(NULL, true, false, NULL);
|
||||||
|
}
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "3");
|
WriteTrace(TraceUserInterface, TraceDebug, "3");
|
||||||
m_WatchThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)WatchRomDirChanged, this, 0, &m_WatchThreadID);
|
m_WatchThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)WatchRomDirChanged, this, 0, &m_WatchThreadID);
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "4");
|
WriteTrace(TraceUserInterface, TraceDebug, "4");
|
||||||
|
|
|
@ -23,7 +23,7 @@ CGameStatusPage::CGameStatusPage(HWND hParent, const RECT & rcDispay)
|
||||||
CIniFile RomIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
|
CIniFile RomIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
|
||||||
strlist Keys;
|
strlist Keys;
|
||||||
RomIniFile.GetKeyList("Rom Status", Keys);
|
RomIniFile.GetKeyList("Rom Status", Keys);
|
||||||
stdstr Status = g_Settings->LoadStringVal(Rdb_Status);
|
stdstr Status = UISettingsLoadStringVal(Rdb_Status);
|
||||||
|
|
||||||
CModifiedComboBoxTxt * ComboBox;
|
CModifiedComboBoxTxt * ComboBox;
|
||||||
ComboBox = AddModComboBoxTxt(GetDlgItem(IDC_STATUS_TYPE), Rdb_Status);
|
ComboBox = AddModComboBoxTxt(GetDlgItem(IDC_STATUS_TYPE), Rdb_Status);
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
#include "SettingsPage.h"
|
#include "SettingsPage.h"
|
||||||
|
|
||||||
COptionsGameBrowserPage::COptionsGameBrowserPage(HWND hParent, const RECT & rcDispay) :
|
COptionsGameBrowserPage::COptionsGameBrowserPage(HWND hParent, const RECT & rcDispay) :
|
||||||
m_OrderChanged(false),
|
m_OrderChanged(false),
|
||||||
m_OrderReset(false)
|
m_OrderReset(false)
|
||||||
{
|
{
|
||||||
if (!Create(hParent, rcDispay))
|
if (!Create(hParent, rcDispay))
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ m_OrderReset(false)
|
||||||
SetDlgItemTextW(m_hWnd, IDC_DOWN, wGS(RB_DOWN).c_str());
|
SetDlgItemTextW(m_hWnd, IDC_DOWN, wGS(RB_DOWN).c_str());
|
||||||
|
|
||||||
AddModCheckBox(GetDlgItem(IDC_USE_ROMBROWSER), RomBrowser_Enabled);
|
AddModCheckBox(GetDlgItem(IDC_USE_ROMBROWSER), RomBrowser_Enabled);
|
||||||
AddModCheckBox(GetDlgItem(IDC_RECURSION), RomBrowser_Recursive);
|
AddModCheckBox(GetDlgItem(IDC_RECURSION), RomList_GameDirRecursive);
|
||||||
|
|
||||||
m_Avaliable.Attach(GetDlgItem(IDC_AVALIABLE));
|
m_Avaliable.Attach(GetDlgItem(IDC_AVALIABLE));
|
||||||
m_Using.Attach(GetDlgItem(IDC_USING));
|
m_Using.Attach(GetDlgItem(IDC_USING));
|
||||||
|
@ -231,7 +231,7 @@ void COptionsGameBrowserPage::ApplySettings(bool UpdateScreen)
|
||||||
}
|
}
|
||||||
if (bColChanged)
|
if (bColChanged)
|
||||||
{
|
{
|
||||||
g_Settings->SaveBool(RomBrowser_ColoumnsChanged, !g_Settings->LoadBool(RomBrowser_ColoumnsChanged));
|
UISettingsSaveBool(RomBrowser_ColoumnsChanged, !UISettingsLoadBool(RomBrowser_ColoumnsChanged));
|
||||||
}
|
}
|
||||||
|
|
||||||
CSettingsPageImpl<COptionsGameBrowserPage>::ApplySettings(UpdateScreen);
|
CSettingsPageImpl<COptionsGameBrowserPage>::ApplySettings(UpdateScreen);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "SettingsPage.h"
|
#include "SettingsPage.h"
|
||||||
|
|
||||||
COptionsShortCutsPage::COptionsShortCutsPage(HWND hParent, const RECT & rcDispay) :
|
COptionsShortCutsPage::COptionsShortCutsPage(HWND hParent, const RECT & rcDispay) :
|
||||||
m_EnableReset(false)
|
m_EnableReset(false)
|
||||||
{
|
{
|
||||||
if (!Create(hParent, rcDispay))
|
if (!Create(hParent, rcDispay))
|
||||||
{
|
{
|
||||||
|
@ -356,7 +356,7 @@ void COptionsShortCutsPage::ShowPage()
|
||||||
void COptionsShortCutsPage::ApplySettings(bool /*UpdateScreen*/)
|
void COptionsShortCutsPage::ApplySettings(bool /*UpdateScreen*/)
|
||||||
{
|
{
|
||||||
m_ShortCuts.Save();
|
m_ShortCuts.Save();
|
||||||
g_Settings->SaveBool(Info_ShortCutsChanged, true);
|
UISettingsSaveBool(Info_ShortCutsChanged, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool COptionsShortCutsPage::EnableReset(void)
|
bool COptionsShortCutsPage::EnableReset(void)
|
||||||
|
|
|
@ -101,7 +101,8 @@ protected:
|
||||||
{
|
{
|
||||||
g_Settings->SaveString(Type, Value);
|
g_Settings->SaveString(Type, Value);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
DWORD dwValue = atoi(Value.c_str());
|
DWORD dwValue = atoi(Value.c_str());
|
||||||
g_Settings->SaveDword(Type, dwValue);
|
g_Settings->SaveDword(Type, dwValue);
|
||||||
}
|
}
|
||||||
|
@ -156,7 +157,8 @@ protected:
|
||||||
EditBox.SetWindowText(Value.c_str());
|
EditBox.SetWindowText(Value.c_str());
|
||||||
EditBox.SetReset(true);
|
EditBox.SetReset(true);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
DWORD Value = g_Settings->LoadDefaultDword(Type);
|
DWORD Value = g_Settings->LoadDefaultDword(Type);
|
||||||
EditBox.SetWindowText(stdstr_f("%d", Value).c_str());
|
EditBox.SetWindowText(stdstr_f("%d", Value).c_str());
|
||||||
EditBox.SetReset(true);
|
EditBox.SetReset(true);
|
||||||
|
@ -182,6 +184,11 @@ protected:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CModifiedEditBox * AddModTextBox(HWND hWnd, UISettingID Type, bool bString)
|
||||||
|
{
|
||||||
|
return AddModTextBox(hWnd, (SettingID)(FirstUISettings + Type), bString);
|
||||||
|
}
|
||||||
|
|
||||||
void AddModCheckBox(HWND hWnd, SettingID Type)
|
void AddModCheckBox(HWND hWnd, SettingID Type)
|
||||||
{
|
{
|
||||||
ButtonList::iterator item = m_ButtonList.find(Type);
|
ButtonList::iterator item = m_ButtonList.find(Type);
|
||||||
|
@ -198,6 +205,11 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AddModCheckBox(HWND hWnd, UISettingID Type)
|
||||||
|
{
|
||||||
|
AddModCheckBox(hWnd, (SettingID)(FirstUISettings + Type));
|
||||||
|
}
|
||||||
|
|
||||||
CModifiedComboBox * AddModComboBox(HWND hWnd, SettingID Type)
|
CModifiedComboBox * AddModComboBox(HWND hWnd, SettingID Type)
|
||||||
{
|
{
|
||||||
ComboBoxList::iterator item = m_ComboBoxList.find(Type);
|
ComboBoxList::iterator item = m_ComboBoxList.find(Type);
|
||||||
|
@ -234,6 +246,11 @@ protected:
|
||||||
return ComboBox;
|
return ComboBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CModifiedComboBoxTxt * AddModComboBoxTxt(HWND hWnd, UISettingID Type)
|
||||||
|
{
|
||||||
|
return AddModComboBoxTxt(hWnd, (SettingID)(FirstUISettings + Type));
|
||||||
|
}
|
||||||
|
|
||||||
void UpdateCheckBoxes(void)
|
void UpdateCheckBoxes(void)
|
||||||
{
|
{
|
||||||
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter++)
|
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter++)
|
||||||
|
@ -280,7 +297,8 @@ protected:
|
||||||
TextBox->SetChanged(g_Settings->LoadStringVal(iter->first, SelectedValue));
|
TextBox->SetChanged(g_Settings->LoadStringVal(iter->first, SelectedValue));
|
||||||
TextBox->SetWindowText(SelectedValue.c_str());
|
TextBox->SetWindowText(SelectedValue.c_str());
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
uint32_t SelectedValue;
|
uint32_t SelectedValue;
|
||||||
TextBox->SetChanged(g_Settings->LoadDword(iter->first, SelectedValue));
|
TextBox->SetChanged(g_Settings->LoadDword(iter->first, SelectedValue));
|
||||||
TextBox->SetWindowText(stdstr_f("%d", SelectedValue).c_str());
|
TextBox->SetWindowText(stdstr_f("%d", SelectedValue).c_str());
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
#include <Project64-core/Settings/SettingType/SettingsType-Application.h>
|
#include <Project64-core/Settings/SettingType/SettingsType-Application.h>
|
||||||
|
|
||||||
CSettingConfig::CSettingConfig(bool bJustGameSetting /* = false */) :
|
CSettingConfig::CSettingConfig(bool bJustGameSetting /* = false */) :
|
||||||
m_CurrentPage(NULL),
|
m_CurrentPage(NULL),
|
||||||
m_GeneralOptionsPage(NULL),
|
m_GeneralOptionsPage(NULL),
|
||||||
m_AdvancedPage(NULL),
|
m_AdvancedPage(NULL),
|
||||||
m_GameConfig(bJustGameSetting)
|
m_GameConfig(bJustGameSetting)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
|
||||||
::SetWindowTextW(m_hWnd, wGS(OPTIONS_TITLE).c_str());
|
::SetWindowTextW(m_hWnd, wGS(OPTIONS_TITLE).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_Settings->LoadBool(Setting_PluginPageFirst))
|
if (UISettingsLoadBool(Setting_PluginPageFirst))
|
||||||
{
|
{
|
||||||
SettingsSection = new CConfigSettingSection(wGS(TAB_PLUGIN).c_str());
|
SettingsSection = new CConfigSettingSection(wGS(TAB_PLUGIN).c_str());
|
||||||
SettingsSection->AddPage(new COptionPluginPage(this->m_hWnd, rcSettingInfo));
|
SettingsSection->AddPage(new COptionPluginPage(this->m_hWnd, rcSettingInfo));
|
||||||
|
@ -142,7 +142,7 @@ LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
|
||||||
SettingsSection->AddPage(new COptionsShortCutsPage(this->m_hWnd, rcSettingInfo));
|
SettingsSection->AddPage(new COptionsShortCutsPage(this->m_hWnd, rcSettingInfo));
|
||||||
m_Sections.push_back(SettingsSection);
|
m_Sections.push_back(SettingsSection);
|
||||||
|
|
||||||
if (!g_Settings->LoadBool(Setting_PluginPageFirst))
|
if (!UISettingsLoadBool(Setting_PluginPageFirst))
|
||||||
{
|
{
|
||||||
SettingsSection = new CConfigSettingSection(wGS(TAB_PLUGIN).c_str());
|
SettingsSection = new CConfigSettingSection(wGS(TAB_PLUGIN).c_str());
|
||||||
SettingsSection->AddPage(new COptionPluginPage(this->m_hWnd, rcSettingInfo));
|
SettingsSection->AddPage(new COptionPluginPage(this->m_hWnd, rcSettingInfo));
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include <Project64-core/AppInit.h>
|
#include <Project64-core/AppInit.h>
|
||||||
#include "Multilanguage\LanguageSelector.h"
|
#include "Multilanguage\LanguageSelector.h"
|
||||||
|
#include "Settings/UISettings.h"
|
||||||
|
|
||||||
int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpszArgs*/, int /*nWinMode*/)
|
int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpszArgs*/, int /*nWinMode*/)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +28,7 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (g_Settings->LoadDword(RomBrowser_Enabled))
|
if (UISettingsLoadBool(RomBrowser_Enabled))
|
||||||
{
|
{
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "Show Rom Browser");
|
WriteTrace(TraceUserInterface, TraceDebug, "Show Rom Browser");
|
||||||
//Display the rom browser
|
//Display the rom browser
|
||||||
|
|
Loading…
Reference in New Issue