mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 01:13:38 +00:00
- Ask the user when he closes the window only if the game is still running.
svn path=/trunk/; revision=28154
This commit is contained in:
parent
415aa5eb49
commit
2f2abb39d0
|
@ -121,6 +121,8 @@ bool CARDLIBPROC RowStackDropProc(CardRegion &stackobj, const CardStack &dragca
|
|||
}
|
||||
}
|
||||
|
||||
fGameStarted = true;
|
||||
|
||||
TRACE("EXIT RowStackDropProc(true)\n");
|
||||
return true;
|
||||
}
|
||||
|
@ -248,6 +250,7 @@ void CARDLIBPROC SuitStackAddProc(CardRegion &stackobj, const CardStack &added)
|
|||
{
|
||||
pSuitStack[i]->Flash(11, 100);
|
||||
}
|
||||
fGameStarted = false;
|
||||
}
|
||||
TRACE("EXIT SuitStackAddProc()\n");
|
||||
}
|
||||
|
@ -273,6 +276,8 @@ void CARDLIBPROC RowStackDblClickProc(CardRegion &stackobj, int iNumClicked)
|
|||
|
||||
if(pDest != 0)
|
||||
{
|
||||
fGameStarted = true;
|
||||
|
||||
//stackobj.MoveCards(pDest, 1, true);
|
||||
//use the SimulateDrag funcion, because we get the
|
||||
//AddProc callbacks called for us on the destination stacks...
|
||||
|
|
|
@ -415,6 +415,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
|||
static int nWidth, nHeight;
|
||||
int nStatusHeight = 0;//20;
|
||||
int parts[] = { 100, -1 };
|
||||
int ret;
|
||||
|
||||
MINMAXINFO *mmi;
|
||||
|
||||
|
@ -492,7 +493,20 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
|||
return 0;
|
||||
|
||||
case WM_CLOSE:
|
||||
DestroyWindow(hwnd);
|
||||
if (fGameStarted == false)
|
||||
{
|
||||
DestroyWindow(hwnd);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = MessageBox(hwnd, MsgQuit, szAppName, MB_OKCANCEL|MB_ICONQUESTION);
|
||||
if (ret == IDOK)
|
||||
{
|
||||
WinHelp(hwnd, szHelpPath, HELP_QUIT, 0);
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
extern CardWindow SolWnd;
|
||||
extern TCHAR szAppName[];
|
||||
extern bool fGameStarted;
|
||||
extern bool fGameStarted;
|
||||
|
||||
#define OPTION_THREE_CARDS 8
|
||||
#define CARDBACK_START IDC_CARDBACK1
|
||||
|
|
Loading…
Reference in a new issue