diff --git a/src/main/java/net/torocraft/torohud/conf/HealthBarGuiConf.java b/src/main/java/net/torocraft/torohud/conf/HealthBarGuiConf.java index 4349e07..2b90e51 100644 --- a/src/main/java/net/torocraft/torohud/conf/HealthBarGuiConf.java +++ b/src/main/java/net/torocraft/torohud/conf/HealthBarGuiConf.java @@ -24,6 +24,58 @@ public enum Skin {NONE, BASIC} @Name("Show 3D Model of Entity") public static boolean showEntityModel = true; // config.getBoolean("Show 3D Model of Entity", Configuration.CATEGORY_CLIENT, true, "Shows a 3D model of the entity being targeted"); + // Health Config + @Name("Hide Health Number") + @Comment("Hide the health number") + public static boolean hideHealthNo = false; + + @Name("Health Number X Offset") + public static int healthNoXOffset = 0; + + @Name("Health Number Y Offset") + public static int healthNoYOffset = 0; + + @Name("Health Bar X Offset") + public static int healthXOffset = 0; + + @Name("Health Bar Y Offset") + public static int healthYOffset = 0; + + @Name("Health Bar Scale") + public static float healthScale = 1f; + + // Nameplate Config + @Name("Hide Nameplate") + public static boolean hideName = false; + + @Name("Nameplate X Offset") + public static int nameXOffset = 0; + + @Name("Nameplate Y Offset") + public static int nameYOffset = 0; + + @Name("Nameplate Scale") + public static float nameScale = 1f; + + // Armor Config + @Name("Hide Armor") + public static boolean hideArmor = false; + + @Name("Armor X Offset") + public static int armorXOffset = 0; + + @Name("Armor Y Offset") + public static int armorYOffset = 0; + + // Potion Config + @Name("Potion X Offset") + public static int potionXOffset = 0; + + @Name("Potion Y Offset") + public static int potionYOffset = 0; + + + // Overall GUI Config @Name("Disable GUI") public static boolean disableGui = false; @@ -32,7 +84,6 @@ public enum Skin {NONE, BASIC} @Name("Y Offset") public static int yOffset = 0; - @Name("GUI Position") public static GuiAnchor guiPosition = GuiAnchor.TOP_LEFT; diff --git a/src/main/java/net/torocraft/torohud/display/BarDisplay.java b/src/main/java/net/torocraft/torohud/display/BarDisplay.java index 780dad5..ca81caa 100644 --- a/src/main/java/net/torocraft/torohud/display/BarDisplay.java +++ b/src/main/java/net/torocraft/torohud/display/BarDisplay.java @@ -5,6 +5,7 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.ResourceLocation; import net.torocraft.torohud.gui.HealthBars; +import net.torocraft.torohud.conf.HealthBarGuiConf; public class BarDisplay extends AbstractEntityDisplay implements IDisplay { @@ -43,21 +44,38 @@ public void render() { String health = (int) Math.ceil(entity.getHealth()) + "/" + (int) entity.getMaxHealth(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - HealthBars.drawEntityHealthBarInGui(gui, entity, barX, barY); - mc.fontRenderer.drawStringWithShadow(name, barX, y + 2, 16777215); - barX += mc.fontRenderer.getStringWidth(name) + 5; + GlStateManager.pushMatrix(); + GlStateManager.scale(HealthBarGuiConf.healthScale, HealthBarGuiConf.healthScale, HealthBarGuiConf.healthScale); + HealthBars.drawEntityHealthBarInGui(gui, entity, barX + HealthBarGuiConf.healthXOffset, barY + HealthBarGuiConf.healthXOffset); + GlStateManager.popMatrix(); + + if(!HealthBarGuiConf.hideName) + { + GlStateManager.pushMatrix(); + GlStateManager.scale(HealthBarGuiConf.nameScale, HealthBarGuiConf.nameScale, HealthBarGuiConf.nameScale); + mc.fontRenderer.drawStringWithShadow(name, barX + HealthBarGuiConf.nameXOffset, y + 2 + HealthBarGuiConf.nameYOffset, 16777215); + GlStateManager.popMatrix(); + + barX += mc.fontRenderer.getStringWidth(name) + 5 + HealthBarGuiConf.nameXOffset; + } - renderHeartIcon(barX, y + 1); - barX += 10; + if(!HealthBarGuiConf.hideHealthNo) + { + renderHeartIcon(barX + HealthBarGuiConf.healthNoXOffset, y + 1 + HealthBarGuiConf.healthNoYOffset); + barX += 10 + HealthBarGuiConf.healthNoXOffset; - mc.fontRenderer.drawStringWithShadow(health, barX, y + 2, 0xe0e0e0); - barX += mc.fontRenderer.getStringWidth(health) + 5; + mc.fontRenderer.drawStringWithShadow(health, barX, y + 2, 0xe0e0e0); + barX += mc.fontRenderer.getStringWidth(health) + 5; + } - renderArmorIcon(barX, y + 1); - barX += 10; + if(!HealthBarGuiConf.hideArmor) + { + renderArmorIcon(barX + HealthBarGuiConf.armorXOffset, y + 1 + HealthBarGuiConf.armorYOffset); + barX += 10 + HealthBarGuiConf.armorXOffset; - mc.fontRenderer.drawStringWithShadow(entity.getTotalArmorValue() + "", barX, y + 2, 0xe0e0e0); + mc.fontRenderer.drawStringWithShadow(entity.getTotalArmorValue() + "", barX, y + 2, 0xe0e0e0); + } } private void renderArmorIcon(int x, int y) { diff --git a/src/main/java/net/torocraft/torohud/display/PotionDisplay.java b/src/main/java/net/torocraft/torohud/display/PotionDisplay.java index c8470e0..eb983f1 100644 --- a/src/main/java/net/torocraft/torohud/display/PotionDisplay.java +++ b/src/main/java/net/torocraft/torohud/display/PotionDisplay.java @@ -10,6 +10,7 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.util.ResourceLocation; import net.torocraft.torohud.network.MessageEntityStatsResponse; +import net.torocraft.torohud.conf.HealthBarGuiConf; public class PotionDisplay extends AbstractEntityDisplay implements IDisplay { @@ -62,8 +63,8 @@ private void drawEffects() { } int index = 0; - int x = this.x + X_OFFSET; - int y = this.y + Y_OFFSET; + int x = this.x + X_OFFSET + HealthBarGuiConf.potionXOffset; + int y = this.y + Y_OFFSET + HealthBarGuiConf.potionYOffset; for (PotionEffect potion : Ordering.natural().sortedCopy(potions)) {