mirror of
https://github.com/reactos/reactos.git
synced 2025-06-27 01:40:35 +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,7 +493,20 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_CLOSE:
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
extern CardWindow SolWnd;
|
extern CardWindow SolWnd;
|
||||||
extern TCHAR szAppName[];
|
extern TCHAR szAppName[];
|
||||||
extern bool fGameStarted;
|
extern bool fGameStarted;
|
||||||
|
|
||||||
#define OPTION_THREE_CARDS 8
|
#define OPTION_THREE_CARDS 8
|
||||||
#define CARDBACK_START IDC_CARDBACK1
|
#define CARDBACK_START IDC_CARDBACK1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue