summaryrefslogtreecommitdiff
path: root/sw-ui-kt/src/main/kotlin/org/luxons
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@booking.com>2020-03-24 15:27:12 +0100
committerJoffrey Bion <joffrey.bion@booking.com>2020-03-24 15:27:29 +0100
commit5af219449a1a9b04cc122dceb21c61a7e23d5626 (patch)
tree165baa4c3cc558ca00af296b2f516109afa4e53d /sw-ui-kt/src/main/kotlin/org/luxons
parentRename connect to connectStateAndDispatch to avoid conflicts (diff)
downloadseven-wonders-5af219449a1a9b04cc122dceb21c61a7e23d5626.tar.gz
seven-wonders-5af219449a1a9b04cc122dceb21c61a7e23d5626.tar.bz2
seven-wonders-5af219449a1a9b04cc122dceb21c61a7e23d5626.zip
Get joinability/startability info from server with reason
Diffstat (limited to 'sw-ui-kt/src/main/kotlin/org/luxons')
-rw-r--r--sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameList.kt4
-rw-r--r--sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt3
2 files changed, 4 insertions, 3 deletions
diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameList.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameList.kt
index 375ac96f..10d5c868 100644
--- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameList.kt
+++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameList.kt
@@ -108,9 +108,9 @@ private fun RBuilder.playerCount(nPlayers: Int) {
private fun RBuilder.joinButton(lobby: LobbyDTO, joinGame: (Long) -> Unit) {
bpButton(
minimal = true,
- title = "Join Game",
+ title = lobby.joinAction.tooltip,
icon = "arrow-right",
- disabled = lobby.state != State.LOBBY,
+ disabled = !lobby.joinAction.canDo,
onClick = { joinGame(lobby.id) }
)
}
diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt
index 62f1c524..668a41c2 100644
--- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt
+++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt
@@ -40,7 +40,8 @@ class LobbyPresenter(props: LobbyProps) : RComponent<LobbyProps, RState>(props)
large = true,
intent = Intent.PRIMARY,
icon = "play",
- disabled = !currentGame.canBeStarted,
+ title = currentGame.startAction.tooltip,
+ disabled = !currentGame.startAction.canDo,
onClick = { props.startGame() }
) {
+ "START"
bgstack15