接入Rogue真实强化效果并降低升级门槛便于测试
This commit is contained in:
+10
-1
@@ -14,6 +14,12 @@ BOOL InitInstance(HINSTANCE, int);
|
||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
static void ResetGameTimer(HWND hWnd)
|
||||
{
|
||||
KillTimer(hWnd, GAME_TIMER_ID);
|
||||
SetTimer(hWnd, GAME_TIMER_ID, currentFallInterval > 0 ? currentFallInterval : GAME_TIMER_INTERVAL, nullptr);
|
||||
}
|
||||
|
||||
int APIENTRY _tWinMain(HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPTSTR lpCmdLine,
|
||||
@@ -118,7 +124,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
case WM_CREATE:
|
||||
srand((unsigned int)time(nullptr));
|
||||
ReturnToMainMenu();
|
||||
SetTimer(hWnd, GAME_TIMER_ID, GAME_TIMER_INTERVAL, nullptr);
|
||||
ResetGameTimer(hWnd);
|
||||
InvalidateRect(hWnd, nullptr, FALSE);
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
@@ -198,6 +204,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
case VK_RETURN:
|
||||
case VK_SPACE:
|
||||
StartGameWithMode(menuState.selectedIndex);
|
||||
ResetGameTimer(hWnd);
|
||||
InvalidateRect(hWnd, nullptr, FALSE);
|
||||
break;
|
||||
case VK_ESCAPE:
|
||||
@@ -234,6 +241,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
case VK_RETURN:
|
||||
case VK_SPACE:
|
||||
ConfirmUpgradeSelection();
|
||||
ResetGameTimer(hWnd);
|
||||
InvalidateRect(hWnd, nullptr, FALSE);
|
||||
break;
|
||||
default:
|
||||
@@ -252,6 +260,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
if (wParam == 'R')
|
||||
{
|
||||
StartGameWithMode(currentMode);
|
||||
ResetGameTimer(hWnd);
|
||||
InvalidateRect(hWnd, nullptr, FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user