Hide all game UI elements on progression and game over screens

This commit is contained in:
cmclark00 2025-03-31 17:20:16 -04:00
parent fad3e0863c
commit 3cd6080177

View file

@ -122,7 +122,14 @@ 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
// Keep all game UI elements hidden
binding.gameControlsContainer.visibility = View.GONE binding.gameControlsContainer.visibility = View.GONE
binding.holdPieceView.visibility = View.GONE
binding.nextPieceView.visibility = View.GONE
binding.pauseButton.visibility = View.GONE
binding.leftControlsPanel?.visibility = View.GONE
binding.rightControlsPanel?.visibility = View.GONE
} }
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -171,7 +178,14 @@ 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
// Keep all game UI elements hidden
binding.gameControlsContainer.visibility = View.GONE binding.gameControlsContainer.visibility = View.GONE
binding.holdPieceView.visibility = View.GONE
binding.nextPieceView.visibility = View.GONE
binding.pauseButton.visibility = View.GONE
binding.leftControlsPanel?.visibility = View.GONE
binding.rightControlsPanel?.visibility = View.GONE
// Get all themes with "Theme" in their name // Get all themes with "Theme" in their name
val themeRewards = progressionManager.getUnlockedThemes().filter { val themeRewards = progressionManager.getUnlockedThemes().filter {
@ -431,8 +445,15 @@ 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 // Hide all game UI elements
binding.gameControlsContainer.visibility = View.GONE binding.gameControlsContainer.visibility = View.GONE
binding.holdPieceView.visibility = View.GONE
binding.nextPieceView.visibility = View.GONE
binding.pauseButton.visibility = View.GONE
// Hide landscape panels if they exist
binding.leftControlsPanel?.visibility = View.GONE
binding.rightControlsPanel?.visibility = View.GONE
// Update session stats // Update session stats
statsManager.updateSessionStats( statsManager.updateSessionStats(
@ -504,7 +525,14 @@ 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
// Keep all game UI elements hidden
binding.gameControlsContainer.visibility = View.GONE binding.gameControlsContainer.visibility = View.GONE
binding.holdPieceView.visibility = View.GONE
binding.nextPieceView.visibility = View.GONE
binding.pauseButton.visibility = View.GONE
binding.leftControlsPanel?.visibility = View.GONE
binding.rightControlsPanel?.visibility = View.GONE
// Get all themes with "Theme" in their name // Get all themes with "Theme" in their name
val themeRewards = progressionManager.getUnlockedThemes().filter { val themeRewards = progressionManager.getUnlockedThemes().filter {
@ -1279,8 +1307,15 @@ class MainActivity : AppCompatActivity(),
// Apply theme before showing the screen // Apply theme before showing the screen
progressionScreen.applyTheme(currentTheme) progressionScreen.applyTheme(currentTheme)
// Hide game controls // Hide all game UI elements
binding.gameControlsContainer.visibility = View.GONE binding.gameControlsContainer.visibility = View.GONE
binding.holdPieceView.visibility = View.GONE
binding.nextPieceView.visibility = View.GONE
binding.pauseButton.visibility = View.GONE
// Hide landscape panels if they exist
binding.leftControlsPanel?.visibility = View.GONE
binding.rightControlsPanel?.visibility = View.GONE
// Show the progression screen // Show the progression screen
binding.gameOverContainer.visibility = View.GONE binding.gameOverContainer.visibility = View.GONE