Change some error message boxes to warnings

This commit is contained in:
oddMLan 2019-03-17 18:04:05 -07:00
parent ff81419af6
commit 01d4ed0bc3
16 changed files with 50 additions and 31 deletions

View File

@ -523,7 +523,7 @@ enum LanguageStringID
MSG_UNHANDLED_OP = 2022,
MSG_NONMAPPED_SPACE = 2023,
MSG_SAVE_STATE_HEADER = 2024,
MSG_MSGBOX_TITLE = 2025,
MSG_MSGBOX_ERROR_TITLE = 2025,
MSG_PIF2_ERROR = 2026,
MSG_PIF2_TITLE = 2027,
MSG_PLUGIN_CHANGE = 2028,
@ -558,6 +558,7 @@ enum LanguageStringID
MSG_SET_HLE_AUD_MSG = 2057,
MSG_FAIL_IMAGE_IPL = 2058,
MSG_IPL_REQUIRED = 2059,
MSG_MSGBOX_WARNING_TITLE = 2060,
/*********************************************************************************
* Android *

View File

@ -489,7 +489,8 @@ void CLanguage::LoadDefaultStrings(void)
DEF_STR(MSG_UNHANDLED_OP, "Unhandled R4300i opcode at");
DEF_STR(MSG_NONMAPPED_SPACE, "Executing from non-mapped space.\n\nVerify ROM and its settings.");
DEF_STR(MSG_SAVE_STATE_HEADER, "This saved state does not appear to match the running ROM.\n\nStates must be saved & loaded between 100% identical ROMs.\nIn particular, the REGION and VERSION need to be the same.\nLoading this state is likely to cause the game and/or emulator to crash.\n\nAre you sure you want to continue loading?");
DEF_STR(MSG_MSGBOX_TITLE, "Error");
DEF_STR(MSG_MSGBOX_WARNING_TITLE, "Warning");
DEF_STR(MSG_MSGBOX_ERROR_TITLE, "Error");
DEF_STR(MSG_PIF2_ERROR, "Copyright sequence not found in LUT. Game will no longer function.");
DEF_STR(MSG_PIF2_TITLE, "Copy Protection Failure");
DEF_STR(MSG_PLUGIN_CHANGE, "Changing a plugin requires Project64 to reset a running ROM.\nIf you don't want to lose your place, answer No and save the current state first.\n\nChange plugins and reset ROM now?");

View File

@ -3006,7 +3006,7 @@ void R4300iOp::UnknownOpcode()
strcat(Message, "\n\nDo you wish to enter the debugger ?");
response = MessageBox(NULL, Message, GS(MSG_MSGBOX_TITLE), MB_YESNO | MB_ICONERROR);
response = MessageBox(NULL, Message, GS(MSG_MSGBOX_ERROR_TITLE), MB_YESNO | MB_ICONERROR);
if (response == IDYES)
{
Enter_R4300i_Commands_Window();

View File

@ -17,6 +17,9 @@ public:
virtual void FatalError(LanguageStringID StringID) const = 0;
//User Feedback
virtual void DisplayWarning(const char * Message) const = 0;
virtual void DisplayWarning(LanguageStringID StringID) const = 0;
virtual void DisplayMessage(int DisplayTime, const char * Message) const = 0;
virtual void DisplayMessage(int DisplayTime, LanguageStringID StringID) const = 0;
virtual void DisplayMessage2(const char * Message) const = 0;

View File

@ -301,7 +301,7 @@ int CALLBACK CCheatsUI::CheatAddProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
}
if (_stricmp(CheatName.c_str(), NewCheatName.c_str()) == 0)
{
g_Notify->DisplayError(GS(MSG_CHEAT_NAME_IN_USE));
g_Notify->DisplayWarning(GS(MSG_CHEAT_NAME_IN_USE));
SetFocus(GetDlgItem(hDlg, IDC_CODE_NAME));
return true;
}

View File

@ -112,7 +112,7 @@ LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/,
GetDlgItemText(IDC_FILENAME, FileName, sizeof(FileName));
if (strlen(FileName) == 0)
{
g_Notify->DisplayError("Please Choose target file");
g_Notify->DisplayWarning("Please Choose target file");
::SetFocus(GetDlgItem(IDC_FILENAME));
return false;
}

View File

@ -577,7 +577,7 @@ LRESULT CEditEnhancement::OnOkCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl
}
if (_stricmp(Name.c_str(), NewName.c_str()) == 0)
{
g_Notify->DisplayError(GS(MSG_CHEAT_NAME_IN_USE));
g_Notify->DisplayWarning(GS(MSG_CHEAT_NAME_IN_USE));
GetDlgItem(IDC_CODE_NAME).SetFocus();
return true;
}

View File

@ -128,7 +128,7 @@ void CMainMenu::OnOpenRom(HWND hWnd)
// Open Disk
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(File.c_str()))
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayError(MSG_IPL_REQUIRED); }
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayWarning(MSG_IPL_REQUIRED); }
CPath FileNameIPL;
const char * Filter = "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";
if (FileNameIPL.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
@ -553,7 +553,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(FileName.c_str()))
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayError(MSG_IPL_REQUIRED); }
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayWarning(MSG_IPL_REQUIRED); }
CPath FileNameIPL;
const char * Filter = "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";
if (FileNameIPL.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))

View File

@ -991,7 +991,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(_this->CurrentedSelectedRom()))
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayError(MSG_IPL_REQUIRED); }
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayWarning(MSG_IPL_REQUIRED); }
CPath FileName;
const char * Filter = "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";
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
@ -1011,7 +1011,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskComboImage(_this->CurrentedSelectedRom(), FileName))
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayError(MSG_IPL_REQUIRED); }
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayWarning(MSG_IPL_REQUIRED); }
CPath FileNameIPL;
const char * Filter = "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";
if (FileNameIPL.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
@ -1179,7 +1179,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
// Open Disk
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(filename))
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayError(MSG_IPL_REQUIRED); }
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayWarning(MSG_IPL_REQUIRED); }
CPath FileName;
const char * Filter = "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";
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))

View File

@ -49,6 +49,21 @@ void CNotificationImp::WindowMode(void) const
InsideFunc = false;
}
void CNotificationImp::DisplayWarning(const char * Message) const
{
HWND Parent = NULL;
if (m_hWnd)
{
Parent = reinterpret_cast<HWND>(m_hWnd->GetWindowHandle());
}
MessageBoxW(Parent, stdstr(Message).ToUTF16().c_str(), wGS(MSG_MSGBOX_WARNING_TITLE).c_str(), MB_OK | MB_ICONWARNING | MB_SETFOREGROUND);
}
void CNotificationImp::DisplayWarning(LanguageStringID StringID) const
{
DisplayWarning(g_Lang->GetString(StringID).c_str());
}
void CNotificationImp::DisplayError(LanguageStringID StringID) const
{
DisplayError(g_Lang->GetString(StringID).c_str());
@ -64,7 +79,7 @@ void CNotificationImp::DisplayError(const char * Message) const
{
Parent = reinterpret_cast<HWND>(m_hWnd->GetWindowHandle());
}
MessageBoxW(Parent, stdstr(Message).ToUTF16().c_str(), wGS(MSG_MSGBOX_TITLE).c_str(), MB_OK | MB_ICONERROR | MB_SETFOREGROUND);
MessageBoxW(Parent, stdstr(Message).ToUTF16().c_str(), wGS(MSG_MSGBOX_ERROR_TITLE).c_str(), MB_OK | MB_ICONERROR | MB_SETFOREGROUND);
}
void CNotificationImp::DisplayMessage(int DisplayTime, LanguageStringID StringID) const
@ -125,7 +140,7 @@ bool CNotificationImp::AskYesNoQuestion(const char * Question) const
{
Parent = reinterpret_cast<HWND>(m_hWnd->GetWindowHandle());
}
int result = MessageBoxW(Parent, stdstr(Question).ToUTF16().c_str(), wGS(MSG_MSGBOX_TITLE).c_str(), MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2 | MB_SETFOREGROUND);
int result = MessageBoxW(Parent, stdstr(Question).ToUTF16().c_str(), wGS(MSG_MSGBOX_WARNING_TITLE).c_str(), MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2 | MB_SETFOREGROUND);
return result == IDYES;
}

View File

@ -35,6 +35,9 @@ public:
virtual void FatalError(LanguageStringID StringID) const;
//User Feedback
virtual void DisplayWarning(const char * Message) const;
virtual void DisplayWarning(LanguageStringID StringID) const;
virtual void DisplayMessage(int DisplayTime, const char * Message) const;
virtual void DisplayMessage(int DisplayTime, LanguageStringID StringID) const;

View File

@ -813,7 +813,7 @@ void CRomBrowser::RomList_OpenRom(uint32_t /*pnmh*/)
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(pRomInfo->szFullFileName))
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayError(MSG_IPL_REQUIRED); }
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayWarning(MSG_IPL_REQUIRED); }
CPath FileName;
const char * Filter = "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";
if (FileName.SelectFile(m_MainWindow, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))

View File

@ -312,8 +312,7 @@ void CGamePluginPage::HleGfxChanged(UINT /*Code*/, int id, HWND /*ctl*/)
}
if ((Button->GetCheck() & BST_CHECKED) == 0)
{
int res = MessageBoxW(m_hWnd, wGS(MSG_SET_LLE_GFX_MSG).c_str(), wGS(MSG_SET_LLE_GFX_TITLE).c_str(), MB_YESNO | MB_ICONWARNING);
if (res != IDYES)
if (!g_Notify->AskYesNoQuestion(g_Lang->GetString(MSG_SET_LLE_GFX_MSG).c_str()))
{
Button->SetCheck(BST_CHECKED);
return;
@ -335,9 +334,8 @@ void CGamePluginPage::HleAudioChanged(UINT /*Code*/, int id, HWND /*ctl*/)
continue;
}
if ((Button->GetCheck() & BST_CHECKED) != 0)
{
int res = MessageBoxW(m_hWnd, wGS(MSG_SET_HLE_AUD_MSG).c_str(), wGS(MSG_SET_HLE_AUD_TITLE).c_str(), MB_ICONWARNING | MB_YESNO);
if (res != IDYES)
{
if (!g_Notify->AskYesNoQuestion(g_Lang->GetString(MSG_SET_HLE_AUD_MSG).c_str()))
{
Button->SetCheck(BST_UNCHECKED);
return;

View File

@ -137,13 +137,13 @@ void COptionsShortCutsPage::OnRemoveClicked(UINT /*Code*/, int /*id*/, HWND /*ct
HTREEITEM hSelectedItem = m_MenuItems.GetSelectedItem();
if (hSelectedItem == NULL)
{
g_Notify->DisplayError(GS(MSG_NO_SEL_SHORTCUT));
g_Notify->DisplayWarning(GS(MSG_NO_SEL_SHORTCUT));
return;
}
HTREEITEM hParent = m_MenuItems.GetParentItem(hSelectedItem);
if (hParent == NULL)
{
g_Notify->DisplayError(GS(MSG_NO_SEL_SHORTCUT));
g_Notify->DisplayWarning(GS(MSG_NO_SEL_SHORTCUT));
return;
}
@ -153,7 +153,7 @@ void COptionsShortCutsPage::OnRemoveClicked(UINT /*Code*/, int /*id*/, HWND /*ct
int index = m_CurrentKeys.GetCurSel();
if (index < 0)
{
g_Notify->DisplayError(GS(MSG_NO_SEL_SHORTCUT));
g_Notify->DisplayWarning(GS(MSG_NO_SEL_SHORTCUT));
return;
}
ShortCut->RemoveItem((CMenuShortCutKey *)m_CurrentKeys.GetItemData(index));
@ -176,7 +176,7 @@ void COptionsShortCutsPage::OnAssignClicked(UINT /*Code*/, int /*id*/, HWND /*ct
int index = m_VirtualKeyList.GetCurSel();
if (index < 0)
{
g_Notify->DisplayError(GS(MSG_NO_SHORTCUT_SEL));
g_Notify->DisplayWarning(GS(MSG_NO_SHORTCUT_SEL));
return;
}
@ -190,13 +190,13 @@ void COptionsShortCutsPage::OnAssignClicked(UINT /*Code*/, int /*id*/, HWND /*ct
HTREEITEM hSelectedItem = m_MenuItems.GetSelectedItem();
if (hSelectedItem == NULL)
{
g_Notify->DisplayError(GS(MSG_NO_MENUITEM_SEL));
g_Notify->DisplayWarning(GS(MSG_NO_MENUITEM_SEL));
return;
}
HTREEITEM hParent = m_MenuItems.GetParentItem(hSelectedItem);
if (hParent == NULL)
{
g_Notify->DisplayError(GS(MSG_NO_MENUITEM_SEL));
g_Notify->DisplayWarning(GS(MSG_NO_MENUITEM_SEL));
return;
}
@ -204,7 +204,7 @@ void COptionsShortCutsPage::OnAssignClicked(UINT /*Code*/, int /*id*/, HWND /*ct
LanguageStringID strid = m_ShortCuts.GetMenuItemName(key, bCtrl, bAlt, bShift, RunningState);
if (strid != EMPTY_STRING)
{
g_Notify->DisplayError(GS(MSG_MENUITEM_ASSIGNED));
g_Notify->DisplayWarning(GS(MSG_MENUITEM_ASSIGNED));
return;
}

View File

@ -296,8 +296,7 @@ void COptionPluginPage::HleGfxChanged(UINT /*Code*/, int id, HWND /*ctl*/)
}
if ((Button->GetCheck() & BST_CHECKED) == 0)
{
int res = MessageBoxW(m_hWnd, wGS(MSG_SET_LLE_GFX_MSG).c_str(), wGS(MSG_SET_LLE_GFX_TITLE).c_str(), MB_YESNO | MB_ICONWARNING);
if (res != IDYES)
if (!g_Notify->AskYesNoQuestion(g_Lang->GetString(MSG_SET_LLE_GFX_MSG).c_str()))
{
Button->SetCheck(BST_CHECKED);
return;
@ -320,8 +319,7 @@ void COptionPluginPage::HleAudioChanged(UINT /*Code*/, int id, HWND /*ctl*/)
}
if ((Button->GetCheck() & BST_CHECKED) != 0)
{
int res = MessageBoxW(m_hWnd, wGS(MSG_SET_HLE_AUD_MSG).c_str(), wGS(MSG_SET_HLE_AUD_TITLE).c_str(), MB_ICONWARNING | MB_YESNO);
if (res != IDYES)
if (!g_Notify->AskYesNoQuestion(g_Lang->GetString(MSG_SET_HLE_AUD_MSG).c_str()))
{
Button->SetCheck(BST_UNCHECKED);
return;

View File

@ -39,7 +39,7 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
//Ext is *.ndd, so it should be a disk file.
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(g_Settings->LoadStringVal(Cmd_RomFile).c_str()))
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayError(MSG_IPL_REQUIRED); }
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists()) { g_Notify->DisplayWarning(MSG_IPL_REQUIRED); }
CPath FileNameIPL;
const char * Filter = "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";
if (FileNameIPL.SelectFile(NULL, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))