Hide unfinished games from production builds
A release listed all eleven games with nine of them marked "Coming soon", so most of the menu was a dead end for anyone installing from the production channel. Production now lists only what can be played; dev builds still show everything, which is where seeing the roadmap is useful. The menu reads the installed APK's own version name, so this follows the build rather than the update channel selected for the future — a dev build shows the full list even if its owner has switched back to production for updates. CatalogTest pins both views, including that filtering never empties a category and strands its heading. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015qjfMiPUDshdKEUa6vxqzN
This commit is contained in:
@@ -154,6 +154,22 @@ object GameCatalog {
|
||||
|
||||
fun byId(id: String): GameDescriptor? = all.firstOrNull { it.id == id }
|
||||
|
||||
fun byCategory(category: GameCategory): List<GameDescriptor> =
|
||||
all.filter { it.category == category }
|
||||
/**
|
||||
* Games in a category.
|
||||
*
|
||||
* [includeComingSoon] is what separates the two update channels: a dev
|
||||
* build lists everything, including the games that are still only entries
|
||||
* in this table, so the roadmap is visible while working on it. A
|
||||
* production build lists only what can actually be played, so nobody
|
||||
* downloads a release and taps into a dead end.
|
||||
*/
|
||||
fun byCategory(
|
||||
category: GameCategory,
|
||||
includeComingSoon: Boolean = true,
|
||||
): List<GameDescriptor> = all.filter {
|
||||
it.category == category && (includeComingSoon || it.available)
|
||||
}
|
||||
|
||||
/** Everything currently playable, regardless of category. */
|
||||
val playable: List<GameDescriptor> get() = all.filter { it.available }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user