From 95b85c13eb41f4c53d81fd483af32b3180f8dcff Mon Sep 17 00:00:00 2001 From: Nathan Du Date: Fri, 23 Jun 2023 18:19:44 +0800 Subject: [PATCH] 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. --- .../jackhuang/hmcl/ui/versions/ModListPageSkin.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPageSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPageSkin.java index 444142c4c..8a57a7db0 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPageSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPageSkin.java @@ -228,25 +228,31 @@ class ModListPageSkin extends SkinBase { static class ModInfoObject extends RecursiveTreeObject implements Comparable { 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() {