minor ui reformat

This commit is contained in:
James Seibel
2026-01-10 11:57:01 -06:00
parent 053d1333ca
commit 47fa6d7d8b
4 changed files with 88 additions and 86 deletions
@@ -182,36 +182,36 @@ public class ClassicConfigGUI
&& !ModInfo.IS_DEV_BUILD) && !ModInfo.IS_DEV_BUILD)
{ {
this.addBtn(new TexturedButtonWidget( this.addBtn(new TexturedButtonWidget(
// Where the button is on the screen // Where the button is on the screen
this.width - 28, this.height - 28, this.width - 28, this.height - 28,
// Width and height of the button // Width and height of the button
20, 20, 20, 20,
// texture UV Offset // texture UV Offset
0, 0, 0, 0,
// Some texture stuff // Some texture stuff
0, 0,
#if MC_VER < MC_1_21_1 #if MC_VER < MC_1_21_1
new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"), new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"),
#elif MC_VER <= MC_1_21_10 #elif MC_VER <= MC_1_21_10
ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"),
#else #else
Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"),
#endif #endif
20, 20, 20, 20,
// Create the button and tell it where to go // Create the button and tell it where to go
(buttonWidget) -> { (buttonWidget) -> {
ChangelogScreen changelogScreen = new ChangelogScreen(this); ChangelogScreen changelogScreen = new ChangelogScreen(this);
if (changelogScreen.usable) if (changelogScreen.usable)
{ {
Objects.requireNonNull(this.minecraft).setScreen(changelogScreen); Objects.requireNonNull(this.minecraft).setScreen(changelogScreen);
} }
else else
{ {
LOGGER.warn("Changelog was not able to open"); LOGGER.warn("Changelog was not able to open");
} }
}, },
// Add a title to the button // Add a title to the button
Translatable(ModInfo.ID + ".updater.title") Translatable(ModInfo.ID + ".updater.title")
)); ));
} }
@@ -120,26 +120,26 @@ public class UpdateModScreen extends DhScreen
if (!ModInfo.IS_DEV_BUILD) if (!ModInfo.IS_DEV_BUILD)
{ {
this.addBtn(new TexturedButtonWidget( this.addBtn(new TexturedButtonWidget(
// Where the button is on the screen // Where the button is on the screen
this.width / 2 - 97, this.height / 2 + 8, this.width / 2 - 97, this.height / 2 + 8,
// Width and height of the button // Width and height of the button
20, 20, 20, 20,
// Offset // Offset
0, 0, 0, 0,
// Some textuary stuff // Some textuary stuff
0, 0,
#if MC_VER < MC_1_21_1 #if MC_VER < MC_1_21_1
new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"), new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"),
#elif MC_VER <= MC_1_21_10 #elif MC_VER <= MC_1_21_10
ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"),
#else #else
Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"),
#endif #endif
20, 20, 20, 20,
// Create the button and tell it where to go // Create the button and tell it where to go
(buttonWidget) -> Objects.requireNonNull(this.minecraft).setScreen(new ChangelogScreen(this, this.newVersionID)), (buttonWidget) -> Objects.requireNonNull(this.minecraft).setScreen(new ChangelogScreen(this, this.newVersionID)),
// Add a title to the button // Add a title to the button
Translatable(ModInfo.ID + ".updater.title") Translatable(ModInfo.ID + ".updater.title")
)); ));
} }
@@ -137,24 +137,24 @@ public class MixinOptionsScreen extends Screen
if (this.optionsButton == null) if (this.optionsButton == null)
{ {
this.optionsButton this.optionsButton
= new TexturedButtonWidget( = new TexturedButtonWidget(
// Where the button is on the screen // Where the button is on the screen
this.width / 2 - 180, this.height / 6 - 12, this.width / 2 - 180, this.height / 6 - 12,
// Width and height of the button // Width and height of the button
20, 20, 20, 20,
// texture UV Offset // texture UV Offset
0, 0, 0, 0,
// Some textuary stuff // Some textuary stuff
20, ICON_TEXTURE, 20, 40, 20, ICON_TEXTURE, 20, 40,
// Create the button and tell it where to go // Create the button and tell it where to go
// For now it goes to the client option by default // For now it goes to the client option by default
(buttonWidget) -> Objects.requireNonNull(this.minecraft).setScreen(GetConfigScreen.getScreen(this)), (buttonWidget) -> Objects.requireNonNull(this.minecraft).setScreen(GetConfigScreen.getScreen(this)),
// Add a title to the button // Add a title to the button
#if MC_VER < MC_1_19_2 #if MC_VER < MC_1_19_2
new TranslatableComponent(ModInfo.ID + ".title")); new TranslatableComponent(ModInfo.ID + ".title"));
#else #else
Component.translatable(ModInfo.ID + ".title")); Component.translatable(ModInfo.ID + ".title"));
#endif #endif
} }
return this.optionsButton; return this.optionsButton;
@@ -57,25 +57,27 @@ public class MixinOptionsScreen extends Screen
private void lodconfig$init(CallbackInfo ci) private void lodconfig$init(CallbackInfo ci)
{ {
if (Config.Client.showDhOptionsButtonInMinecraftUi.get()) if (Config.Client.showDhOptionsButtonInMinecraftUi.get())
{
this. #if MC_VER < MC_1_17_1 addButton #else addRenderableWidget #endif this. #if MC_VER < MC_1_17_1 addButton #else addRenderableWidget #endif
(new TexturedButtonWidget( (new TexturedButtonWidget(
// Where the button is on the screen // Where the button is on the screen
this.width / 2 - 180, this.height / 6 - 12, this.width / 2 - 180, this.height / 6 - 12,
// Width and height of the button // Width and height of the button
20, 20, 20, 20,
// Offset // Offset
0, 0, 0, 0,
// Some textuary stuff // Some textuary stuff
20, ICON_TEXTURE, 20, 40, 20, ICON_TEXTURE, 20, 40,
// Create the button and tell it where to go // Create the button and tell it where to go
// For now it goes to the client option by default // For now it goes to the client option by default
(buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(GetConfigScreen.getScreen(this)), (buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(GetConfigScreen.getScreen(this)),
// Add a title to the button // Add a title to the button
#if MC_VER < MC_1_19_2 #if MC_VER < MC_1_19_2
new TranslatableComponent(ModInfo.ID + ".title"))); new TranslatableComponent(ModInfo.ID + ".title")));
#else #else
Component.translatable(ModInfo.ID + ".title"))); Component.translatable(ModInfo.ID + ".title")));
#endif #endif
}
} }
} }