diff --git a/app/src/main/java/com/mintris/MainActivity.kt b/app/src/main/java/com/mintris/MainActivity.kt index c0a357c..0afc7bf 100644 --- a/app/src/main/java/com/mintris/MainActivity.kt +++ b/app/src/main/java/com/mintris/MainActivity.kt @@ -85,6 +85,7 @@ class MainActivity : AppCompatActivity(), private var lastRandomLevel = 0 // Track the level at which we last did a random change private var isRandomModeEnabled = false private var currentTheme = PlayerProgressionManager.THEME_CLASSIC + private val handler = Handler(Looper.getMainLooper()) // Activity result launcher for high score entry private lateinit var highScoreEntryLauncher: ActivityResultLauncher @@ -172,8 +173,13 @@ class MainActivity : AppCompatActivity(), binding.gameOverContainer.visibility = View.VISIBLE binding.gameControlsContainer.visibility = View.GONE + // Get all themes with "Theme" in their name + val themeRewards = progressionManager.getUnlockedThemes().filter { + it.contains("Theme", ignoreCase = true) + } + // Update theme selector if new themes were unlocked - if (newRewards.any { it.contains("Theme") }) { + if (themeRewards.isNotEmpty()) { updateThemeSelector() } } @@ -500,8 +506,13 @@ class MainActivity : AppCompatActivity(), binding.gameOverContainer.visibility = View.VISIBLE binding.gameControlsContainer.visibility = View.GONE + // Get all themes with "Theme" in their name + val themeRewards = progressionManager.getUnlockedThemes().filter { + it.contains("Theme", ignoreCase = true) + } + // Update theme selector if new themes were unlocked - if (newRewards.any { it.contains("Theme") }) { + if (themeRewards.isNotEmpty()) { updateThemeSelector() } }