mirror of
https://github.com/reactos/reactos.git
synced 2025-06-27 11:49:43 +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
3 changed files with 21 additions and 2 deletions
|
@ -121,6 +121,8 @@ bool CARDLIBPROC RowStackDropProc(CardRegion &stackobj, const CardStack &dragca
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fGameStarted = true;
|
||||||
|
|
||||||
TRACE("EXIT RowStackDropProc(true)\n");
|
TRACE("EXIT RowStackDropProc(true)\n");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -248,6 +250,7 @@ void CARDLIBPROC SuitStackAddProc(CardRegion &stackobj, const CardStack &added)
|
||||||
{
|
{
|
||||||
pSuitStack[i]->Flash(11, 100);
|
pSuitStack[i]->Flash(11, 100);
|
||||||
}
|
}
|
||||||
|
fGameStarted = false;
|
||||||
}
|
}
|
||||||
TRACE("EXIT SuitStackAddProc()\n");
|
TRACE("EXIT SuitStackAddProc()\n");
|
||||||
}
|
}
|
||||||
|
@ -273,6 +276,8 @@ void CARDLIBPROC RowStackDblClickProc(CardRegion &stackobj, int iNumClicked)
|
||||||
|
|
||||||
if(pDest != 0)
|
if(pDest != 0)
|
||||||
{
|
{
|
||||||
|
fGameStarted = true;
|
||||||
|
|
||||||
//stackobj.MoveCards(pDest, 1, true);
|
//stackobj.MoveCards(pDest, 1, true);
|
||||||
//use the SimulateDrag funcion, because we get the
|
//use the SimulateDrag funcion, because we get the
|
||||||
//AddProc callbacks called for us on the destination stacks...
|
//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;
|
static int nWidth, nHeight;
|
||||||
int nStatusHeight = 0;//20;
|
int nStatusHeight = 0;//20;
|
||||||
int parts[] = { 100, -1 };
|
int parts[] = { 100, -1 };
|
||||||
|
int ret;
|
||||||
|
|
||||||
MINMAXINFO *mmi;
|
MINMAXINFO *mmi;
|
||||||
|
|
||||||
|
@ -492,9 +493,22 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
|
if (fGameStarted == false)
|
||||||
|
{
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
return 0;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
return DefWindowProc (hwnd, iMsg, wParam, lParam);
|
return DefWindowProc (hwnd, iMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue