Skip to content

Commit

Permalink
Revert remainder of fc90978 and reset config value if =0 (temporary w…
Browse files Browse the repository at this point in the history
…orkaround)
  • Loading branch information
maxanier committed Oct 15, 2023
1 parent a947e53 commit 4f3e42e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void render(@NotNull ForgeGui gui, @NotNull GuiGraphics graphics, float p
text = String.valueOf(handler.getCurrentLevel());
}
int x = (this.mc.getWindow().getGuiScaledWidth() - this.mc.font.width(text)) / 2 + VampirismConfig.CLIENT.guiLevelOffsetX.get();
int y = this.mc.getWindow().getGuiScaledHeight() - VampirismConfig.CLIENT.guiLevelOffsetY.get() - gui.rightHeight;
int y = this.mc.getWindow().getGuiScaledHeight() - VampirismConfig.CLIENT.guiLevelOffsetY.get();
graphics.drawString(this.mc.font, text, x + 1, y, 0, false);
graphics.drawString(this.mc.font, text, x - 1, y, 0, false);
graphics.drawString(this.mc.font, text, x, y + 1, 0, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ public static void finalizeAndRegisterConfig() {
public static void onLoad(final ModConfigEvent.@NotNull Loading configEvent) {
if (configEvent.getConfig().getType() == ModConfig.Type.SERVER) {
((SundamageRegistry) VampirismAPI.sundamageRegistry()).reloadConfiguration();

} else if (configEvent.getConfig().getType() == ModConfig.Type.CLIENT) {
if (CLIENT.guiLevelOffsetY.get() == 0) {
CLIENT.guiLevelOffsetY.set(47); //Temporary workaround to reset incorrect values
}
}
}

Expand Down Expand Up @@ -252,7 +255,7 @@ public static class Client {

builder.comment("Configure GUI").push("gui");
guiLevelOffsetX = builder.comment("X-Offset of the level indicator from the center in pixels").defineInRange("levelOffsetX", 0, -250, 250);
guiLevelOffsetY = builder.comment("Y-Offset of the level indicator from the bottom in pixels").defineInRange("levelOffsetY", 0, 0, 270);
guiLevelOffsetY = builder.comment("Y-Offset of the level indicator from the bottom in pixels. Must be > 0").defineInRange("levelOffsetY", 47, 0, 270);
guiSkillButton = builder.comment("Render skill menu button in inventory").define("skillButtonEnable", true);
overrideGuiSkillButtonX = builder.comment("Force the guiSkillButton to the following x position from the center of the inventory, default value is 125").defineInRange("overrideGuiSkillButtonX", 125, Integer.MIN_VALUE, Integer.MAX_VALUE);
overrideGuiSkillButtonY = builder.comment("Force the guiSkillButton to the following y position from the center of the inventory, default value is -22").defineInRange("overrideGuiSkillButtonY", -22, Integer.MIN_VALUE, Integer.MAX_VALUE);
Expand Down

0 comments on commit 4f3e42e

Please sign in to comment.