diff options
Diffstat (limited to 'src/main/java')
10 files changed, 237 insertions, 85 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java index 1bca2a84..83c4b7ae 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java @@ -105,6 +105,7 @@ public class ItemPriceInformation { break; case 4: if(craftCost.fromRecipe) { + if((int)craftCost.craftCost == 0){ continue;} if(!added) { tooltip.add(""); added = true; @@ -172,6 +173,7 @@ public class ItemPriceInformation { break; case 3: if(craftCost.fromRecipe) { + if((int)craftCost.craftCost == 0){ continue;} if(!added) { tooltip.add(""); added = true; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index 19bd0dfa..d196f75a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -387,7 +387,8 @@ public class NEUOverlay extends Gui { if(Mouse.getEventButtonState()) { //displayInformationPane(HTMLInfoPane.createFromWikiUrl(overlay, manager, "Help", // "https://moulberry.github.io/files/neu_help.html")); - Minecraft.getMinecraft().displayGuiScreen(new HelpGUI()); + //Minecraft.getMinecraft().displayGuiScreen(new HelpGUI()); + ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/neuhelp"); Utils.playPressSound(); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index b699afa5..f0cf7774 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -1269,6 +1269,7 @@ public class NotEnoughUpdates { ClientCommandHandler.instance.registerCommand(dungeonWinTest); ClientCommandHandler.instance.registerCommand(calendarCommand); ClientCommandHandler.instance.registerCommand(new FairySouls.FairySoulsCommand()); + ClientCommandHandler.instance.registerCommand(new FairySouls.FairySoulsCommandAlt()); ClientCommandHandler.instance.registerCommand(neuhelp); BackgroundBlur.registerListener(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java index 583e3715..75a63644 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java @@ -312,7 +312,9 @@ public class CapeManager { playerMap.clear(); for(EntityPlayer player : Minecraft.getMinecraft().theWorld.playerEntities) { String uuid = player.getUniqueID().toString().replace("-", ""); - playerMap.put(uuid, player); + try { + playerMap.put(uuid, player); + } catch(IllegalArgumentException ignored){} } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java index d45ca9ba..05591e81 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java @@ -17,6 +17,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.command.ICommandSender; import net.minecraft.entity.Entity; import net.minecraft.util.*; +import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.event.world.WorldEvent; @@ -293,80 +294,87 @@ public class FairySouls { GlStateManager.enableDepth(); } + public static class FairySoulsCommandAlt extends SimpleCommand { + public FairySoulsCommandAlt() { + super("fairysouls", fairysoulRunnable); + } + } + public static class FairySoulsCommand extends SimpleCommand { public FairySoulsCommand() { - super("neusouls", new ProcessCommandRunnable() { - @Override - public void processCommand(ICommandSender sender, String[] args) { - if(args.length != 1) { - printHelp(); - return; + super("neusouls", fairysoulRunnable); + } + } + + private static SimpleCommand.ProcessCommandRunnable fairysoulRunnable = new SimpleCommand.ProcessCommandRunnable() { + @Override + public void processCommand(ICommandSender sender, String[] args) { + if(args.length != 1) { + printHelp(); + return; + } + String subcommand = args[0].toLowerCase(); + + switch (subcommand) { + case "help": + printHelp(); + return; + case "on": + case "enable": + print(EnumChatFormatting.DARK_PURPLE+"Enabled fairy soul waypoints"); + enabled = true; + return; + case "off": + case "disable": + print(EnumChatFormatting.DARK_PURPLE+"Disabled fairy soul waypoints"); + enabled = false; + return; + case "clear": { + String location = SBInfo.getInstance().getLocation(); + if(currentSoulList == null || location == null) { + print(EnumChatFormatting.RED+"No fairy souls found in your current world"); + } else { + Set<Integer> found = foundSouls.computeIfAbsent(location, k -> new HashSet<>()); + for(int i=0; i<currentSoulList.size(); i++) { + found.add(i); + } + print(EnumChatFormatting.DARK_PURPLE+"Marked all fairy souls as found"); } - String subcommand = args[0].toLowerCase(); - - switch (subcommand) { - case "help": - printHelp(); - return; - case "on": - case "enable": - print(EnumChatFormatting.DARK_PURPLE+"Enabled fairy soul waypoints"); - enabled = true; - return; - case "off": - case "disable": - print(EnumChatFormatting.DARK_PURPLE+"Disabled fairy soul waypoints"); - enabled = false; - return; - case "clear": { - String location = SBInfo.getInstance().getLocation(); - if(currentSoulList == null || location == null) { - print(EnumChatFormatting.RED+"No fairy souls found in your current world"); - } else { - Set<Integer> found = foundSouls.computeIfAbsent(location, k -> new HashSet<>()); - for(int i=0; i<currentSoulList.size(); i++) { - found.add(i); - } - print(EnumChatFormatting.DARK_PURPLE+"Marked all fairy souls as found"); - } - } - return; - case "unclear": - String location = SBInfo.getInstance().getLocation(); - if(location == null) { - print(EnumChatFormatting.RED+"No fairy souls found in your current world"); - } else { - print(EnumChatFormatting.DARK_PURPLE+"Marked all fairy souls as not found"); - foundSouls.remove(location); - } - return; + } + return; + case "unclear": + String location = SBInfo.getInstance().getLocation(); + if(location == null) { + print(EnumChatFormatting.RED+"No fairy souls found in your current world"); + } else { + print(EnumChatFormatting.DARK_PURPLE+"Marked all fairy souls as not found"); + foundSouls.remove(location); } + return; + } - print(EnumChatFormatting.RED+"Unknown subcommand: " + subcommand); - } - }); + print(EnumChatFormatting.RED+"Unknown subcommand: " + subcommand); } + }; - private static void print(String s) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(s)); - } + private static void print(String s) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(s)); + } - private static void printHelp() { - print(""); - print(EnumChatFormatting.DARK_PURPLE.toString()+EnumChatFormatting.BOLD+" NEU Fairy Soul Waypoint Guide"); - print(EnumChatFormatting.LIGHT_PURPLE+"Shows waypoints for every fairy soul in your world"); - print(EnumChatFormatting.LIGHT_PURPLE+"Clicking a fairy soul automatically removes it from the list"); - if(!NotEnoughUpdates.INSTANCE.config.hidden.dev) { - print(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.OBFUSCATED + "Ab" + EnumChatFormatting.RESET + EnumChatFormatting.DARK_RED + "!" + EnumChatFormatting.RESET + EnumChatFormatting.RED + " This feature cannot and will not work in Dungeons. " + EnumChatFormatting.DARK_RED + "!" + EnumChatFormatting.OBFUSCATED + "Ab"); - } - print(EnumChatFormatting.GOLD.toString()+EnumChatFormatting.BOLD+" Commands:"); - print(EnumChatFormatting.YELLOW+"/neusouls help - Display this message"); - print(EnumChatFormatting.YELLOW+"/neusouls on/off - Enable/disable the waypoint markers"); - print(EnumChatFormatting.YELLOW+"/neusouls clear/unclear - Marks every waypoint in your current world as completed/uncompleted"); - print(""); + private static void printHelp() { + print(""); + print(EnumChatFormatting.DARK_PURPLE.toString()+EnumChatFormatting.BOLD+" NEU Fairy Soul Waypoint Guide"); + print(EnumChatFormatting.LIGHT_PURPLE+"Shows waypoints for every fairy soul in your world"); + print(EnumChatFormatting.LIGHT_PURPLE+"Clicking a fairy soul automatically removes it from the list"); + if(!NotEnoughUpdates.INSTANCE.config.hidden.dev) { + print(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.OBFUSCATED + "Ab" + EnumChatFormatting.RESET + EnumChatFormatting.DARK_RED + "!" + EnumChatFormatting.RESET + EnumChatFormatting.RED + " This feature cannot and will not work in Dungeons. " + EnumChatFormatting.DARK_RED + "!" + EnumChatFormatting.OBFUSCATED + "Ab"); } - + print(EnumChatFormatting.GOLD.toString()+EnumChatFormatting.BOLD+" Commands:"); + print(EnumChatFormatting.YELLOW+"/neusouls help - Display this message"); + print(EnumChatFormatting.YELLOW+"/neusouls on/off - Enable/disable the waypoint markers"); + print(EnumChatFormatting.YELLOW+"/neusouls clear/unclear - Marks every waypoint in your current world as completed/uncompleted"); + print(""); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java index 59b3d802..053910bc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java @@ -124,7 +124,7 @@ public class ItemCooldowns { } private static void updatePickaxeCooldown() { - if(pickaxeCooldown == -1) { + if(pickaxeCooldown == -1 && NotEnoughUpdates.INSTANCE.config.itemOverlays.pickaxeAbility) { for(ItemStack stack : Minecraft.getMinecraft().thePlayer.inventory.mainInventory) { if(stack != null && stack.hasTagCompound()) { String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); @@ -148,7 +148,7 @@ public class ItemCooldowns { @SubscribeEvent public void onChatMessage(ClientChatReceivedEvent event) { - if(pickaxeCooldown != 0 && PICKAXE_ABILITY_REGEX.matcher(event.message.getFormattedText()).matches()) { + if(pickaxeCooldown != 0 && PICKAXE_ABILITY_REGEX.matcher(event.message.getFormattedText()).matches() && NotEnoughUpdates.INSTANCE.config.itemOverlays.pickaxeAbility) { updatePickaxeCooldown(); pickaxeUseCooldownMillisRemaining = pickaxeCooldown*1000; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java index 11351857..7f981092 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java @@ -99,10 +99,11 @@ public class SlotLocking { public void changedSlot(int slotNumber){ int pingModifier = NotEnoughUpdates.INSTANCE.config.slotLocking.slotLockSwapDelay; if(pingModifier == 0){ return; }; + if(!isSlotIndexLocked(slotNumber)){ return;} long currentTimeMilis = System.currentTimeMillis(); for (int i = 0; i < slotChanges.length; i++) { - if(i != slotNumber && slotChanges[i] != 0 && slotChanges[i] < (currentTimeMilis+pingModifier)){ + if(i != slotNumber && slotChanges[i] != 0 && (slotChanges[i] + (long) pingModifier) > currentTimeMilis){ slotChanges[i] = 0; } } @@ -115,10 +116,8 @@ public class SlotLocking { long currentTimeMilis = System.currentTimeMillis(); for (int i = 0; i < slotChanges.length; i++) { - if(slotChanges[i] != 0 && slotChanges[i] < (currentTimeMilis+pingModifier)){ - if(isSlotIndexLocked(i)){ - return true; - } + if (slotChanges[i] != 0 && isSlotIndexLocked(i) && (slotChanges[i] + (long) pingModifier) > currentTimeMilis) { + return true; } } return false; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java index 21d1018d..07f1340d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java @@ -215,6 +215,7 @@ public class GuiItemCustomize extends GuiScreen { EnumChatFormatting.LIGHT_PURPLE+"\u00B6d = Purple", EnumChatFormatting.YELLOW+"\u00B6e = Yellow", EnumChatFormatting.WHITE+"\u00B6f = White", + "\u00A7Z\u00B6Z = SBA Chroma"+EnumChatFormatting.RESET+EnumChatFormatting.GRAY+" (Requires SBA)", "", EnumChatFormatting.GREEN+"Available formatting codes:", EnumChatFormatting.GRAY+"\u00B6k = "+EnumChatFormatting.OBFUSCATED+"Obfuscated", diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java index af236bf8..86256650 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java @@ -303,4 +303,13 @@ public class ItemOverlays { @ConfigEditorBoolean
public boolean enablePrismapumpOverlay = true;
+
+ @Expose
+ @ConfigOption(
+ name = "Pickaxe Ability Cooldown",
+ desc = "Show the cooldown duration off the pickaxe ability as the durability."
+ )
+ @ConfigEditorBoolean
+ public boolean pickaxeAbility = true;
+
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java index 56ed9502..22cbf04d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -553,6 +553,15 @@ public class GuiProfileViewer extends GuiScreen { } } } + if(mouseX >= guiLeft-29 && mouseX <= guiLeft){ + if(mouseY >= guiTop && mouseY<= guiTop+28){ + onMasterMode = false; + return; + } else if(mouseY+28 >= guiTop && mouseY<= guiTop+28*2){ + onMasterMode = true; + return; + } + } } protected void keyTypedDung(char typedChar, int keyCode) { @@ -754,6 +763,13 @@ public class GuiProfileViewer extends GuiScreen { } } + private static final LinkedHashMap<String, ItemStack> dungeonsModeIcons = new LinkedHashMap<>(); + static { + dungeonsModeIcons.put("catacombs", Utils.editItemStackInfo(NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("DUNGEON_STONE")),EnumChatFormatting.GRAY+"Normal Mode", true)); + dungeonsModeIcons.put("master_catacombs", Utils.editItemStackInfo(NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("MASTER_SKULL_TIER_7")),EnumChatFormatting.GRAY+"Master Mode", true)); + + } + private void drawDungPage(int mouseX, int mouseY, float partialTicks) { Minecraft.getMinecraft().getTextureManager().bindTexture(pv_dung); Utils.drawTexturedRect(guiLeft, guiTop, sizeX, sizeY, GL11.GL_NEAREST); @@ -768,6 +784,13 @@ public class GuiProfileViewer extends GuiScreen { int sectionWidth = 110; + String dungeonString = onMasterMode?"master_catacombs":"catacombs"; + + //Utils.drawStringCentered((onMasterMode?"Master Mode":"Catacombs"),fontRendererObj,(guiLeft+sizeX/2), guiTop+10, true, 0xffff0000); + Utils.renderShadowedString(EnumChatFormatting.RED+(onMasterMode?"Master Mode":"Catacombs"), + (guiLeft+sizeX/2), guiTop+5, sectionWidth); + + ProfileViewer.Level levelObjCata = levelObjCatas.get(profileId); //Catacombs level thingy { @@ -865,35 +888,58 @@ public class GuiProfileViewer extends GuiScreen { float secrets = Utils.getElementAsFloat(Utils.getElement(hypixelInfo, "achievements.skyblock_treasure_hunter"), 0); - float totalRuns = 0; + float totalRunsF = 0; float totalRunsF5 = 0; for(int i=1; i<=7; i++) { float runs = Utils.getElementAsFloat(Utils.getElement(profileInfo, "dungeons.dungeon_types.catacombs.tier_completions."+i), 0); - totalRuns += runs; + totalRunsF += runs; if(i >= 5) { totalRunsF5 += runs; } } + float totalRunsM = 0; + float totalRunsM5 = 0; + for(int i=1; i<=7; i++) { + float runs = Utils.getElementAsFloat(Utils.getElement(profileInfo, + "dungeons.dungeon_types.master_catacombs.tier_completions."+i), 0); + totalRunsM += runs; + if(i >= 5) { + totalRunsM5 += runs; + } + } + totalRuns=totalRunsF+totalRunsM; float mobKills = 0; + float mobKillsF = 0; float mobKillsF5 = 0; for(int i=1; i<=7; i++) { float kills = Utils.getElementAsFloat(Utils.getElement(profileInfo, "dungeons.dungeon_types.catacombs.mobs_killed."+i), 0); - mobKills += kills; + mobKillsF += kills; if(i >= 5) { mobKillsF5 += kills; } } + float mobKillsM = 0; + float mobKillsM5 = 0; + for(int i=1; i<=7; i++) { + float kills = Utils.getElementAsFloat(Utils.getElement(profileInfo, + "dungeons.dungeon_types.master_catacombs.mobs_killed."+i), 0); + mobKillsM += kills; + if(i >= 5) { + mobKillsM5 += kills; + } + } + mobKills = mobKillsF+mobKillsM; int miscTopY = y+55; - Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Total Runs ", - EnumChatFormatting.WHITE.toString()+((int)(totalRuns)), x, miscTopY, sectionWidth); - Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Total Runs (F5-7) ", - EnumChatFormatting.WHITE.toString()+((int)(totalRunsF5)), x, miscTopY+10, sectionWidth); + Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Total Runs "+(onMasterMode?"M":"F"), + EnumChatFormatting.WHITE.toString()+((int)(onMasterMode?totalRunsM:totalRunsF)), x, miscTopY, sectionWidth); + Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Total Runs ("+(onMasterMode?"M":"F")+ "5-7) ", + EnumChatFormatting.WHITE.toString()+((int)(onMasterMode?totalRunsM5:totalRunsF5)), x, miscTopY+10, sectionWidth); Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Secrets (Total) ", EnumChatFormatting.WHITE.toString()+shortNumberFormat(secrets, 0), x, miscTopY+20, sectionWidth); Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Secrets (/Run) ", @@ -924,11 +970,11 @@ public class GuiProfileViewer extends GuiScreen { } float timeNorm = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.dungeon_types.catacombs.fastest_time."+floorTime), 0); + "dungeons.dungeon_types."+dungeonString+".fastest_time."+floorTime), 0); float timeS = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.dungeon_types.catacombs.fastest_time_s."+floorTime), 0); + "dungeons.dungeon_types."+dungeonString+".fastest_time_s."+floorTime), 0); float timeSPLUS = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.dungeon_types.catacombs.fastest_time_s_plus."+floorTime), 0); + "dungeons.dungeon_types."+dungeonString+".fastest_time_s_plus."+floorTime), 0); String timeNormStr = timeNorm <= 0 ? "N/A" : Utils.prettyTime((long)timeNorm); String timeSStr = timeS <= 0 ? "N/A" : Utils.prettyTime((long)timeS); String timeSPlusStr = timeSPLUS <= 0 ? "N/A" : Utils.prettyTime((long)timeSPLUS); @@ -949,7 +995,7 @@ public class GuiProfileViewer extends GuiScreen { x+sectionWidth/2, y, sectionWidth); for(int i=1; i<=7; i++) { float compl = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.dungeon_types.catacombs.tier_completions."+i), 0); + "dungeons.dungeon_types."+dungeonString+".tier_completions."+i), 0); if(BOSS_HEADS[i-1] == null) { String textureLink = bossFloorHeads[i-1]; @@ -985,7 +1031,7 @@ public class GuiProfileViewer extends GuiScreen { Utils.drawItemStack(BOSS_HEADS[i-1], 0, 0); GlStateManager.popMatrix(); - Utils.renderAlignedString(String.format(EnumChatFormatting.YELLOW+"%s (F%d) ", bossFloorArr[i-1], i), + Utils.renderAlignedString(String.format(EnumChatFormatting.YELLOW+"%s ("+(onMasterMode?"M":"F")+"%d) ", bossFloorArr[i-1], i), EnumChatFormatting.WHITE.toString()+(int)compl, x+16, y+18+20*(i-1), sectionWidth-15); @@ -1031,6 +1077,89 @@ public class GuiProfileViewer extends GuiScreen { renderXpBar(colour+skillName, dungSkillsStack[i], x, y+20+29*i, sectionWidth, levelObj, mouseX, mouseY); } } + + drawSideButtons(); + + //drawSideButton(0, dungeonsModeIcons.get("catacombs"), true); + //drawSideButton(1, dungeonsModeIcons.get("master_catacombs"), true); + //drawSideButton(1, dungeonsModeIcons.get("catacombs"), true); + //drawSideButton(2, dungeonsModeIcons.get("catacombs"), false); + + + } + + private boolean onMasterMode = false; + + //TODO: improve this shit + private void drawSideButtons(){ + // GlStateManager.pushMatrix(); + GlStateManager.enableDepth(); + GlStateManager.translate(0, 0, 5); + if(onMasterMode){ + drawSideButton(1, dungeonsModeIcons.get("master_catacombs"), true); + } else { + drawSideButton(0, dungeonsModeIcons.get("catacombs"), true); + } + GlStateManager.translate(0, 0, -3); + + GlStateManager.translate(0, 0, -2); + if(!onMasterMode){ + drawSideButton(1, dungeonsModeIcons.get("master_catacombs"), false); + } else { + drawSideButton(0, dungeonsModeIcons.get("catacombs"), false); + } + GlStateManager.disableDepth(); + //GlStateManager.popMatrix(); + } + + + + + private void drawSideButton(int yIndex, ItemStack itemStack, boolean pressed){ + GlStateManager.disableLighting(); + GlStateManager.enableBlend(); + GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + + int x = guiLeft-28; + int y = guiTop+yIndex*28; + + float uMin = 193/256f; + float uMax = 223/256f; + float vMin = 200/256f; + float vMax = 228/256f; + if(pressed) { + uMin = 224/256f; + uMax = 1f; + + + if(yIndex != 0) { + vMin = 228/256f; + vMax = 1f; + } + + renderBlurredBackground(width, height, x+2, y+2, 30, 28-4); + } else { + renderBlurredBackground(width, height, x+2, y+2, 28-2, 28-4); + } + + GlStateManager.disableLighting(); + GlStateManager.enableBlend(); + GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + + Minecraft.getMinecraft().getTextureManager().bindTexture(pv_elements); + + Utils.drawTexturedRect(x, y, pressed?32:28, 28, uMin, uMax, vMin, vMax, GL11.GL_NEAREST); + + GlStateManager.enableDepth(); + Utils.drawItemStack(itemStack, x+8, y+7); + + + + } private void renderXpBar(String skillName, ItemStack stack, int x, int y, int xSize, ProfileViewer.Level levelObj, int mouseX, int mouseY) { |