升级多选优化
This commit is contained in:
+26
-1
@@ -824,11 +824,36 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
InvalidateRect(hWnd, nullptr, FALSE);
|
||||
break;
|
||||
case VK_RETURN:
|
||||
case VK_SPACE:
|
||||
ConfirmUpgradeSelection();
|
||||
ResetGameTimer(hWnd);
|
||||
InvalidateRect(hWnd, nullptr, FALSE);
|
||||
break;
|
||||
case VK_SPACE:
|
||||
if (upgradeUiState.picksRemaining > 1 && upgradeUiState.optionCount > 0)
|
||||
{
|
||||
bool currentlyMarked = upgradeUiState.marked[upgradeUiState.selectedIndex];
|
||||
if (currentlyMarked)
|
||||
{
|
||||
upgradeUiState.marked[upgradeUiState.selectedIndex] = false;
|
||||
if (upgradeUiState.markedCount > 0)
|
||||
{
|
||||
upgradeUiState.markedCount--;
|
||||
}
|
||||
}
|
||||
else if (upgradeUiState.markedCount < upgradeUiState.picksRemaining)
|
||||
{
|
||||
upgradeUiState.marked[upgradeUiState.selectedIndex] = true;
|
||||
upgradeUiState.markedCount++;
|
||||
}
|
||||
InvalidateRect(hWnd, nullptr, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
ConfirmUpgradeSelection();
|
||||
ResetGameTimer(hWnd);
|
||||
InvalidateRect(hWnd, nullptr, FALSE);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user