2 Commits
0.1.0 ... 0.1.1

Author SHA1 Message Date
485ce337c7 gitignore 2025-08-10 21:15:35 -06:00
7e4c63aa00 0.1.0 - Fixed starting health slider 2025-08-10 21:14:20 -06:00
4 changed files with 12 additions and 2 deletions

1
.gitignore vendored
View File

@@ -13,3 +13,4 @@
.externalNativeBuild .externalNativeBuild
.cxx .cxx
local.properties local.properties
release/

View File

@@ -14,7 +14,7 @@ android {
minSdk = 35 minSdk = 35
targetSdk = 35 targetSdk = 35
versionCode = 1 versionCode = 1
versionName = "0.1.0" versionName = "0.1.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
} }

Binary file not shown.

View File

@@ -30,6 +30,7 @@ import androidx.compose.ui.unit.dp
import com.atridad.magiccounter.ui.state.GameState import com.atridad.magiccounter.ui.state.GameState
import com.atridad.magiccounter.ui.state.PlayerState import com.atridad.magiccounter.ui.state.PlayerState
import com.atridad.magiccounter.ui.state.defaultPlayerName import com.atridad.magiccounter.ui.state.defaultPlayerName
import kotlin.math.roundToInt
@RequiresApi(Build.VERSION_CODES.VANILLA_ICE_CREAM) @RequiresApi(Build.VERSION_CODES.VANILLA_ICE_CREAM)
@Composable @Composable
@@ -58,7 +59,15 @@ fun SetupScreen(
verticalArrangement = Arrangement.spacedBy(16.dp) verticalArrangement = Arrangement.spacedBy(16.dp)
) { ) {
Text("Starting life: $startingLife") Text("Starting life: $startingLife")
Slider(value = startingLife.toFloat(), onValueChange = { startingLife = it.toInt() }, valueRange = 20f..60f, steps = 20) Slider(
value = startingLife.toFloat(),
onValueChange = {
val snapped = ((it / 5f).roundToInt() * 5).coerceIn(10, 40)
startingLife = snapped
},
valueRange = 10f..40f,
steps = 5
)
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceBetween, modifier = Modifier.fillMaxWidth()) { Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceBetween, modifier = Modifier.fillMaxWidth()) {
Text("Players: $playerCount") Text("Players: $playerCount")
} }