Skip to content

Commit

Permalink
Revert part of "use forge gui offset to render faction level"
Browse files Browse the repository at this point in the history
This reverts part of commit 7209e2d
  • Loading branch information
maxanier committed Oct 15, 2023
1 parent 5139cf6 commit 17c1f82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 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() - 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);
Expand Down
15 changes: 2 additions & 13 deletions src/main/java/de/teamlapen/vampirism/config/VampirismConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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);
}

}
}

Expand Down Expand Up @@ -256,7 +247,6 @@ public static class Client {
public final ForgeConfigSpec.BooleanValue disableHudActionDurationRendering;
public final ForgeConfigSpec.ConfigValue<String> actionOrder;
public final ForgeConfigSpec.ConfigValue<String> minionTaskOrder;
public final ForgeConfigSpec.IntValue guiLevelOffsetYOld;

Client(ForgeConfigSpec.@NotNull Builder builder) {
builder.comment("Client configuration settings")
Expand All @@ -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);
Expand All @@ -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();
Expand Down

0 comments on commit 17c1f82

Please sign in to comment.