Skip to content

Commit d539921

Browse files
committed
More clear UI and text
1 parent a402032 commit d539921

File tree

5 files changed

+52
-9
lines changed

5 files changed

+52
-9
lines changed

src/main/java/com/faforever/client/teammatchmaking/TeamMatchmakingMapTileController.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import javafx.scene.Cursor;
2323
import javafx.scene.control.Button;
2424
import javafx.scene.control.Label;
25+
import javafx.scene.effect.ColorAdjust;
2526
import javafx.scene.image.ImageView;
2627
import javafx.scene.layout.HBox;
2728
import javafx.scene.layout.Pane;
@@ -62,6 +63,9 @@ public class TeamMatchmakingMapTileController extends NodeController<Pane> {
6263
public Button vetoButton;
6364
public Label tokenCounterLabel;
6465
public Region vetoSvg;
66+
public Label bannedStripe;
67+
68+
private static final ColorAdjust GRAYSCALE_EFFECT = new ColorAdjust(0, -1, 0, 0);
6569

6670
protected final ObjectProperty<MapPoolAssignment> assignment = new SimpleObjectProperty<>();
6771
private ObservableValue<Integer> vetoTokensLeft;
@@ -202,12 +206,27 @@ protected void onShow() {
202206
}
203207

204208
private void updateBannedState() {
205-
if (!isMaxPerMapDynamic.get() && tokenCount.get() >= maxPerMap.get()) {
209+
int tokens = tokenCount.get();
210+
boolean isFullBan = !isMaxPerMapDynamic.get() && tokens >= maxPerMap.get();
211+
boolean hasTokens = tokens > 0;
212+
213+
if (isFullBan) {
206214
if (!root.getStyleClass().contains("tmm-maplist-tile_banned")) {
207215
root.getStyleClass().add("tmm-maplist-tile_banned");
208216
}
217+
thumbnailImageView.setEffect(GRAYSCALE_EFFECT);
209218
} else {
210219
root.getStyleClass().remove("tmm-maplist-tile_banned");
220+
thumbnailImageView.setEffect(null);
221+
}
222+
223+
bannedStripe.setVisible(hasTokens);
224+
if (hasTokens) {
225+
if (isFullBan) {
226+
bannedStripe.setText(i18n.get("map.banned_thinSpaced"));
227+
} else {
228+
bannedStripe.setText(i18n.get("map.partiallyBanned"));
229+
}
211230
}
212231
}
213232

src/main/resources/i18n/messages.properties

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ mod.description = Description
317317
mod.comments = Comments
318318
map.author = Author
319319
map.unknownAuthor = Unknown author
320+
map.banned_thinSpaced = B A N N E D
321+
map.partiallyBanned = partially banned
320322
map.name = Name
321323
map.description = Description
322324
map.size = Size
@@ -1000,10 +1002,10 @@ teammatchmaking.match.starting = Match launching...
10001002
teammatchmaking.match.cancelled = Match cancelled\!
10011003
teammatchmaking.notification.matchFound.title = Match found
10021004
teammatchmaking.notification.matchFound.message = A match was found and will launch soon
1003-
teammatchmaking.vetoes.forced.title = Veto settings were changed
1004-
teammatchmaking.vetoes.forced.message = Matchmaker team changed the veto settings. Your vetoes were adjusted.\nReset them again if needed.
1005-
teammatchmaking.applyVetoes = Apply vetoes
1006-
teammatchmaking.noVetoes = No vetoes
1005+
teammatchmaking.vetoes.forced.title = Map bans settings were changed
1006+
teammatchmaking.vetoes.forced.message = Matchmaker team changed the settings. Your map bans were adjusted.\nReset them again if needed.
1007+
teammatchmaking.applyVetoes = Apply map bans
1008+
teammatchmaking.noVetoes = No map bans
10071009
teammatchmaking.bracket.anyRating = Any rating
10081010
teammatchmaking.notification.inviteAlreadyInQueue.title = You are already searching for a game
10091011
teammatchmaking.notification.inviteAlreadyInQueue.message = Please stop searching for a game before inviting a player

src/main/resources/i18n/messages_ru.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ mod.description = Описание
334334
mod.comments = Комментарии
335335
map.author = Автор
336336
map.unknownAuthor = Неизвестный автор
337+
map.banned_thinSpaced = З А Б А Н Е Н О
338+
map.partiallyBanned = частично\nзабанено
337339
map.name = Имя
338340
map.description = Описание
339341
map.size = Размер
@@ -1051,6 +1053,10 @@ teammatchmaking.match.starting = Игра запускается...
10511053
teammatchmaking.match.cancelled = Игра закрыта\!
10521054
teammatchmaking.notification.matchFound.title = Игра найдена
10531055
teammatchmaking.notification.matchFound.message = Игра найдена и скоро будет запущена
1056+
teammatchmaking.vetoes.forced.title = Настройки банов карт были изменены
1057+
teammatchmaking.vetoes.forced.message = Команда матчмейкинга изменила настройки. Ваши баны карт были изменены.\nУстановите их заново, если требуется.
1058+
teammatchmaking.applyVetoes = Забанить карты
1059+
teammatchmaking.noVetoes = Нет банов карт
10541060
# Fuzzy
10551061
teammatchmaking.notification.inviteAlreadyInQueue.title = Вы уже находитесь в очереди
10561062
# Fuzzy

src/main/resources/theme/play/teammatchmaking/matchmaking_map_tile.fxml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,5 @@
6262
</VBox>
6363
</GridPane>
6464
</StackPane>
65+
<Label fx:id="bannedStripe" visible="false" styleClass="tmm-maplist-tile-banned-stripe"/>
6566
</StackPane>

src/main/resources/theme/style.css

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,18 +1221,33 @@
12211221
-fx-background-color: linear-gradient(to bottom right, #ffffff4d, #ffffff1d);
12221222
}
12231223

1224-
.tmm-maplist-tile_banned .tmm-maplist-tile-top-line {
1224+
.tmm-maplist-tile_banned .tmm-maplist-tile-top-line,
1225+
.tmm-maplist-tile_banned .tmm-maplist-tile-bottom-line {
12251226
-fx-background-color: #00000026;
12261227
}
12271228

12281229
.tmm-maplist-tile_banned .tmm-maplist-tile-thumbnail,
1229-
.tmm-maplist-tile_banned .tmm-maplist-tile-top-line-author,
12301230
.tmm-maplist-tile_banned .image-dimmer-light,
1231-
.tmm-maplist-tile_banned .image-dimmer-light-reversed,
1232-
.tmm-maplist-tile_banned .tmm-maplist-tile-bottom-line {
1231+
.tmm-maplist-tile_banned .image-dimmer-light-reversed {
12331232
-fx-opacity: 0.3;
12341233
}
12351234

1235+
.tmm-maplist-tile_banned .tmm-maplist-tile-top-line-author Label,
1236+
.tmm-maplist-tile_banned .tmm-maplist-tile-bottom-line Label{
1237+
-fx-text-fill: #888;
1238+
}
1239+
1240+
.tmm-maplist-tile-banned-stripe {
1241+
-fx-background-color: rgba(21, 21, 21, 0.8);
1242+
-fx-font-size: 20px;
1243+
-fx-font-weight: 600;
1244+
-fx-text-alignment: center;
1245+
-fx-alignment: center;
1246+
-fx-pref-width: 180;
1247+
-fx-line-spacing: -10;
1248+
-fx-min-height: 40;
1249+
}
1250+
12361251
/***************** Faction buttons *****************/
12371252

12381253
.toggle-button.aeon:selected {

0 commit comments

Comments
 (0)