diff --git a/src/main/java/codes/biscuit/skyblockaddons/gui/ButtonRegular.java b/src/main/java/codes/biscuit/skyblockaddons/gui/ButtonRegular.java index 80c1d0dea8..2fd507dd55 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/gui/ButtonRegular.java +++ b/src/main/java/codes/biscuit/skyblockaddons/gui/ButtonRegular.java @@ -50,11 +50,7 @@ public void drawButton(Minecraft mc, int mouseX, int mouseY) { boxColor = ConfigColor.GREEN.getColor(boxAlpha * alphaMultiplier); } } else if (feature.getButtonType() == Feature.ButtonType.COLOR) { - if (feature == Feature.WARNING_COLOR) { - boxColor = main.getConfigValues().getColor(Feature.WARNING_COLOR).getColor(boxAlpha*alphaMultiplier); - } else { - boxColor = main.getConfigValues().getColor(Feature.CONFIRMATION_COLOR).getColor(boxAlpha*alphaMultiplier); - } + boxColor = main.getConfigValues().getColor(feature).getColor(boxAlpha*alphaMultiplier); } else if (feature.getButtonType() == Feature.ButtonType.MODIFY) { if (hitMaximum()) { boxColor = ConfigColor.GRAY.getColor(boxAlpha * alphaMultiplier); diff --git a/src/main/java/codes/biscuit/skyblockaddons/gui/SkyblockAddonsGui.java b/src/main/java/codes/biscuit/skyblockaddons/gui/SkyblockAddonsGui.java index 1d3f3b5031..7a46e4a316 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/gui/SkyblockAddonsGui.java +++ b/src/main/java/codes/biscuit/skyblockaddons/gui/SkyblockAddonsGui.java @@ -37,11 +37,13 @@ public void initGui() { boxWidth = 100; buttonList.add(new ButtonRegular(0, halfWidth-boxWidth-20, height*0.65, "Warning Color", main, Feature.WARNING_COLOR, boxWidth, boxHeight)); buttonList.add(new ButtonRegular(0, halfWidth+20, height*0.65, "Confirmation Color", main, Feature.CONFIRMATION_COLOR, boxWidth, boxHeight)); - buttonList.add(new ButtonRegular(0, halfWidth-boxWidth-20, height*0.73, null, main, Feature.WARNING_TIME, boxWidth, boxHeight)); - buttonList.add(new ButtonRegular(0, halfWidth+20, height*0.73, "Edit Locations", main, Feature.EDIT_LOCATIONS, boxWidth, boxHeight)); + buttonList.add(new ButtonRegular(0, halfWidth-boxWidth-20, height*0.73, "Mana Text Color", main, Feature.MANA_TEXT_COLOR, boxWidth, boxHeight)); + buttonList.add(new ButtonRegular(0, halfWidth+20, height*0.73, "Mana Bar Color", main, Feature.MANA_BAR_COLOR, boxWidth, boxHeight)); + buttonList.add(new ButtonRegular(0, halfWidth-boxWidth-20, height*0.81, null, main, Feature.WARNING_TIME, boxWidth, boxHeight)); + buttonList.add(new ButtonRegular(0, halfWidth+20, height*0.81, "Edit Locations", main, Feature.EDIT_LOCATIONS, boxWidth, boxHeight)); boxWidth = 20; - buttonList.add(new ButtonRegular(0, halfWidth-boxWidth-125, height*0.73, "+", main, Feature.ADD, boxWidth, boxHeight)); - buttonList.add(new ButtonRegular(0, halfWidth-boxWidth+5, height*0.73, "-", main, Feature.SUBTRACT, boxWidth, boxHeight)); + buttonList.add(new ButtonRegular(0, halfWidth-boxWidth-125, height*0.81, "+", main, Feature.ADD, boxWidth, boxHeight)); + buttonList.add(new ButtonRegular(0, halfWidth-boxWidth+5, height*0.81, "-", main, Feature.SUBTRACT, boxWidth, boxHeight)); } @@ -98,11 +100,7 @@ protected void actionPerformed(GuiButton abstractButton) { } } } else if (feature.getButtonType() == Feature.ButtonType.COLOR) { - if (feature == Feature.WARNING_COLOR) { - main.getConfigValues().setColor(Feature.WARNING_COLOR, main.getConfigValues().getColor(Feature.WARNING_COLOR).getNextColor()); - } else { - main.getConfigValues().setColor(Feature.CONFIRMATION_COLOR, main.getConfigValues().getColor(Feature.CONFIRMATION_COLOR).getNextColor()); - } + main.getConfigValues().setColor(feature, main.getConfigValues().getColor(feature).getNextColor()); } else if (feature.getButtonType() == Feature.ButtonType.MODIFY) { if (feature == Feature.ADD) { if (main.getConfigValues().getWarningSeconds() < 99) { diff --git a/src/main/java/codes/biscuit/skyblockaddons/listeners/PlayerListener.java b/src/main/java/codes/biscuit/skyblockaddons/listeners/PlayerListener.java index 07b72f6311..5c50340db8 100644 --- a/src/main/java/codes/biscuit/skyblockaddons/listeners/PlayerListener.java +++ b/src/main/java/codes/biscuit/skyblockaddons/listeners/PlayerListener.java @@ -17,6 +17,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.GuiIngameForge; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent; @@ -25,16 +26,14 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; -import java.awt.*; import java.util.Timer; import java.util.TimerTask; import java.util.regex.Pattern; -import static net.minecraft.client.gui.Gui.icons; - public class PlayerListener { public final static ItemStack BONE = new ItemStack(Item.getItemById(352)); + private final static ResourceLocation manaBars = new ResourceLocation("skyblockaddons", "manabars.png"); private boolean sentUpdate = false; private boolean predictMana = false; @@ -119,7 +118,7 @@ public void onRenderManaBar(RenderGameOverlayEvent.Post e) { Minecraft mc = Minecraft.getMinecraft(); if (e.type == RenderGameOverlayEvent.ElementType.EXPERIENCE && Utils.isOnSkyblock()) { if (main.getConfigValues().getManaBarType() != Feature.ManaBarType.OFF && !(mc.currentScreen instanceof LocationEditGui)) { - mc.getTextureManager().bindTexture(icons); + mc.getTextureManager().bindTexture(manaBars); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.disableBlend(); @@ -133,14 +132,17 @@ public void onRenderManaBar(RenderGameOverlayEvent.Post e) { if (manaFill > 1) manaFill = 1; int filled = (int) (manaFill * barWidth); int top = (int) (main.getConfigValues().getManaBarY() * sr.getScaledHeight()) + 10; - mc.ingameGUI.drawTexturedModalRect(left, top, 10, 84, barWidth, 5); + // mc.ingameGUI.drawTexturedModalRect(left, top, 10, 84, barWidth, 5); + int textureY = main.getConfigValues().getColor(Feature.MANA_BAR_COLOR).ordinal()*10; + mc.ingameGUI.drawTexturedModalRect(left, top, 0, textureY, barWidth, 5); if (filled > 0) { - mc.ingameGUI.drawTexturedModalRect(left, top, 10, 89, filled, 5); +// mc.ingameGUI.drawTexturedModalRect(left, top, 10, 89, filled, 5); + mc.ingameGUI.drawTexturedModalRect(left, top, 0, textureY+5, filled, 5); } } if (main.getConfigValues().getManaBarType() == Feature.ManaBarType.TEXT || main.getConfigValues().getManaBarType() == Feature.ManaBarType.BAR_TEXT) { - int color = new Color(47, 71, 249).getRGB(); + int color = main.getConfigValues().getColor(Feature.MANA_TEXT_COLOR).getColor(255); String text = mana + "/" + maxMana; int x = (int) (main.getConfigValues().getManaBarX() * sr.getScaledWidth()) + 60 - mc.ingameGUI.getFontRenderer().getStringWidth(text) / 2; int y = (int) (main.getConfigValues().getManaBarY() * sr.getScaledHeight()) + 4; diff --git a/src/main/resources/assets/skyblockaddons/manabars.png b/src/main/resources/assets/skyblockaddons/manabars.png new file mode 100644 index 0000000000..d118547a3a Binary files /dev/null and b/src/main/resources/assets/skyblockaddons/manabars.png differ