Reorder priority of mod info elements in list entry (#2159)

Gives emphasis to the name and version as reported by the mod, instead
of emphasizing the filename.
This commit is contained in:
Nathan Du 2023-06-23 18:19:44 +08:00 committed by GitHub
parent d46efe8410
commit 95b85c13eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,25 +228,31 @@ class ModListPageSkin extends SkinBase<ModListPage> {
static class ModInfoObject extends RecursiveTreeObject<ModInfoObject> implements Comparable<ModInfoObject> {
private final BooleanProperty active;
private final LocalModFile localModFile;
private final String title;
private final String message;
private final ModTranslations.Mod mod;
ModInfoObject(LocalModFile localModFile) {
this.localModFile = localModFile;
this.active = localModFile.activeProperty();
StringBuilder message = new StringBuilder(localModFile.getName());
StringBuilder title = new StringBuilder(localModFile.getName());
if (isNotBlank(localModFile.getVersion()))
message.append(", ").append(i18n("archive.version")).append(": ").append(localModFile.getVersion());
title.append(" ").append(localModFile.getVersion());
this.title = title.toString();
StringBuilder message = new StringBuilder(localModFile.getFileName());
if (isNotBlank(localModFile.getGameVersion()))
message.append(", ").append(i18n("archive.game_version")).append(": ").append(localModFile.getGameVersion());
if (isNotBlank(localModFile.getAuthors()))
message.append(", ").append(i18n("archive.author")).append(": ").append(localModFile.getAuthors());
this.message = message.toString();
this.mod = ModTranslations.MOD.getModById(localModFile.getId());
}
String getTitle() {
return localModFile.getFileName();
return title;
}
String getSubtitle() {