From 17c1f82de3958c0b5b3cf8f50826dd855c47065f Mon Sep 17 00:00:00 2001 From: maxanier Date: Sun, 15 Oct 2023 15:21:06 +0200 Subject: [PATCH] Revert part of "use forge gui offset to render faction level" This reverts part of commit 7209e2d6 --- .../client/gui/overlay/FactionLevelOverlay.java | 2 +- .../vampirism/config/VampirismConfig.java | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/main/java/de/teamlapen/vampirism/client/gui/overlay/FactionLevelOverlay.java b/src/main/java/de/teamlapen/vampirism/client/gui/overlay/FactionLevelOverlay.java index 68b0b7458e..37e6eb8264 100644 --- a/src/main/java/de/teamlapen/vampirism/client/gui/overlay/FactionLevelOverlay.java +++ b/src/main/java/de/teamlapen/vampirism/client/gui/overlay/FactionLevelOverlay.java @@ -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() - 39; + 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); diff --git a/src/main/java/de/teamlapen/vampirism/config/VampirismConfig.java b/src/main/java/de/teamlapen/vampirism/config/VampirismConfig.java index 68830b20ad..91e1eb3684 100644 --- a/src/main/java/de/teamlapen/vampirism/config/VampirismConfig.java +++ b/src/main/java/de/teamlapen/vampirism/config/VampirismConfig.java @@ -2,7 +2,6 @@ import de.teamlapen.lib.lib.util.UtilLib; -import de.teamlapen.vampirism.REFERENCE; import de.teamlapen.vampirism.VampirismMod; import de.teamlapen.vampirism.api.ThreadSafeAPI; import de.teamlapen.vampirism.api.VampirismAPI; @@ -16,12 +15,9 @@ import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.event.config.ModConfigEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import org.apache.commons.compress.archivers.sevenz.CLI; import org.apache.commons.lang3.tuple.Pair; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.apache.maven.artifact.versioning.ArtifactVersion; -import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -124,12 +120,7 @@ public static void finalizeAndRegisterConfig() { public static void onLoad(final ModConfigEvent.@NotNull Loading configEvent) { if (configEvent.getConfig().getType() == ModConfig.Type.SERVER) { ((SundamageRegistry) VampirismAPI.sundamageRegistry()).reloadConfiguration(); - } - if (configEvent.getConfig().getSpec() == clientSpec) { - if (CLIENT.guiLevelOffsetYOld.get() == 0) { - CLIENT.guiLevelOffsetYOld.set(CLIENT.guiLevelOffsetY.get()); - CLIENT.guiLevelOffsetY.set(CLIENT.guiLevelOffsetY.get() - 49); - } + } } @@ -256,7 +247,6 @@ public static class Client { public final ForgeConfigSpec.BooleanValue disableHudActionDurationRendering; public final ForgeConfigSpec.ConfigValue actionOrder; public final ForgeConfigSpec.ConfigValue minionTaskOrder; - public final ForgeConfigSpec.IntValue guiLevelOffsetYOld; Client(ForgeConfigSpec.@NotNull Builder builder) { builder.comment("Client configuration settings") @@ -274,7 +264,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").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); @@ -289,7 +279,6 @@ public static class Client { builder.push("internal"); actionOrder = builder.comment("Action ordering").define("actionOrder", "", ClientConfigHelper::testActions); minionTaskOrder = builder.comment("Minion task ordering").define("minionTaskOrder", "", ClientConfigHelper::testTasks); - guiLevelOffsetYOld = builder.comment("Old fixed Y offset of level overlay").defineInRange("levelOffsetYOld", 0, 0, 270); builder.pop(); builder.pop();