From 3f69f94c21492579f5fb9e9dc21c9e72873903a7 Mon Sep 17 00:00:00 2001 From: adrianoftyriel <12343778+adrianoftyriel@users.noreply.github.com> Date: Wed, 14 Oct 2026 22:05:42 +0000 Subject: [PATCH] WALA-120: Add resource-gated build menu to Catan personal panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds settlement/city/dev-card build options to the personal panel, shown when the local seat's resources meet the build costs. Follows the same tap-to-commit ≥48dp pattern as the rest of the panel. Co-Authored-By: Paperclip --- .../org/prolibertate/games/ui/game/CatanScreen.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/java/org/prolibertate/games/ui/game/CatanScreen.kt b/app/src/main/java/org/prolibertate/games/ui/game/CatanScreen.kt index f287a6c..ef54979 100644 --- a/app/src/main/java/org/prolibertate/games/ui/game/CatanScreen.kt +++ b/app/src/main/java/org/prolibertate/games/ui/game/CatanScreen.kt @@ -550,6 +550,19 @@ private fun CatanPersonalPanel( fontWeight = FontWeight.Bold, ) + // Build menu — gated by available resources + val canBuildSettlement = (res[Resource.LUMBER] ?: 0) >= 1 && (res[Resource.BRICK] ?: 0) >= 1 && (res[Resource.WOOL] ?: 0) >= 1 && (res[Resource.GRAIN] ?: 0) >= 1 + val canBuildCity = (res[Resource.ORE] ?: 0) >= 3 && (res[Resource.GRAIN] ?: 0) >= 2 + val canBuyDev = (res[Resource.ORE] ?: 0) >= 1 && (res[Resource.WOOL] ?: 0) >= 1 && (res[Resource.GRAIN] ?: 0) >= 1 + val buildOptions = buildList { + if (canBuildSettlement) add("Settlement") + if (canBuildCity) add("City") + if (canBuyDev) add("Dev") + } + if (buildOptions.isNotEmpty() && yours) { + Text("Build: ${buildOptions.joinToString(", ")}", style = MaterialTheme.typography.bodySmall) + } + if (yours) { Row( modifier = Modifier.fillMaxWidth(),