add client config to adjust tool hud indicator position

This commit is contained in:
George Paton 2025-09-22 17:33:35 +10:00
parent dd3746a3d4
commit c8fe3cc095
2 changed files with 8 additions and 1 deletions

View File

@ -35,6 +35,8 @@ public class ClientConfig extends RunningConfig {
public static ConfigWrapper<Boolean> RENDER_REBAR_SIMPLE = new ConfigWrapper(false);
public static ConfigWrapper<Integer> RENDER_HELIOSTAT_BEAM_LIMIT = new ConfigWrapper(250);
public static ConfigWrapper<Integer> RENDER_REBAR_LIMIT = new ConfigWrapper(250);
public static ConfigWrapper<Integer> TOOL_HUD_INDICATOR_X = new ConfigWrapper(0);
public static ConfigWrapper<Integer> TOOL_HUD_INDICATOR_Y = new ConfigWrapper(0);
private static void initDefaults() {
configMap.put("GEIGER_OFFSET_HORIZONTAL", GEIGER_OFFSET_HORIZONTAL);
@ -59,6 +61,8 @@ public class ClientConfig extends RunningConfig {
configMap.put("RENDER_REBAR_SIMPLE", RENDER_REBAR_SIMPLE);
configMap.put("RENDER_HELIOSTAT_BEAM_LIMIT", RENDER_HELIOSTAT_BEAM_LIMIT);
configMap.put("RENDER_REBAR_LIMIT", RENDER_REBAR_LIMIT);
configMap.put("TOOL_HUD_INDICATORE_X", TOOL_HUD_INDICATOR_X);
configMap.put("TOOL_HUD_INDICATORE_Y", TOOL_HUD_INDICATOR_Y);
}
/** Initializes defaults, then reads the config file if it exists, then writes the config file. */

View File

@ -18,6 +18,7 @@ import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.Sets;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.ClientConfig;
import com.hbm.handler.HbmKeybinds.EnumKeybind;
import com.hbm.handler.ability.AvailableAbilities;
import com.hbm.handler.ability.IBaseAbility;
@ -603,12 +604,14 @@ public class ItemToolAbility extends ItemTool implements IDepthRockTool, IGUIPro
GuiIngame gui = Minecraft.getMinecraft().ingameGUI;
int size = 16;
int ox = ClientConfig.TOOL_HUD_INDICATOR_X.get();
int oy = ClientConfig.TOOL_HUD_INDICATOR_Y.get();
GL11.glPushMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(GUIScreenToolAbility.texture);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0);
gui.drawTexturedModalRect(event.resolution.getScaledWidth() / 2 - size - 8, event.resolution.getScaledHeight() / 2 + 8, uv.key, uv.value, size, size);
gui.drawTexturedModalRect(event.resolution.getScaledWidth() / 2 - size - 8 + ox, event.resolution.getScaledHeight() / 2 + 8 + oy, uv.key, uv.value, size, size);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();