Hide game controls on progression screen and game over

This commit is contained in:
cmclark00 2025-03-31 17:12:22 -04:00
parent b60c106a08
commit 1f400238e5

View file

@ -121,6 +121,7 @@ class MainActivity : AppCompatActivity(),
// No matter what the result is, we just show the game over container // No matter what the result is, we just show the game over container
progressionScreen.visibility = View.GONE progressionScreen.visibility = View.GONE
binding.gameOverContainer.visibility = View.VISIBLE binding.gameOverContainer.visibility = View.VISIBLE
binding.gameControlsContainer.visibility = View.GONE
} }
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -169,6 +170,12 @@ class MainActivity : AppCompatActivity(),
progressionScreen.onContinue = { progressionScreen.onContinue = {
progressionScreen.visibility = View.GONE progressionScreen.visibility = View.GONE
binding.gameOverContainer.visibility = View.VISIBLE binding.gameOverContainer.visibility = View.VISIBLE
binding.gameControlsContainer.visibility = View.GONE
// Update theme selector if new themes were unlocked
if (newRewards.any { it.contains("Theme") }) {
updateThemeSelector()
}
} }
// Load and apply theme preference // Load and apply theme preference
@ -418,6 +425,9 @@ class MainActivity : AppCompatActivity(),
Log.d("MainActivity", "Showing game over screen with score: $score") Log.d("MainActivity", "Showing game over screen with score: $score")
val gameTime = System.currentTimeMillis() - gameStartTime val gameTime = System.currentTimeMillis() - gameStartTime
// Hide game controls
binding.gameControlsContainer.visibility = View.GONE
// Update session stats // Update session stats
statsManager.updateSessionStats( statsManager.updateSessionStats(
score = score, score = score,
@ -488,6 +498,7 @@ class MainActivity : AppCompatActivity(),
// Just show game over screen normally // Just show game over screen normally
progressionScreen.visibility = View.GONE progressionScreen.visibility = View.GONE
binding.gameOverContainer.visibility = View.VISIBLE binding.gameOverContainer.visibility = View.VISIBLE
binding.gameControlsContainer.visibility = View.GONE
// Update theme selector if new themes were unlocked // Update theme selector if new themes were unlocked
if (newRewards.any { it.contains("Theme") }) { if (newRewards.any { it.contains("Theme") }) {
@ -1257,6 +1268,9 @@ class MainActivity : AppCompatActivity(),
// Apply theme before showing the screen // Apply theme before showing the screen
progressionScreen.applyTheme(currentTheme) progressionScreen.applyTheme(currentTheme)
// Hide game controls
binding.gameControlsContainer.visibility = View.GONE
// Show the progression screen // Show the progression screen
binding.gameOverContainer.visibility = View.GONE binding.gameOverContainer.visibility = View.GONE
progressionScreen.visibility = View.VISIBLE progressionScreen.visibility = View.VISIBLE