diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java index 742278bd2..76caea7fb 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java @@ -182,36 +182,36 @@ public class ClassicConfigGUI && !ModInfo.IS_DEV_BUILD) { this.addBtn(new TexturedButtonWidget( - // Where the button is on the screen - this.width - 28, this.height - 28, - // Width and height of the button - 20, 20, - // texture UV Offset - 0, 0, - // Some texture stuff - 0, - #if MC_VER < MC_1_21_1 - new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"), - #elif MC_VER <= MC_1_21_10 - ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), - #else - Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), - #endif - 20, 20, - // Create the button and tell it where to go - (buttonWidget) -> { - ChangelogScreen changelogScreen = new ChangelogScreen(this); - if (changelogScreen.usable) - { - Objects.requireNonNull(this.minecraft).setScreen(changelogScreen); - } - else - { - LOGGER.warn("Changelog was not able to open"); - } - }, - // Add a title to the button - Translatable(ModInfo.ID + ".updater.title") + // Where the button is on the screen + this.width - 28, this.height - 28, + // Width and height of the button + 20, 20, + // texture UV Offset + 0, 0, + // Some texture stuff + 0, + #if MC_VER < MC_1_21_1 + new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"), + #elif MC_VER <= MC_1_21_10 + ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), + #else + Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), + #endif + 20, 20, + // Create the button and tell it where to go + (buttonWidget) -> { + ChangelogScreen changelogScreen = new ChangelogScreen(this); + if (changelogScreen.usable) + { + Objects.requireNonNull(this.minecraft).setScreen(changelogScreen); + } + else + { + LOGGER.warn("Changelog was not able to open"); + } + }, + // Add a title to the button + Translatable(ModInfo.ID + ".updater.title") )); } diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java index 474313e82..339288d6b 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java @@ -120,26 +120,26 @@ public class UpdateModScreen extends DhScreen if (!ModInfo.IS_DEV_BUILD) { this.addBtn(new TexturedButtonWidget( - // Where the button is on the screen - this.width / 2 - 97, this.height / 2 + 8, - // Width and height of the button - 20, 20, - // Offset - 0, 0, - // Some textuary stuff - 0, - #if MC_VER < MC_1_21_1 - new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"), - #elif MC_VER <= MC_1_21_10 - ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), - #else - Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), - #endif - 20, 20, - // Create the button and tell it where to go - (buttonWidget) -> Objects.requireNonNull(this.minecraft).setScreen(new ChangelogScreen(this, this.newVersionID)), - // Add a title to the button - Translatable(ModInfo.ID + ".updater.title") + // Where the button is on the screen + this.width / 2 - 97, this.height / 2 + 8, + // Width and height of the button + 20, 20, + // Offset + 0, 0, + // Some textuary stuff + 0, + #if MC_VER < MC_1_21_1 + new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"), + #elif MC_VER <= MC_1_21_10 + ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), + #else + Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), + #endif + 20, 20, + // Create the button and tell it where to go + (buttonWidget) -> Objects.requireNonNull(this.minecraft).setScreen(new ChangelogScreen(this, this.newVersionID)), + // Add a title to the button + Translatable(ModInfo.ID + ".updater.title") )); } diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinOptionsScreen.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinOptionsScreen.java index 706b48cc9..1ba7e14a5 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinOptionsScreen.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinOptionsScreen.java @@ -137,24 +137,24 @@ public class MixinOptionsScreen extends Screen if (this.optionsButton == null) { this.optionsButton - = new TexturedButtonWidget( - // Where the button is on the screen - this.width / 2 - 180, this.height / 6 - 12, - // Width and height of the button - 20, 20, - // texture UV Offset - 0, 0, - // Some textuary stuff - 20, ICON_TEXTURE, 20, 40, - // Create the button and tell it where to go - // For now it goes to the client option by default - (buttonWidget) -> Objects.requireNonNull(this.minecraft).setScreen(GetConfigScreen.getScreen(this)), - // Add a title to the button - #if MC_VER < MC_1_19_2 - new TranslatableComponent(ModInfo.ID + ".title")); - #else - Component.translatable(ModInfo.ID + ".title")); - #endif + = new TexturedButtonWidget( + // Where the button is on the screen + this.width / 2 - 180, this.height / 6 - 12, + // Width and height of the button + 20, 20, + // texture UV Offset + 0, 0, + // Some textuary stuff + 20, ICON_TEXTURE, 20, 40, + // Create the button and tell it where to go + // For now it goes to the client option by default + (buttonWidget) -> Objects.requireNonNull(this.minecraft).setScreen(GetConfigScreen.getScreen(this)), + // Add a title to the button + #if MC_VER < MC_1_19_2 + new TranslatableComponent(ModInfo.ID + ".title")); + #else + Component.translatable(ModInfo.ID + ".title")); + #endif } return this.optionsButton; diff --git a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinOptionsScreen.java b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinOptionsScreen.java index 9165ae0b0..7a7371123 100644 --- a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinOptionsScreen.java +++ b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinOptionsScreen.java @@ -57,25 +57,27 @@ public class MixinOptionsScreen extends Screen private void lodconfig$init(CallbackInfo ci) { if (Config.Client.showDhOptionsButtonInMinecraftUi.get()) + { this. #if MC_VER < MC_1_17_1 addButton #else addRenderableWidget #endif - (new TexturedButtonWidget( - // Where the button is on the screen - this.width / 2 - 180, this.height / 6 - 12, - // Width and height of the button - 20, 20, - // Offset - 0, 0, - // Some textuary stuff - 20, ICON_TEXTURE, 20, 40, - // Create the button and tell it where to go - // For now it goes to the client option by default - (buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(GetConfigScreen.getScreen(this)), - // Add a title to the button - #if MC_VER < MC_1_19_2 - new TranslatableComponent(ModInfo.ID + ".title"))); - #else - Component.translatable(ModInfo.ID + ".title"))); - #endif + (new TexturedButtonWidget( + // Where the button is on the screen + this.width / 2 - 180, this.height / 6 - 12, + // Width and height of the button + 20, 20, + // Offset + 0, 0, + // Some textuary stuff + 20, ICON_TEXTURE, 20, 40, + // Create the button and tell it where to go + // For now it goes to the client option by default + (buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(GetConfigScreen.getScreen(this)), + // Add a title to the button + #if MC_VER < MC_1_19_2 + new TranslatableComponent(ModInfo.ID + ".title"))); + #else + Component.translatable(ModInfo.ID + ".title"))); + #endif + } } }