diff --git a/src/main/java/com/faforever/client/domain/api/MapVersion.java b/src/main/java/com/faforever/client/domain/api/MapVersion.java index 9a7cbbd7fb..44accde3eb 100644 --- a/src/main/java/com/faforever/client/domain/api/MapVersion.java +++ b/src/main/java/com/faforever/client/domain/api/MapVersion.java @@ -18,6 +18,7 @@ public record MapVersion( boolean ranked, URL downloadUrl, URL thumbnailUrlSmall, - URL thumbnailUrlLarge, Map map, + URL thumbnailUrlLarge, + Map map, OffsetDateTime createTime ) {} diff --git a/src/main/java/com/faforever/client/map/management/RemovableMapCellController.java b/src/main/java/com/faforever/client/map/management/RemovableMapCellController.java index 3ea549437c..04beffa69f 100644 --- a/src/main/java/com/faforever/client/map/management/RemovableMapCellController.java +++ b/src/main/java/com/faforever/client/map/management/RemovableMapCellController.java @@ -3,6 +3,7 @@ import com.faforever.client.domain.api.Map; import com.faforever.client.domain.api.MapVersion; import com.faforever.client.fx.NodeController; +import com.faforever.client.i18n.I18n; import com.faforever.client.map.MapService; import com.faforever.client.map.MapService.PreviewSize; import com.faforever.client.notification.NotificationService; @@ -14,6 +15,8 @@ import javafx.scene.layout.HBox; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; + +import org.apache.maven.artifact.versioning.ComparableVersion; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; @@ -28,7 +31,9 @@ public class RemovableMapCellController extends NodeController { public Button removeButton; public ImageView previewMapView; public Label mapNameLabel; + public Label mapVersionLabel; + private final I18n i18n; private final MapService mapService; private final NotificationService notificationService; @@ -39,6 +44,10 @@ protected void onInitialize() { previewMapView.imageProperty().bind(mapVersion.map(MapVersion::folderName) .map(folderName -> mapService.loadPreview(folderName, PreviewSize.SMALL))); mapNameLabel.textProperty().bind(mapVersion.map(MapVersion::map).map(Map::displayName)); + mapVersionLabel.textProperty() + .bind(mapVersion.map(MapVersion::version) + .map(ComparableVersion::getCanonical) + .map(version -> i18n.get("versionFormat", version))); removeButton.disableProperty().bind(mapVersion.map(mapService::isCustomMap).map(isCustom -> !isCustom)); removeButton.onMouseClickedProperty() .bind(mapVersion.map( diff --git a/src/main/resources/theme/vault/map/removable_map_cell.fxml b/src/main/resources/theme/vault/map/removable_map_cell.fxml index a9a61e718c..ebe257fd89 100644 --- a/src/main/resources/theme/vault/map/removable_map_cell.fxml +++ b/src/main/resources/theme/vault/map/removable_map_cell.fxml @@ -13,11 +13,12 @@ fx:controller="com.faforever.client.map.management.RemovableMapCellController"> -