Skip to content

Commit 540c382

Browse files
committed
Final changes for the coop tab updates.
1 parent f9c32ef commit 540c382

File tree

2 files changed

+17
-25
lines changed

2 files changed

+17
-25
lines changed

src/main/java/com/faforever/client/coop/CoopController.java

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ protected void onInitialize() {
130130

131131
missionComboBox.getSelectionModel().selectedItemProperty().when(showing).subscribe(this::setSelectedMission);
132132
missionComboBox.setButtonCell(missionListCell());
133-
missionComboBox.getSelectionModel().selectedItemProperty().when(showing).subscribe(this::setSelectedMission);
133+
missionComboBox.setCellFactory(param -> missionListCell());
134134

135135
mapPreviewImageView.imageProperty()
136136
.bind(missionComboBox.getSelectionModel().selectedItemProperty().map(CoopMission::mapFolderName)
@@ -209,12 +209,15 @@ protected void onInitialize() {
209209
.subscribe(coopScenarios -> {
210210
scenarioComboBox.getItems().addAll(coopScenarios);
211211

212-
// gamesTableController.initializeGameTable(filteredItems,
213-
// mapFolderName -> coopMissionFromFolderName(coopMaps,
214-
// mapFolderName),
215-
// false);
212+
List<CoopMission> coopMissions = new ArrayList<>();
213+
for (CoopScenario coopScenario : coopScenarios) {
214+
coopMissions.addAll(coopScenario.maps());
215+
}
216216

217-
gamesTableController.initializeGameTable(filteredItems);
217+
gamesTableController.initializeGameTable(filteredItems,
218+
mapFolderName -> coopMissionFromFolderName(coopMissions,
219+
mapFolderName),
220+
false);
218221
gamesTableController.getMapPreviewColumn().setVisible(false);
219222
gamesTableController.getRatingRangeColumn().setVisible(false);
220223

@@ -273,23 +276,7 @@ private ListCell<CoopScenario> scenarioListCell() {
273276
}
274277

275278
private ListCell<CoopMission> missionListCell() {
276-
return new StringListCell<>(fxApplicationThreadExecutor, CoopMission::ConcatName, mission -> {
277-
Label label = new Label();
278-
Region iconRegion = new Region();
279-
label.setGraphic(iconRegion);
280-
iconRegion.getStyleClass().add(ThemeService.CSS_CLASS_ICON);
281-
// switch (mission.category()) {
282-
// case AEON -> iconRegion.getStyleClass().add(ThemeService.AEON_STYLE_CLASS);
283-
// case CYBRAN -> iconRegion.getStyleClass().add(ThemeService.CYBRAN_STYLE_CLASS);
284-
// case UEF -> iconRegion.getStyleClass().add(ThemeService.UEF_STYLE_CLASS);
285-
// case FA -> iconRegion.getStyleClass().add(ThemeService.SERAPHIM_STYLE_CLASS);
286-
// case CUSTOM -> iconRegion.getStyleClass().add(ThemeService.MOD_ICON_STYLE_CLASS);
287-
// default -> {
288-
// return null;
289-
// }
290-
// }
291-
return label;
292-
}, Pos.CENTER_LEFT, "coop-mission");
279+
return new StringListCell<>(fxApplicationThreadExecutor, CoopMission::ConcatName, null, Pos.CENTER_LEFT, "coop-mission");
293280
}
294281

295282
private void loadLeaderboard() {
@@ -325,7 +312,8 @@ private void populateMissionList(CoopScenario scenario) {
325312
return;
326313
}
327314

328-
missionComboBox.setItems(FXCollections.observableList(scenario.maps()));
315+
missionComboBox.getItems().clear();
316+
missionComboBox.getItems().addAll(scenario.maps());
329317
missionComboBox.getSelectionModel().select(0);
330318
}
331319

@@ -351,7 +339,7 @@ private void desktopBrowserNavigateToURI(URI uri) {
351339
}
352340

353341
try {
354-
URI oURL = new URI("https://wiki.faforever.com/en/Development/Missions/Mission-Scripting");
342+
URI oURL = new URI(uri.toString());
355343
desktop.browse(oURL);
356344
} catch (URISyntaxException e) {
357345
log.warn("Could not open the mission scripting wiki.", e);

src/main/resources/theme/icons.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,4 +397,8 @@
397397

398398
.veto-palm {
399399
-fx-shape: "M 11.8068 1.8587 L 11.8067 2.4721 L 11.8058 9.8249 L 13.3528 8.6739 C 14.0631 8.1453 15.0404 8.1616 15.7326 8.7136 L 17.008 9.7306 L 17.4413 10.0761 L 17.1686 10.5586 L 14.2707 15.6856 L 13.7992 16.5846 C 12.4816 19.0965 9.7937 20.5816 6.9659 20.3599 C 3.245 20.0681 0.3874 16.9418 0.4302 13.2098 L 0.5402 3.6419 L 0.547 3.0517 L 1.1351 3.0017 L 3.831 2.7726 L 3.9211 0.9443 L 3.9506 0.347 L 4.5483 0.3267 L 7.8067 0.2164 L 8.4872 0.1933 L 8.4786 0.8742 L 8.4687 1.665 L 11.1944 1.8232 L 11.8068 1.8587 Z M 8.4523 2.9663 L 8.3681 9.6469 L 7.0682 9.6305 L 7.1609 2.2698 L 7.1702 1.5387 L 5.1901 1.6057 L 5.1017 3.3995 L 4.8833 9.6389 L 3.5841 9.5935 L 3.777 4.0819 L 1.8333 4.2471 L 1.7302 13.2247 C 1.6951 16.2725 4.0288 18.8256 7.0675 19.0639 C 9.3769 19.2449 11.572 18.0322 12.6479 15.9807 L 13.1242 15.0728 L 13.1289 15.0638 L 13.1339 15.0548 L 15.7641 10.4014 L 14.9221 9.73 C 14.6914 9.546 14.3656 9.5406 14.1289 9.7168 L 11.5437 11.6405 L 10.5057 11.1189 L 10.5067 3.0854 L 8.4523 2.9663 Z";
400+
}
401+
402+
.wrench-icon {
403+
-fx-shape: "M.102 2.223A3.004 3.004 0 0 0 3.78 5.897l6.341 6.252A3.003 3.003 0 0 0 13 16a3 3 0 1 0-.851-5.878L5.897 3.781A3.004 3.004 0 0 0 2.223.1l2.141 2.142L4 4l-1.757.364zm13.37 9.019.528.026.287.445.445.287.026.529L15 13l-.242.471-.026.529-.445.287-.287.445-.529.026L13 15l-.471-.242-.529-.026-.287-.445-.445-.287-.026-.529L11 13l.242-.471.026-.529.445-.287.287-.445.529-.026L13 11z"
400404
}

0 commit comments

Comments
 (0)