From 23ba9bbb8bb36aa3e0db8f0063a90d2ce87022b5 Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Sun, 24 May 2020 12:04:38 +0200 Subject: Add hand rotation irection indicator --- img-archive/hand-cards3.png | Bin 0 -> 4024 bytes .../sevenwonders/ui/components/game/GameScene.kt | 36 ++++++++++++++++++++- sw-ui/src/main/resources/images/hand-cards5.png | Bin 0 -> 5519 bytes 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 img-archive/hand-cards3.png create mode 100644 sw-ui/src/main/resources/images/hand-cards5.png diff --git a/img-archive/hand-cards3.png b/img-archive/hand-cards3.png new file mode 100644 index 00000000..5c9d72af Binary files /dev/null and b/img-archive/hand-cards3.png differ 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 46d6b4c1..2422e66f 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 @@ -10,6 +10,7 @@ import org.luxons.sevenwonders.model.PlayerMove import org.luxons.sevenwonders.model.PlayerTurnInfo import org.luxons.sevenwonders.model.api.PlayerDTO import org.luxons.sevenwonders.model.cards.HandCard +import org.luxons.sevenwonders.model.cards.HandRotationDirection import org.luxons.sevenwonders.ui.components.GlobalStyles import org.luxons.sevenwonders.ui.redux.* import react.* @@ -59,6 +60,7 @@ private class GameScene(props: GameSceneProps) : RComponent.actionInfo(message: String) { + private fun RBuilder.actionInfo(message: String) { styledDiv { css { classes.add("bp3-dark") @@ -96,6 +98,38 @@ private class GameScene(props: GameSceneProps) : RComponent { + css { left = sideDistance } + bpIcon("arrow-left", size = 25) + handCardsImg() + } + HandRotationDirection.RIGHT -> { + css { right = sideDistance } + handCardsImg() + bpIcon("arrow-right", size = 25) + } + } + } + } + + private fun RBuilder.handCardsImg() { + styledImg(src = "images/hand-cards5.png") { + css { + width = 4.rem + } + } + } + private fun RBuilder.preparedMove(card: HandCard, move: PlayerMove) { bpOverlay(isOpen = true, onClose = props.unprepareMove) { styledDiv { diff --git a/sw-ui/src/main/resources/images/hand-cards5.png b/sw-ui/src/main/resources/images/hand-cards5.png new file mode 100644 index 00000000..1e2199cd Binary files /dev/null and b/sw-ui/src/main/resources/images/hand-cards5.png differ -- cgit