[Project64] Add GameLoaded setting

This commit is contained in:
zilmar 2015-11-12 22:27:19 +11:00
parent 51c89388c7
commit 73d7263de0
5 changed files with 463 additions and 417 deletions
Source/Project64

View File

@ -181,6 +181,7 @@ bool CN64System::RunFileImage(const char * FileLoc)
return false;
}
WriteTrace(TraceDebug, __FUNCTION__ ": Mark Rom as loading");
g_Settings->SaveString(Game_File, "");
//Mark the rom as loading
g_Settings->SaveBool(GameRunning_LoadingInProgress, true);
@ -201,10 +202,7 @@ bool CN64System::RunFileImage(const char * FileLoc)
{
g_System->RefreshGameSettings();
WriteTrace(TraceDebug, __FUNCTION__ ": Add Recent Rom");
Notify().AddRecentRom(FileLoc);
Notify().SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str());
g_Settings->SaveString(Game_File, FileLoc);
g_Settings->SaveBool(GameRunning_LoadingInProgress, false);
if (g_Settings->LoadDword(Setting_AutoStart) != 0)
@ -275,9 +273,6 @@ void CN64System::StartEmulation2(bool NewThread)
if (NewThread)
{
WriteTrace(TraceDebug, __FUNCTION__ ": Starting");
Notify().HideRomBrowser();
if (bHaveDebugger())
{
g_LogOptions.GenerateLog = g_Settings->LoadBool(Debugger_GenerateDebugLog);
@ -1805,7 +1800,7 @@ bool CN64System::LoadState(LPCSTR FileName)
SetActiveSystem(true);
SyncCPU(m_SyncCPU);
}
}
}
WriteTrace(TraceDebug, __FUNCTION__ ": 13");
std::wstring LoadMsg = g_Lang->GetString(MSG_LOADED_STATE);
g_Notify->DisplayMessage(5, stdstr_f("%s %s", LoadMsg.c_str(), CPath(FileNameStr).GetNameExtension()).ToUTF16().c_str());

File diff suppressed because it is too large Load Diff

View File

@ -105,6 +105,7 @@ enum SettingID
//Individual Game Settings
Game_IniKey,
Game_File,
Game_GameName,
Game_GoodName,
Game_TempLoaded,

View File

@ -50,6 +50,7 @@ m_ResetInfo(NULL)
g_Settings->RegisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
g_Settings->RegisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
g_Settings->RegisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged);
g_Settings->RegisterChangeCB(Game_File, this, (CSettings::SettingChangedFunc)GameLoaded);
}
//if this fails then it has already been created
@ -66,6 +67,7 @@ CMainGui::~CMainGui(void)
g_Settings->UnregisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
g_Settings->UnregisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
g_Settings->UnregisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged);
g_Settings->UnregisterChangeCB(Game_File, this, (CSettings::SettingChangedFunc)GameLoaded);
}
if (m_hMainWindow)
{
@ -118,6 +120,19 @@ void CMainGui::LoadingInProgressChanged(CMainGui * Gui)
Gui->RefreshMenu();
}
void CMainGui::GameLoaded(CMainGui * Gui)
{
stdstr FileLoc = g_Settings->LoadStringVal(Game_File);
if (FileLoc.length() > 0)
{
WriteTrace(TraceDebug, __FUNCTION__ ": Add Recent Rom");
Notify().AddRecentRom(FileLoc.c_str());
Notify().SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str());
Gui->HideRomList();
}
}
void RomBowserColoumnsChanged(CMainGui * Gui)
{
Gui->ResetRomBrowserColomuns();

View File

@ -112,6 +112,7 @@ private:
friend void RomBowserColoumnsChanged(CMainGui * Gui);
friend void RomBrowserRecursiveChanged(CMainGui * Gui);
static void LoadingInProgressChanged(CMainGui * Gui);
static void GameLoaded(CMainGui * Gui);
CBaseMenu * m_Menu;