Skip to content

Commit

Permalink
Feature/mods more info moved 2 top (#3241)
Browse files Browse the repository at this point in the history
* Moved more detail to the top header, removed progress bar, as it was not used + some translation modified, but especially turkish and asian version should be checked.

* Removing progress-bar emmbers
  • Loading branch information
sulikdan authored Sep 11, 2024
1 parent d331a72 commit 3e65c84
Show file tree
Hide file tree
Showing 17 changed files with 152 additions and 128 deletions.
30 changes: 13 additions & 17 deletions src/main/java/com/faforever/client/mod/ModDetailController.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressBar;
import javafx.scene.control.ScrollPane;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCode;
Expand All @@ -43,6 +42,9 @@
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.stream.Collectors;

@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@Slf4j
Expand All @@ -68,23 +70,21 @@ public class ModDetailController extends NodeController<Node> {
public Label versionLabel;
public Label dependenciesTitle;
public VBox dependenciesContainer;
public Label progressLabel;
public ScrollPane scrollPane;
public Button uninstallButton;
public Button installButton;
public ImageView thumbnailImageView;
public Label nameLabel;
public Label idLabel;
public Label uploaderLabel;
public ProgressBar progressBar;
public Label modDescriptionLabel;
public Node modDetailRoot;
public ReviewsController<ModVersionReview> reviewsController;
public Label authorLabel;

@Override
protected void onInitialize() {
JavaFxUtil.bindManagedToVisible(uninstallButton, installButton, progressBar, progressLabel, getRoot());
JavaFxUtil.bindManagedToVisible(uninstallButton, installButton, getRoot());
JavaFxUtil.fixScrollSpeed(scrollPane);

contextMenuBuilder.addCopyLabelContextMenu(nameLabel, authorLabel, idLabel, uploaderLabel, versionLabel);
Expand All @@ -110,13 +110,16 @@ private void bindProperties() {
.flatMap(imageViewHelper::createPlaceholderImageOnErrorObservable)
.when(showing));
nameLabel.textProperty().bind(modObservable.map(Mod::displayName).when(showing));
authorLabel.textProperty().bind(modObservable.map(Mod::author)
.map(author -> i18n.get("modVault.details.author", author))
.when(showing));
authorLabel.textProperty()
.bind(modObservable.map(Mod::author)
.map(author -> Arrays.stream(author.split(","))
.map(String::trim)
.collect(Collectors.joining("\n")))
.when(showing));
uploaderLabel.textProperty().bind(modObservable.map(Mod::uploader).flatMap(PlayerInfo::usernameProperty)
.map(author -> i18n.get("modVault.details.uploader", author))
.map(author -> author)
.when(showing));
idLabel.textProperty().bind(modVersion.map(ModVersion::id).map(id -> i18n.get("mod.idNumber", id)).when(showing));
idLabel.textProperty().bind(modVersion.map(ModVersion::id).map(Object::toString).when(showing));

updatedLabel.textProperty().bind(modVersion.map(ModVersion::createTime).map(timeService::asDate).when(showing));

Expand All @@ -131,9 +134,6 @@ private void bindProperties() {
BooleanExpression installed = modService.isInstalledBinding(modVersion);
installButton.visibleProperty().bind(installed.not().when(showing));
uninstallButton.visibleProperty().bind(installed.when(showing));
progressBar.visibleProperty()
.bind(uninstallButton.visibleProperty().not().and(installButton.visibleProperty().not()).when(showing));
progressLabel.visibleProperty().bind(progressBar.visibleProperty().when(showing));
}

public void onCloseButtonClicked() {
Expand Down Expand Up @@ -216,8 +216,7 @@ void onSendReview(ModVersionReview review) {

public void onInstallButtonClicked() {
ModVersion modVersion = this.modVersion.get();
modService.downloadIfNecessary(modVersion, progressBar.progressProperty(),
progressLabel.textProperty()).subscribe(null, throwable -> {
modService.downloadIfNecessary(modVersion, null, null).subscribe(null, throwable -> {
log.error("Could not install mod", throwable);
notificationService.addImmediateErrorNotification(throwable, "modVault.installationFailed",
modVersion.mod().displayName(),
Expand All @@ -226,9 +225,6 @@ public void onInstallButtonClicked() {
}

public void onUninstallButtonClicked() {
progressBar.progressProperty().unbind();
progressBar.setProgress(-1);

ModVersion modVersion = this.modVersion.get();
modService.uninstallMod(modVersion)
.exceptionally(throwable -> {
Expand Down
9 changes: 5 additions & 4 deletions src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -758,8 +758,9 @@ settings.account.goWebsite = For account related activities you need to visit ou
settings.account.goWebsiteButton = Visit the FAForever Website
map.versionId = Map version ID
vault.replays.ownReplays = Your replays
modVault.details.uploader = Uploaded by\: {0}
modVault.details.author = Authored by\: {0}
modVault.details.uploader = Uploaded by
modVault.details.author = Authored by
modVault.details.description = Description
gameSelect.select.invalidPath = Invalid path
gamePath.select.noneChosen = You did not select a game location\!
gamePath.select.noValidExe = The specified location does not contain a valid Supreme Commander.exe and is therefore is no valid Forged Alliance installation.
Expand Down Expand Up @@ -921,7 +922,7 @@ settings.chat.dateFormat = Date Format
settings.chat.dateFormat.description = In which format the date should be displayed in the chat.
chat.error.noHashTag = Channel Name must start with \# (Try \#{0})
game.gameStatus.hosting = Hosting
mod.idNumber = \#{0}
mod.idNumber = \#
label.copy = copy
settings.fa.allowReplayWhileInGame = Allow watching replays while in game
settings.fa.patchGamePrefs = Patch Game.prefs
Expand Down Expand Up @@ -1302,4 +1303,4 @@ teammatchmaking.searchButton.inGame = Can't join matchmaking while you are in a
teammatchmaking.searchButton.memberInGame = Can't join matchmaking while someone is in a game
teammatchmaking.searchButton.inParty = The party leader will start matchmaking
teammatchmaking.searchButton.inQueue = Your party is now searching for a game
leaderboard.tmm_3v3.name = 3v3
leaderboard.tmm_3v3.name = 3v3
8 changes: 4 additions & 4 deletions src/main/resources/i18n/messages_cat.properties
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,8 @@ settings.account.goWebsite = Per a la majoria d'activitats relacionades amb el c
settings.account.goWebsiteButton = Visita la pàgina web de FAForever
map.versionId = ID de versió de mapa
vault.replays.ownReplays = Les teves repeticions
modVault.details.uploader = Pujat per\: {0}
modVault.details.author = Signat per\: {0}
modVault.details.uploader = Pujat per\:
modVault.details.author = Signat per\:
gameSelect.select.invalidPath = Ruta invàlida
gamePath.select.noneChosen = No has triat una localització de partida\!
gamePath.select.noValidExe = La localització especificada no conté un Supreme Commander.exe vàlid i per tant no és una instal·lació vàlida de Forged Alliance.
Expand Down Expand Up @@ -929,7 +929,7 @@ settings.chat.dateFormat = Format de Data
settings.chat.dateFormat.description = En quin format hauria de representar-se la data al xat.
chat.error.noHashTag = El Nom del Canal ha de començar amb \# (Prova \#{0})
game.gameStatus.hosting = Hostatjar
mod.idNumber = \#{0}
mod.idNumber = \#
label.copy = copia
settings.fa.allowReplayWhileInGame = Permet observar repeticions durant la partida
# Should this be translated or is it part of the code?
Expand Down Expand Up @@ -1269,4 +1269,4 @@ settings.fa.iceDebugWindow = Mostra la finestra de debug de l'adaptador ICE
settings.fa.iceDebugWindow.description = Mostra una finestra amb detalls de connexió sobre altres jugadors connectats.
chat.userContext.addNote = Afegeix nota
chat.userContext.editNote = Edita la nota
chat.userContext.removeNote = Esborrar nota
chat.userContext.removeNote = Esborrar nota
8 changes: 4 additions & 4 deletions src/main/resources/i18n/messages_cs.properties
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,8 @@ settings.account.goWebsite = Pro aktivity související s účtem musíte navšt
settings.account.goWebsiteButton = Navštivte webovou stránku FAForever
map.versionId = ID verze mapy
vault.replays.ownReplays = Tvoje nahrávky
modVault.details.uploader = Nahrál\: {0}
modVault.details.author = Autor\: {0}
modVault.details.uploader = Nahrál\:
modVault.details.author = Autor\:
gameSelect.select.invalidPath = Neplatná cesta
gamePath.select.noneChosen = Nezvolili jste umístění hry\!
gamePath.select.noValidExe = Zadané umístění neobsahuje platný Supreme Commander.exe, a proto není platný na instalaci Forged Alliance.
Expand Down Expand Up @@ -942,7 +942,7 @@ settings.chat.dateFormat = Datum Formát
settings.chat.dateFormat.description = V jakém formátu se má datum zobrazovat v chatu.
chat.error.noHashTag = Název kanálu musí začínat \# (Try \#{0})
game.gameStatus.hosting = Hostování
mod.idNumber = \#{0}
mod.idNumber = \#
label.copy = kopírovat
settings.fa.allowReplayWhileInGame = Povolit sledování záznamú během hry
settings.fa.patchGamePrefs = Oprava Game.prefs
Expand Down Expand Up @@ -1320,4 +1320,4 @@ blacklist.mapFolderName.promptText = Úplný nebo částečný název složky ma
hideSingleGames = Skrýt hry s 1 hráčem
showGamesWithFriends = Zobrazit pouze hry s přáteli
showGeneratedMaps = Zobrazit pouze vygenerované mapy
games.couldNotStart = Hru nelze spustit. Viz chybovou zprávu níže.
games.couldNotStart = Hru nelze spustit. Viz chybovou zprávu níže.
8 changes: 4 additions & 4 deletions src/main/resources/i18n/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,8 @@ settings.account.goWebsite = Für administrative Tätigkeiten bezüglich deines
settings.account.goWebsiteButton = Gehe zur FAForever Website
map.versionId = Kartenversions ID
vault.replays.ownReplays = Deine Replays
modVault.details.uploader = Hochgeladen von\: {0}
modVault.details.author = Author\: {0}
modVault.details.uploader = Hochgeladen von\:
modVault.details.author = Author\:
gameSelect.select.invalidPath = Invalider Pfad
gamePath.select.noneChosen = Du hast den Ort deines Spiels nicht angegeben\!
gamePath.select.noValidExe = Der angegebene Speicherort enthält keine gültige Supreme Commander.exe und ist daher keine gültige Forged Alliance-Installation.
Expand Down Expand Up @@ -926,7 +926,7 @@ settings.chat.dateFormat = Datumsformat
settings.chat.dateFormat.description = In welchem Format das Datum im Chat angezeigt werden soll.
chat.error.noHashTag = Der Channelname muss mit \# beginnen (Probiere \#{0})
game.gameStatus.hosting = Am hosten
mod.idNumber = \#{0}
mod.idNumber = \#
label.copy = Kopieren
settings.fa.allowReplayWhileInGame = Erlaube das Ansehen von Replays wenn du in-game bist
settings.fa.patchGamePrefs = Patche game.prefs
Expand Down Expand Up @@ -1302,4 +1302,4 @@ teammatchmaking.activeGames = Aktive Spiele\: {0,number,#}
game.create.generatedMap2 = Karte generieren
ignoreWarning = Warnung Ignorieren
replay.replayRunning = Wiederholung konnte nicht gestartet werden, da eine andere Wiederholung bereits läuft.
leaderboard.3v3_league = 3v3 Liga
leaderboard.3v3_league = 3v3 Liga
8 changes: 4 additions & 4 deletions src/main/resources/i18n/messages_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,8 @@ settings.account.goWebsite = Para actividades relacionadas con la cuenta, debe v
settings.account.goWebsiteButton = Visite el sitio web de FAForever
map.versionId = ID de la versión del mapa
vault.replays.ownReplays = Tus repeticiones
modVault.details.uploader = Subido por\: {0}
modVault.details.author = Escrito por\: {0}
modVault.details.uploader = Subido por\:
modVault.details.author = Escrito por\:
gameSelect.select.invalidPath = Ruta no válida
gamePath.select.noneChosen = ¡No seleccionaste una ubicación de juego\!
gamePath.select.noValidExe = La ubicación especificada no contiene un Supreme Commander.exe válido y, por lo tanto, no es una instalación válida de Forged Alliance.
Expand Down Expand Up @@ -964,7 +964,7 @@ settings.chat.dateFormat = Formato de fecha
settings.chat.dateFormat.description = En qué formato se debe mostrar la fecha en el chat.
chat.error.noHashTag = El nombre del canal debe comenzar con \# (prueba con \# {0})
game.gameStatus.hosting = Hospedando
mod.idNumber = \#{0}
mod.idNumber = \#
label.copy = Copiar
settings.fa.allowReplayWhileInGame = Permitir ver repeticiones en el juego
settings.fa.patchGamePrefs = Parche Game.prefs
Expand Down Expand Up @@ -1312,4 +1312,4 @@ chat.userContext.changeColor = Cambiar el color
chat.sendFailed = No se puede enviar el mensaje
userInfo.ratingHistory.lastWeek = La semana pasada
userInfo.ratingHistory.lastDay = El día anterior
chat.topicUpdated = El tema del canal ha sido actualizado. DE\: "{0}" A\: "{1}"
chat.topicUpdated = El tema del canal ha sido actualizado. DE\: "{0}" A\: "{1}"
8 changes: 4 additions & 4 deletions src/main/resources/i18n/messages_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,8 @@ settings.account.goWebsite = Pour la plupart des activités liées au compte, ve
settings.account.goWebsiteButton = Visiter le site web de FAForever
map.versionId = Version ID de la carte
vault.replays.ownReplays = Vos rediffusions
modVault.details.uploader = Uploadé par \: {0}
modVault.details.author = Créé par \: {0}\n
modVault.details.uploader = Uploadé par \:
modVault.details.author = Créé par \:
gameSelect.select.invalidPath = Chemin non valide
gamePath.select.noneChosen = Vous n'avez pas sélectionné le répertoire du jeu \!
gamePath.select.noValidExe = Le répertoire sélectionné ne contient pas de Supreme Commander.exe valide et n'est donc pas une installation Forged Alliance valide.
Expand Down Expand Up @@ -936,7 +936,7 @@ settings.chat.dateFormat = Format des dates
settings.chat.dateFormat.description = Choix du format d'affichage des dates
chat.error.noHashTag = Le nom de canal doit commencer par \# (Essayez \#{0})
game.gameStatus.hosting = En attente d'autres joueurs
mod.idNumber = \#{0}
mod.idNumber = \#
# Noun or Verb?
# Fuzzy
label.copy = Copier
Expand Down Expand Up @@ -1355,4 +1355,4 @@ teammatchmaking.searchButton.inParty=Le chef d'équipe démarre la recherche de
teammatchmaking.searchButton.inQueue=Votre équipe recherche maintenant une partie
leaderboard.tmm_3v3.name=3c3
reviews.averageScore=Score moyen
login.userBaseUrl=Adresse de l'API utilisateur
login.userBaseUrl=Adresse de l'API utilisateur
8 changes: 4 additions & 4 deletions src/main/resources/i18n/messages_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,8 @@ settings.account.goWebsite = Per la maggior parte delle attività relative all'a
settings.account.goWebsiteButton = Visita il sito web Faforever
map.versionId = ID versione Mappa
vault.replays.ownReplays = I tuoi replay
modVault.details.uploader = Caricato da\: {0}
modVault.details.author = Creato da\: {0}
modVault.details.uploader = Caricato da\:
modVault.details.author = Creato da\:
gameSelect.select.invalidPath = Percorso non valido
gamePath.select.noneChosen = Non hai selezionato il percorso del gioco\!
gamePath.select.noValidExe = Il percorso specificato non contiene un valido Supreme Commander.exe e quindi non è presente una valida installazione di Forged Alliance.
Expand Down Expand Up @@ -956,7 +956,7 @@ settings.chat.dateFormat = Formato Data
settings.chat.dateFormat.description = Il formato in cui dovrebbero essere visualizzate le date in chat.
chat.error.noHashTag = Nome Canale deve iniziare con \# (Prova \#{0})
game.gameStatus.hosting = Ospitando
mod.idNumber = \#{0}
mod.idNumber = \#
label.copy = copia
settings.fa.allowReplayWhileInGame = Permetti visualizzazione replay durante la partita
settings.fa.patchGamePrefs = Patch Game.prefs
Expand Down Expand Up @@ -1144,4 +1144,4 @@ login.oauthBaseUrl = OAuth URL base
session.expired.title = Sessione Scaduta
session.expired.message = Sessione scaduta, perfavore inserire i dati di login di nuovo
login.error = Errore occorso durante il login, errore\: {0}; {1}
discord.couldNotOpen = Non è stato possibile aprire il gioco da discord
discord.couldNotOpen = Non è stato possibile aprire il gioco da discord
6 changes: 3 additions & 3 deletions src/main/resources/i18n/messages_ko.properties
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,8 @@ settings.account.goWebsite=계정 관련 활동의 경우 당사 웹 사이트
settings.account.goWebsiteButton=Faforever 웹 사이트 방문하기
map.versionId=지도 버전 ID
vault.replays.ownReplays=당신의 리플레이
modVault.details.uploader=업로드 한 사람 \: {0}
modVault.details.author=작성자\: {0}
modVault.details.uploader=업로드 한 사람 \:
modVault.details.author=작성자\:
gameSelect.select.invalidPath=유효하지 않은 경로
gamePath.select.noneChosen=게임 위치를 선택하지 않았습니다\!
gamePath.select.noValidExe=지정된 위치에 유효한 Supreme Commander.exe가 포함되어 있지 않으므로 유효한 Forged Alliance 설치가 아닙니다.
Expand Down Expand Up @@ -1301,4 +1301,4 @@ chat.userContext.changeColor=색상 변경
chat.sendFailed=메시지를 보낼 수 없습니다
userInfo.ratingHistory.lastWeek=지난 1주
userInfo.ratingHistory.lastDay=지난 1일
chat.topicUpdated=채널 주제가 업데이트되었습니다. 이전\: "{0}" 이후\: "{1}"
chat.topicUpdated=채널 주제가 업데이트되었습니다. 이전\: "{0}" 이후\: "{1}"
8 changes: 4 additions & 4 deletions src/main/resources/i18n/messages_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,8 @@ settings.account.goWebsite = Voor de meeste account-gerelateerde activiteiten mo
settings.account.goWebsiteButton = Bezoek de Faforever website
map.versionId = Map versie ID
vault.replays.ownReplays = Jouw replays
modVault.details.uploader = Geüpload door\: [0}
modVault.details.author = Ontwikkeld door\: {0}
modVault.details.uploader = Geüpload door\:
modVault.details.author = Ontwikkeld door\:
gameSelect.select.invalidPath = Ongeldig pad
gamePath.select.noneChosen = Je hebt geen game locatie geselecteerd\!
gamePath.select.noValidExe = De opgegeven locatie bevat geen geldige Supreme Commander.exe en is dus geen geldige Forged Alliance-installatie.
Expand Down Expand Up @@ -952,7 +952,7 @@ settings.chat.dateFormat = Formaat datum
settings.chat.dateFormat.description = In welke opmaak de datum wordt laten zien in de chat.
chat.error.noHashTag = Kanaal Naam moet starten met \# (Probeer \#{0})
game.gameStatus.hosting = Hosting
mod.idNumber = \#{0}
mod.idNumber = \#
label.copy = kopie
settings.fa.allowReplayWhileInGame = Laat herhalingen kjken toe in het spel.
settings.fa.patchGamePrefs = Patch Game.prefs
Expand Down Expand Up @@ -1061,4 +1061,4 @@ management.maps.uninstall.error = Kan de map niet deïnstalleren
game.filter.numberOfPlayers = Aantal spelers
game.filter.mapHeight = Map hoogte, in km
game.filter.mapWidth = Map breedte, in km
teammatchmaking.search.prompt = Naam
teammatchmaking.search.prompt = Naam
8 changes: 4 additions & 4 deletions src/main/resources/i18n/messages_pl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,8 @@ settings.account.goWebsite = W celu podjęcia działań związanych z kontem nal
settings.account.goWebsiteButton = Odwiedź stronę FAForever
map.versionId = ID wersji mapy
vault.replays.ownReplays = Twoje powtórki
modVault.details.uploader = Umieszczone przez\: {0}
modVault.details.author = Autorstwa\: {0}
modVault.details.uploader = Umieszczone przez\:
modVault.details.author = Autorstwa\:
gameSelect.select.invalidPath = Niewłaściwa ścieżka
gamePath.select.noneChosen = Nie wybrałeś folderu, w którym znajduje się gra\!
gamePath.select.noValidExe = Podany folder nie zawiera prawidłowego pliku Supreme Commander.exe i dlatego nie jest on prawidłową lokalizacją instalacji Forged Alliance.
Expand Down Expand Up @@ -993,7 +993,7 @@ settings.chat.dateFormat = Format Daty
settings.chat.dateFormat.description = W jakim formacie powinna być wyświetlana data w czacie.
chat.error.noHashTag = Nazwa Kanału musi rozpoczynać się od \# (Spróbuj \#{0})
game.gameStatus.hosting = Hostowanie
mod.idNumber = \#{0}
mod.idNumber = \#
label.copy = kopiuj
settings.fa.allowReplayWhileInGame = Pozwalaj na oglądanie powtórek będąc w grze
# Fuzzy
Expand Down Expand Up @@ -1442,4 +1442,4 @@ teammatchmaking.searchButton.inQueue = Twoje party szuka teraz gry
leaderboard.tmm_3v3.name = 3v3
reviews.averageScore=Średnia ocen
# Fuzzy
login.userBaseUrl=Podstawowy adres URL API użytkownika
login.userBaseUrl=Podstawowy adres URL API użytkownika
Loading

0 comments on commit 3e65c84

Please sign in to comment.