Win32 - Memwatch - added Cancel option to Save Changes? message box
This commit is contained in:
parent
1974deb21d
commit
f26e54b4a9
|
@ -1,4 +1,5 @@
|
||||||
---version 2.0.4 yet to be released---
|
---version 2.0.4 yet to be released---
|
||||||
|
25-feb-2009 - adelikat - 2in32 - Memwatch - added cancel to save changes? message box
|
||||||
22-feb-2009 - adelikat - win32 - Lua - made speedmode("turbo") turn on turbo (which employs frameskipping) rather than max speed
|
22-feb-2009 - adelikat - win32 - Lua - made speedmode("turbo") turn on turbo (which employs frameskipping) rather than max speed
|
||||||
22-feb-2009 - adelikat - Increased lua gui.text height (and DrawTextTransWH() height)
|
22-feb-2009 - adelikat - Increased lua gui.text height (and DrawTextTransWH() height)
|
||||||
21-feb-2009 - adelikat - win32 - Lua - Added -lua commandline argment, loads a lua script on startup
|
21-feb-2009 - adelikat - win32 - Lua - Added -lua commandline argment, loads a lua script on startup
|
||||||
|
|
|
@ -379,34 +379,37 @@ void DoFCEUExit()
|
||||||
if(exiting) //Eh, oops. I'll need to try to fix this later.
|
if(exiting) //Eh, oops. I'll need to try to fix this later.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(goptions & GOO_CONFIRMEXIT)
|
if (CloseMemoryWatch()) //If user was asked to save changes in the memory watch dialog, and chose cancel, don't close FCEUX!
|
||||||
{
|
{
|
||||||
//Wolfenstein 3D had cute exit messages.
|
if(goptions & GOO_CONFIRMEXIT)
|
||||||
const char * const emsg[7]={"Are you sure you want to leave? I'll become lonely!",
|
|
||||||
"A strange game. The only winning move is not to play. How about a nice game of chess?",
|
|
||||||
"If you exit, I'll... EAT YOUR MOUSE.",
|
|
||||||
"You can never really exit, you know.",
|
|
||||||
"E.X.I.T?",
|
|
||||||
"I'm sorry, you missed your exit. There is another one in 19 miles",
|
|
||||||
"Silly Exit Message goes here"
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
if(IDYES != MessageBox(hAppWnd, emsg[rand() & 6], "Exit FCE Ultra?", MB_ICONQUESTION | MB_YESNO) )
|
|
||||||
{
|
{
|
||||||
return;
|
//Wolfenstein 3D had cute exit messages.
|
||||||
|
const char * const emsg[7]={"Are you sure you want to leave? I'll become lonely!",
|
||||||
|
"A strange game. The only winning move is not to play. How about a nice game of chess?",
|
||||||
|
"If you exit, I'll... EAT YOUR MOUSE.",
|
||||||
|
"You can never really exit, you know.",
|
||||||
|
"E.X.I.T?",
|
||||||
|
"I'm sorry, you missed your exit. There is another one in 19 miles",
|
||||||
|
"Silly Exit Message goes here"
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
if(IDYES != MessageBox(hAppWnd, emsg[rand() & 6], "Exit FCE Ultra?", MB_ICONQUESTION | MB_YESNO) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
CloseMemoryWatch();
|
|
||||||
|
|
||||||
KillDebugger(); //mbg merge 7/19/06 added
|
|
||||||
|
|
||||||
FCEUI_StopMovie();
|
KillDebugger(); //mbg merge 7/19/06 added
|
||||||
FCEUD_AviStop();
|
|
||||||
|
|
||||||
exiting = 1;
|
FCEUI_StopMovie();
|
||||||
closeGame = true;//mbg 6/30/06 - for housekeeping purposes we need to exit after the emulation cycle finishes
|
FCEUD_AviStop();
|
||||||
|
|
||||||
|
exiting = 1;
|
||||||
|
closeGame = true;//mbg 6/30/06 - for housekeeping purposes we need to exit after the emulation cycle finishes
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FCEUD_OnCloseGame()
|
void FCEUD_OnCloseGame()
|
||||||
|
|
|
@ -383,8 +383,8 @@ bool iftextchanged()
|
||||||
}
|
}
|
||||||
for(;j<LABELLENGTH;j++)
|
for(;j<LABELLENGTH;j++)
|
||||||
{
|
{
|
||||||
if(labels[i][j] != NULL)
|
if(labels[i][j] != NULL)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -631,24 +631,34 @@ void OpenMemwatchRecentFile(int memwRFileNumber)
|
||||||
//TODO: Remove this file from the recent list
|
//TODO: Remove this file from the recent list
|
||||||
}
|
}
|
||||||
|
|
||||||
void CloseMemoryWatch()
|
bool CloseMemoryWatch()
|
||||||
{
|
{
|
||||||
|
int result = 0; //Flag for asking to save changes
|
||||||
|
|
||||||
if(hwndMemWatch)
|
if(hwndMemWatch)
|
||||||
{
|
{
|
||||||
SaveStrings();
|
SaveStrings();
|
||||||
|
|
||||||
if (fileChanged==true)
|
if (fileChanged)
|
||||||
{
|
{
|
||||||
if(MessageBox(hwndMemWatch, "Save Changes?", "Memory Watch Settings", MB_YESNO)==IDYES)
|
result = MessageBox(hwndMemWatch, "Save Changes?", "Memory Watch Settings", MB_YESNOCANCEL);
|
||||||
|
if (result == IDYES)
|
||||||
{
|
{
|
||||||
SaveMemWatch();
|
SaveMemWatch();
|
||||||
|
DestroyWindow(hwndMemWatch);
|
||||||
|
hwndMemWatch=0;
|
||||||
|
return true; //true = User did not choose to cancel operation
|
||||||
}
|
}
|
||||||
|
else if (result == IDNO)
|
||||||
|
{
|
||||||
|
DestroyWindow(hwndMemWatch);
|
||||||
|
hwndMemWatch=0;
|
||||||
|
return true; //Don't run SaveMemWatch, but return true
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false; //User requested cancel, so abort the attempt to close
|
||||||
}
|
}
|
||||||
|
|
||||||
DestroyWindow(hwndMemWatch);
|
|
||||||
hwndMemWatch=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//New File
|
//New File
|
||||||
|
@ -764,8 +774,8 @@ static BOOL CALLBACK MemWatchCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
|
||||||
switch(LOWORD(wParam))
|
switch(LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case MEMW_FILE_CLOSE:
|
case MEMW_FILE_CLOSE:
|
||||||
CloseMemoryWatch();
|
if (CloseMemoryWatch())
|
||||||
RamChangeInitialize = false;
|
RamChangeInitialize = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACCEL_CTRL_O:
|
case ACCEL_CTRL_O:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
void UpdateMemWatch();
|
void UpdateMemWatch();
|
||||||
void CreateMemWatch();
|
void CreateMemWatch();
|
||||||
void CloseMemoryWatch();
|
bool CloseMemoryWatch();
|
||||||
void AddMemWatch(char memaddress[32]);
|
void AddMemWatch(char memaddress[32]);
|
||||||
void RamChange();
|
void RamChange();
|
||||||
extern char * MemWatchDir;
|
extern char * MemWatchDir;
|
||||||
|
|
Loading…
Reference in New Issue