From 5af219449a1a9b04cc122dceb21c61a7e23d5626 Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Tue, 24 Mar 2020 15:27:12 +0100 Subject: Get joinability/startability info from server with reason --- .../org/luxons/sevenwonders/ui/components/gameBrowser/GameList.kt | 4 ++-- .../main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'sw-ui-kt/src') 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(props) large = true, intent = Intent.PRIMARY, icon = "play", - disabled = !currentGame.canBeStarted, + title = currentGame.startAction.tooltip, + disabled = !currentGame.startAction.canDo, onClick = { props.startGame() } ) { + "START" -- cgit