修复存在保留强化

This commit is contained in:
2026-04-26 23:52:46 +08:00
parent 38152d9b3d
commit 918e0b1e86
4 changed files with 26 additions and 10 deletions
+1
View File
@@ -269,6 +269,7 @@ void SetFeedbackMessage(const TCHAR* title, const TCHAR* detail, int ticks);
void OpenRulesScreen(); void OpenRulesScreen();
void OpenUpgradeMenu(); void OpenUpgradeMenu();
void ConfirmUpgradeSelection(); void ConfirmUpgradeSelection();
void ResetUpgradeUiState();
void HoldCurrentPiece(); void HoldCurrentPiece();
void UseScreenBomb(); void UseScreenBomb();
void UseBlackHole(); void UseBlackHole();
+1 -6
View File
@@ -855,12 +855,7 @@ void Restart()
ResetPlayerStats(classicStats, false); ResetPlayerStats(classicStats, false);
ResetPlayerStats(rogueStats, true); ResetPlayerStats(rogueStats, true);
upgradeUiState.selectedIndex = 0; ResetUpgradeUiState();
upgradeUiState.optionCount = 0;
upgradeUiState.pendingCount = 0;
upgradeUiState.totalChosenCount = 0;
upgradeUiState.picksRemaining = 0;
upgradeUiState.markedCount = 0;
feedbackState.visibleTicks = 0; feedbackState.visibleTicks = 0;
feedbackState.title[0] = _T('\0'); feedbackState.title[0] = _T('\0');
feedbackState.detail[0] = _T('\0'); feedbackState.detail[0] = _T('\0');
+1 -3
View File
@@ -528,9 +528,7 @@ void ReturnToMainMenu()
pendingLineClearEffectRowCount = 0; pendingLineClearEffectRowCount = 0;
pendingLineClearEffectLineCount = 0; pendingLineClearEffectLineCount = 0;
menuState.optionCount = 3; menuState.optionCount = 3;
upgradeUiState.pendingCount = 0; ResetUpgradeUiState();
upgradeUiState.picksRemaining = 0;
upgradeUiState.markedCount = 0;
if (menuState.selectedIndex < 0 || menuState.selectedIndex >= menuState.optionCount) if (menuState.selectedIndex < 0 || menuState.selectedIndex >= menuState.optionCount)
{ {
+23 -1
View File
@@ -2274,12 +2274,34 @@ void ResetPendingRogueVisualEvents()
pendingEvolutionImpactShockwave = false; pendingEvolutionImpactShockwave = false;
} }
/**
* @brief 清空升级选择界面的所有临时状态,避免跨局残留。
*/
void ResetUpgradeUiState()
{
upgradeUiState.selectedIndex = 0;
upgradeUiState.optionCount = 0;
upgradeUiState.pendingCount = 0;
upgradeUiState.totalChosenCount = 0;
upgradeUiState.picksRemaining = 0;
upgradeUiState.markedCount = 0;
for (int i = 0; i < 6; i++)
{
upgradeUiState.marked[i] = false;
upgradeUiState.options[i] = {};
}
}
/** /**
* @brief 在 Rogue 模式中打开升级强化选择界面。 * @brief 在 Rogue 模式中打开升级强化选择界面。
*/ */
void OpenUpgradeMenu() void OpenUpgradeMenu()
{ {
if (currentMode != MODE_ROGUE || upgradeUiState.pendingCount <= 0) if (currentMode != MODE_ROGUE ||
currentScreen != SCREEN_PLAYING ||
suspendFlag ||
gameOverFlag ||
upgradeUiState.pendingCount <= 0)
{ {
return; return;
} }