Skip to content

Commit

Permalink
Added options for temperature UI offsets. Closes #767
Browse files Browse the repository at this point in the history
  • Loading branch information
Adubbz committed Nov 23, 2023
1 parent d555e3c commit a3a7ab5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/main/java/toughasnails/config/ClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ public class ClientConfig

public static ForgeConfigSpec.IntValue thirstLeftOffset;
public static ForgeConfigSpec.IntValue thirstTopOffset;
public static ForgeConfigSpec.IntValue temperatureLeftOffset;
public static ForgeConfigSpec.IntValue temperatureTopOffset;

static
{
BUILDER.push("gui");
thirstLeftOffset = BUILDER.comment("The offset of the left of the thirst overlay from its default position.").defineInRange("thirst_left_offset", 0, Integer.MIN_VALUE, Integer.MAX_VALUE);
thirstTopOffset = BUILDER.comment("The offset of the top of the thirst overlay from its default position.").defineInRange("thirst_top_offset", 0, Integer.MIN_VALUE, Integer.MAX_VALUE);
temperatureLeftOffset = BUILDER.comment("The offset of the left of the temperature overlay from its default position.").defineInRange("temperature_left_offset", 0, Integer.MIN_VALUE, Integer.MAX_VALUE);
temperatureTopOffset = BUILDER.comment("The offset of the top of the temperature overlay from its default position.").defineInRange("temperature_top_offset", 0, Integer.MIN_VALUE, Integer.MAX_VALUE);
BUILDER.pop();

SPEC = BUILDER.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraftforge.fml.common.Mod;
import toughasnails.api.temperature.TemperatureHelper;
import toughasnails.api.temperature.TemperatureLevel;
import toughasnails.config.ClientConfig;
import toughasnails.config.ServerConfig;
import toughasnails.core.ToughAsNails;

Expand Down Expand Up @@ -74,8 +75,8 @@ private static void renderHyperthermia(ForgeGui gui, GuiGraphics guiGraphics)

private static void drawTemperature(GuiGraphics gui, int width, int height, TemperatureLevel temperature)
{
int left = width / 2 - 8;
int top = height - 52;
int left = width / 2 - 8 + ClientConfig.temperatureLeftOffset.get();
int top = height - 52 + ClientConfig.temperatureTopOffset.get();

if (prevTemperatureLevel == null)
prevTemperatureLevel = temperature;
Expand Down

0 comments on commit a3a7ab5

Please sign in to comment.