summaryrefslogtreecommitdiff
path: root/sw-ui/src
diff options
context:
space:
mode:
Diffstat (limited to 'sw-ui/src')
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameScene.kt66
1 files changed, 33 insertions, 33 deletions
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameScene.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameScene.kt
index db9c1e4c..06cb5b00 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameScene.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameScene.kt
@@ -57,39 +57,6 @@ private class GameScene(props: GameSceneProps) : RComponent<GameSceneProps, RSta
}
}
- private fun RBuilder.sayReadyButton(): ReactElement {
- val isReady = props.playerIsReady
- val intent = if (isReady) Intent.SUCCESS else Intent.PRIMARY
- return styledDiv {
- css {
- position = Position.absolute
- bottom = 6.rem
- left = 50.pct
- transform { translate(tx = (-50).pct) }
- }
- bpButtonGroup {
- bpButton(
- large = true,
- disabled = isReady,
- intent = intent,
- icon = if (isReady) "tick-circle" else "play",
- onClick = { props.sayReady() }
- ) {
- +"READY"
- }
- // not really a button, but nice for style
- bpButton(
- large = true,
- icon = "people",
- disabled = isReady,
- intent = intent
- ) {
- +"${props.players.count { it.isReady }}/${props.players.size}"
- }
- }
- }
- }
-
private fun RBuilder.turnInfoScene(turnInfo: PlayerTurnInfo) {
val board = turnInfo.table.boards[turnInfo.playerIndex]
div {
@@ -189,6 +156,39 @@ private class GameScene(props: GameSceneProps) : RComponent<GameSceneProps, RSta
}
}
}
+
+ private fun RBuilder.sayReadyButton(): ReactElement {
+ val isReady = props.playerIsReady
+ val intent = if (isReady) Intent.SUCCESS else Intent.PRIMARY
+ return styledDiv {
+ css {
+ position = Position.absolute
+ bottom = 6.rem
+ left = 50.pct
+ transform { translate(tx = (-50).pct) }
+ }
+ bpButtonGroup {
+ bpButton(
+ large = true,
+ disabled = isReady,
+ intent = intent,
+ icon = if (isReady) "tick-circle" else "play",
+ onClick = { props.sayReady() }
+ ) {
+ +"READY"
+ }
+ // not really a button, but nice for style
+ bpButton(
+ large = true,
+ icon = "people",
+ disabled = isReady,
+ intent = intent
+ ) {
+ +"${props.players.count { it.isReady }}/${props.players.size}"
+ }
+ }
+ }
+ }
}
fun RBuilder.gameScene() = gameScene {}
bgstack15