Search in sources :

Example 1 with GameTooltipController

use of com.faforever.client.game.GameTooltipController in project downlords-faf-client by FAForever.

the class GameStatusTooltipController method setGameInfoBean.

// TODO use or remove
public void setGameInfoBean(Game game) {
    gameTypeLabel.textProperty().bind(Bindings.createStringBinding(() -> {
        FeaturedMod gameType = modService.getFeaturedMod(game.getFeaturedMod()).get();
        String fullName = gameType != null ? gameType.getDisplayName() : null;
        return StringUtils.defaultString(fullName);
    }, game.featuredModProperty()));
    gameTitleLabel.textProperty().bind(game.titleProperty());
    hostLabel.textProperty().bind(game.hostProperty());
    gameMapLabel.textProperty().bind(game.mapFolderNameProperty());
    numberOfPlayersLabel.textProperty().bind(Bindings.createStringBinding(() -> i18n.get("game.players.format", game.getNumPlayers(), game.getMaxPlayers()), game.numPlayersProperty()));
    modsLabel.textProperty().bind(Bindings.createStringBinding(() -> Joiner.on(i18n.get("textSeparator")).join(game.getSimMods().values()), game.mapFolderNameProperty()));
    lockIconLabel.visibleProperty().bind(game.passwordProtectedProperty());
    // TODO display "unknown map" image first since loading may take a while
    mapImageView.imageProperty().bind(Bindings.createObjectBinding(() -> mapService.loadPreview(game.getMapFolderName(), PreviewSize.SMALL), game.mapFolderNameProperty()));
    GameTooltipController gameTooltipController = uiService.loadFxml("theme/play/game_tooltip.fxml");
    gameTooltipController.setGameInfoBean(game);
    gameStatusTooltipRoot.getChildren().add(gameTooltipController.getRoot());
    gameStatusTooltipRoot.getChildren();
}
Also used : FeaturedMod(com.faforever.client.mod.FeaturedMod) GameTooltipController(com.faforever.client.game.GameTooltipController)

Aggregations

GameTooltipController (com.faforever.client.game.GameTooltipController)1 FeaturedMod (com.faforever.client.mod.FeaturedMod)1