Skip to content

Commit

Permalink
Fix update checker promoting downgrades, other followup improvements (#…
Browse files Browse the repository at this point in the history
…716)

- Fixed update checker promoting downgrades
  • Loading branch information
LostLuma authored and Prospector committed Jun 18, 2024
1 parent 62d004e commit 516528b
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class DescriptionListWidget extends EntryListWidget<DescriptionListWidget

private static final Text HAS_UPDATE_TEXT = Text.translatable("modmenu.hasUpdate");
private static final Text EXPERIMENTAL_TEXT = Text.translatable("modmenu.experimental").formatted(Formatting.GOLD);
private static final Text MODRINTH_TEXT = Text.translatable("modmenu.modrinth");
private static final Text DOWNLOAD_TEXT = Text.translatable("modmenu.downloadLink")
.formatted(Formatting.BLUE)
.formatted(Formatting.UNDERLINE);
Expand Down Expand Up @@ -125,17 +124,7 @@ public void renderList(DrawContext DrawContext, int mouseX, int mouseY, float de
children().add(new DescriptionEntry(line, 8));
}

if (updateInfo instanceof ModrinthUpdateInfo modrinthUpdateInfo) {
Text updateText = Text.translatable("modmenu.updateText",
VersionUtil.stripPrefix(modrinthUpdateInfo.getVersionNumber()),
MODRINTH_TEXT)
.formatted(Formatting.BLUE)
.formatted(Formatting.UNDERLINE);

for (OrderedText line : textRenderer.wrapLines(updateText, wrapWidth - 16)) {
children().add(new LinkEntry(line, modrinthUpdateInfo.getDownloadLink(), 8));
}
} else {
Text updateMessage = updateInfo.getUpdateMessage();
String downloadLink = updateInfo.getDownloadLink();
if (updateMessage == null) {
Expand All @@ -152,7 +141,7 @@ public void renderList(DrawContext DrawContext, int mouseX, int mouseY, float de
children().add(new LinkEntry(line, downloadLink, 8));
} else {
children().add(new DescriptionEntry(line, 8));
}

}
}
}
Expand Down

0 comments on commit 516528b

Please sign in to comment.