From 1cc17a43ee0b1d259f4d5e8e9b39a26017b83922 Mon Sep 17 00:00:00 2001 From: telontelvarost Date: Sat, 4 May 2024 17:34:44 -0400 Subject: [PATCH] ISSUE-0 - Add word loaded to mod number; Default to english if string is not found --- .../github/prospector/modmenu/mixin/MixinGameMenuScreen.java | 3 ++- .../io/github/prospector/modmenu/mixin/MixinTitleScreen.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/prospector/modmenu/mixin/MixinGameMenuScreen.java b/src/main/java/io/github/prospector/modmenu/mixin/MixinGameMenuScreen.java index afe7552e..96a91210 100644 --- a/src/main/java/io/github/prospector/modmenu/mixin/MixinGameMenuScreen.java +++ b/src/main/java/io/github/prospector/modmenu/mixin/MixinGameMenuScreen.java @@ -23,7 +23,8 @@ public void drawMenuButton(CallbackInfo info) { if (FabricLoader.getInstance().isModLoaded("legacytranslations")) { TranslationStorage var2 = TranslationStorage.getInstance(); this.buttons.add(new ButtonWidget(100, this.width / 2 - 100, this.height / 4 + 72 - 16, 98, 20, var2.get("menu.texturepacks"))); - this.buttons.add(new ModMenuButtonWidget(101, this.width / 2 + 2, this.height / 4 + 72 - 16, 98, 20, var2.get("menu.mods") + " (" + ModMenu.getFormattedModCount() + ")")); + String strLoaded = (var2.get("menu.mods.loaded").equals("menu.mods.loaded")) ? "loaded" : var2.get("menu.mods.loaded"); + this.buttons.add(new ModMenuButtonWidget(101, this.width / 2 + 2, this.height / 4 + 72 - 16, 98, 20, var2.get("menu.mods") + " (" + ModMenu.getFormattedModCount() + " " + strLoaded + ")")); } else { this.buttons.add(new ButtonWidget(100, this.width / 2 - 100, this.height / 4 + 72 - 16, 98, 20, "Texture Packs")); diff --git a/src/main/java/io/github/prospector/modmenu/mixin/MixinTitleScreen.java b/src/main/java/io/github/prospector/modmenu/mixin/MixinTitleScreen.java index c84b0799..9800c4c9 100644 --- a/src/main/java/io/github/prospector/modmenu/mixin/MixinTitleScreen.java +++ b/src/main/java/io/github/prospector/modmenu/mixin/MixinTitleScreen.java @@ -26,7 +26,8 @@ public void drawMenuButton(CallbackInfo info) { texturePackButton.text = var2.get("menu.texturepacks"); int newWidth = ((MixinGuiButton) texturePackButton).getWidth() / 2 - 1; ((MixinGuiButton) texturePackButton).setWidth(newWidth); - this.buttons.add(new ModMenuButtonWidget(100, this.width / 2 + 2, texturePackButton.y, newWidth, 20, var2.get("menu.mods") + " (" + ModMenu.getFormattedModCount() + ")")); + String strLoaded = (var2.get("menu.mods.loaded").equals("menu.mods.loaded")) ? "loaded" : var2.get("menu.mods.loaded"); + this.buttons.add(new ModMenuButtonWidget(100, this.width / 2 + 2, texturePackButton.y, newWidth, 20, var2.get("menu.mods") + " (" + ModMenu.getFormattedModCount() + " " + strLoaded + ")")); } else { texturePackButton.text = "Texture Packs"; int newWidth = ((MixinGuiButton) texturePackButton).getWidth() / 2 - 1;