优化帮助页逻辑

This commit is contained in:
2026-04-28 21:11:50 +08:00
parent 45d9e988df
commit 2f435f5ca6
2 changed files with 33 additions and 47 deletions
+21 -12
View File
@@ -981,7 +981,20 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if (currentScreen != SCREEN_MENU && IsPointInRect(GetBackButtonRect(hWnd), mouseX, mouseY))
{
ReturnToMainMenu();
if (currentScreen == SCREEN_PLAYING && IsRogueSkillDemoMode())
{
OpenSkillDemoScreen();
}
else if (currentScreen == SCREEN_RULES && helpState.currentPage != 0)
{
helpState.selectedIndex = (helpState.currentPage == 5) ? 3 : helpState.currentPage - 1;
helpState.currentPage = 0;
helpScrollOffset = 0;
}
else
{
ReturnToMainMenu();
}
InvalidateRect(hWnd, nullptr, FALSE);
break;
}
@@ -1076,15 +1089,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
else if (IsPointInRect(GetHelpBackHintRect(hWnd), mouseX, mouseY))
{
if (helpState.currentPage == 4)
{
ReturnToMainMenu();
}
else
{
helpState.currentPage = 0;
helpScrollOffset = 0;
}
helpState.selectedIndex = (helpState.currentPage == 5) ? 3 : helpState.currentPage - 1;
helpState.currentPage = 0;
helpScrollOffset = 0;
InvalidateRect(hWnd, nullptr, FALSE);
}
else if (helpState.currentPage == 4 && IsPointInRect(GetCreditArrowRect(hWnd, -1), mouseX, mouseY))
@@ -1387,7 +1394,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
else if (helpState.currentPage == 4)
{
ReturnToMainMenu();
helpState.currentPage = 0;
helpState.selectedIndex = 3;
helpScrollOffset = 0;
}
else if (helpState.currentPage == 5)
{
@@ -1535,7 +1544,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
else if (wParam == VK_ESCAPE || wParam == VK_BACK || wParam == 'M')
{
ReturnToMainMenu();
OpenSkillDemoScreen();
InvalidateRect(hWnd, nullptr, FALSE);
break;
}