📄 addition3.cpp
字号:
/****************************************************************************/
//
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Some other Functions III ~~~~~~~~~~~~~~~~~~~~~
// addition3.cpp
//
//***************************************************************************/
// Include
#include "ExCaro.h"
////////////////////////////////////////////////////////////////////
// Check if Computer first
void CheckComFirst()
{
if(!play.fWin && player[play.iTurn].fPlay == COMPLAY)
{
if ( play.iChecked == 0 )
{
ec.pMouse.x = setting.iBlock / 2;
ec.pMouse.y = setting.iBlock / 2;
ec.pOld.x = ec.pMouse.x;
ec.pOld.y = ec.pMouse.y;
play.fComPlay = TRUE;
play.pComPlay.x = ec.pMouse.x;
play.pComPlay.y = ec.pMouse.y;
InvalidateRect(WndPlay.hWnd , NULL, FALSE );
}
else
{
CheckAll(2);
}
}
}
////////////////////////////////////////////////////////////////////
// Clear Playing -> Reset to start
void NewGame()
{
int x, y;
for(x=0; x < setting.iBlock; x++)
for(y=0; y < setting.iBlock; y++)
{
posBlock(x,y) = -1;
}
play.iTurn = 0;
play.fWin = FALSE;
play.iTimeLimit = setting.iTime * CTIME - 1;
play.iTimePlay = 0;
play.fWarning = 0;
play.iChecked = 0;
play.iUndo = 0;
play.iMaxUndo = 0;
play.fKey = 0;
play.fComPlay = 0;
GetCursorPos(&ec.pMouse);
ScreenToClient(WndPlay.hWnd, &ec.pMouse );
ec.pMouse.x = ec.pMouse.x / XBLOCK ;
ec.pMouse.y = ec.pMouse.y / XBLOCK ;
ec.pOld.x = ec.pMouse.x;
ec.pOld.y = ec.pMouse.y;
// Set Scroll to midle
siV.nMax = setting.iBlock;
siV.nPage = WndChild.yClient /XBLOCK;
siH.nMax = setting.iBlock;
siH.nPage = WndChild.xClient/XBLOCK;
play.siVPlay = max(0, ( siV.nMax - siV.nPage ) /2);
play.siHPlay = max(0, ( siH.nMax - siH.nPage ) /2);
SendMessage(WndChild.hWnd, WM_SIZE, 0, 0 );
ReDrawBanner();
// End of Set Scroll to midle
InvalidateRect(WndPlay.hWnd, NULL, FALSE );
UpdateWindow(WndPlay.hWnd);
ReDrawPlayerBar();
CheckComFirst();
}
// Translate into Vietnamese
void ChangeLang()
{
char szBuffer[50];
int iTurn;
HMENU hMenu;
int i;
if(setting.iLang == LANG_VI)
{
SetWindowText( GetDlgItem(DlgSetting.hWnd,IDC_GRP_PSETTING ) , "Thi誸 l藀 cho ng
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -