Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
485ce337c7
|
|||
|
7e4c63aa00
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,3 +13,4 @@
|
|||||||
.externalNativeBuild
|
.externalNativeBuild
|
||||||
.cxx
|
.cxx
|
||||||
local.properties
|
local.properties
|
||||||
|
release/
|
||||||
@@ -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.
@@ -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")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user