diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/me/Danker/DankersSkyblockMod.java | 42 | ||||
-rw-r--r-- | src/main/java/me/Danker/commands/ToggleCommand.java | 29 | ||||
-rw-r--r-- | src/main/java/me/Danker/gui/DankerGui.java | 73 | ||||
-rw-r--r-- | src/main/java/me/Danker/gui/WarningGui.java | 61 | ||||
-rw-r--r-- | src/main/java/me/Danker/gui/WarningGuiRedirect.java | 28 | ||||
-rw-r--r-- | src/main/java/me/Danker/handlers/ConfigHandler.java | 25 |
6 files changed, 213 insertions, 45 deletions
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index bfd776d..a1468e4 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -1,5 +1,6 @@ package me.Danker; +import akka.event.Logging; import com.google.gson.JsonObject; import me.Danker.commands.*; import me.Danker.gui.*; @@ -9,9 +10,7 @@ import me.Danker.utils.Utils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.*; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; @@ -68,6 +67,7 @@ import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; import java.awt.*; +import java.net.URLDecoder; import java.text.NumberFormat; import java.util.List; import java.util.*; @@ -98,6 +98,8 @@ public class DankersSkyblockMod static double lastMaddoxTime = 0; static KeyBinding[] keyBindings = new KeyBinding[2]; static boolean usingLabymod = false; + static boolean usingOAM = false; + static boolean OAMWarning = false; public static String guiToOpen = null; static boolean foundLivid = false; static Entity livid = null; @@ -305,9 +307,33 @@ public class DankersSkyblockMod @EventHandler public void postInit(final FMLPostInitializationEvent event) { + Package[] packages = Package.getPackages(); + for(Package p : packages){ + if(p.getName().startsWith("com.spiderfrog.gadgets")){ + usingOAM = true; + break; + } + } + System.out.println("OAM detection: " + usingOAM); + + usingLabymod = Loader.isModLoaded("labymod"); System.out.println("LabyMod detection: " + usingLabymod); } + + @SubscribeEvent + public void onGuiOpenEvent(GuiOpenEvent event){ + if(event.gui instanceof GuiMainMenu && usingOAM && !OAMWarning){ + System.out.println("Gui opened: Instance of GuiMainMenu."); + if(!(event.gui instanceof WarningGui)){ + System.out.println("No instance of WarningGui"); + event.gui = new WarningGuiRedirect(new WarningGui()); + OAMWarning = true; + }else{ + System.out.println("Instance of WarningGui"); + } + } + } // Update checker @SubscribeEvent @@ -487,6 +513,16 @@ public class DankersSkyblockMod event.setCanceled(true); return; } + // Ability Cooldown + if (!ToggleCommand.cooldownMessages && message.contains("This ability is currently on cooldown for") && message.contains("more second")) { + event.setCanceled(true); + return; + } + // Out of mana messages + if (!ToggleCommand.manaMessages && message.contains("You do not have enough mana to do this!")) { + event.setCanceled(true); + return; + } // Implosion if (!ToggleCommand.implosionMessages) { if (message.contains("Your Implosion hit ") || message.contains("There are blocks in the way")) { diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 15693ef..8cc858f 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -23,17 +23,21 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean spiritBearAlerts; public static boolean aotdToggled; public static boolean lividDaggerToggled; - public static boolean sceptreMessages; public static boolean petColoursToggled; public static boolean dungeonTimerToggled; public static boolean golemAlertToggled; public static boolean expertiseLoreToggled; public static boolean skill50DisplayToggled; public static boolean outlineTextToggled; + public static boolean cakeTimerToggled; + // Chat Messages + public static boolean sceptreMessages; public static boolean midasStaffMessages; public static boolean implosionMessages; public static boolean healMessages; - public static boolean cakeTimerToggled; + public static boolean cooldownMessages; + public static boolean manaMessages; + // Dungeons Messages public static boolean lowHealthNotifyToggled; public static boolean lividSolverToggled; public static boolean stopSalvageStarredToggled; @@ -67,9 +71,10 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalert/" + - "aotd/lividdagger/flowerweapons/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" + - "outlinetext/midasstaffmessages/implosionmessages/healmessages/caketimer/lowhealthnotify/" + + "aotd/lividdagger/flowerweapons/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" + + "outlinetext/midasstaffmessages/implosionmessages/healmessages/cooldownmessages/manamessages/caketimer/lowhealthnotify/" + "lividsolver/stopsalvagestarred/notifyslayerslain/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" + "watchermessage/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/" + "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; @@ -79,7 +84,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public int getRequiredPermissionLevel() { return 0; } - + @Override public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { @@ -87,7 +92,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", - "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", + "implosionmessages", "healmessages", "cooldownmessages", "manamessages", "caketimer", "lowhealthnotify", "lividsolver", "stopsalvagestarred", "notifyslayerslain", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", @@ -181,6 +186,16 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "HealMessages", healMessages); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Heal messages have been set to " + DankersSkyblockMod.SECONDARY_COLOUR + healMessages + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "cooldownmessages": + cooldownMessages = !cooldownMessages; + ConfigHandler.writeBooleanConfig("toggles", "CooldownMessages", cooldownMessages); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Ability cooldown messages has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + cooldownMessages + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "manamessages": + manaMessages = !manaMessages; + ConfigHandler.writeBooleanConfig("toggles", "ManaMessages", manaMessages); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Out of mana messages has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + manaMessages + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "petcolors": case "petcolours": petColoursToggled = !petColoursToggled; @@ -338,6 +353,8 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Midas Staff messages: " + DankersSkyblockMod.VALUE_COLOUR + midasStaffMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Implosion messages: " + DankersSkyblockMod.VALUE_COLOUR + implosionMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Heal messages: " + DankersSkyblockMod.VALUE_COLOUR + healMessages + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Ability cooldown messages: " + DankersSkyblockMod.VALUE_COLOUR + cooldownMessages + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Out of mana messages: " + DankersSkyblockMod.VALUE_COLOUR + manaMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Pet colours: " + DankersSkyblockMod.VALUE_COLOUR + petColoursToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Dungeon timer: " + DankersSkyblockMod.VALUE_COLOUR + dungeonTimerToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Golem spawn alerts: " + DankersSkyblockMod.VALUE_COLOUR + golemAlertToggled + "\n" + diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index dbb6c11..5b9a452 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -39,18 +39,22 @@ public class DankerGui extends GuiScreen { private GuiButton chatMaddox; private GuiButton spiritBearAlert; private GuiButton aotd; - private GuiButton lividDagger; - private GuiButton sceptreMessages; - private GuiButton midasStaffMessages; - private GuiButton implosionMessages; - private GuiButton healMessages; private GuiButton petColours; - private GuiButton dungeonTimer; private GuiButton golemAlerts; private GuiButton expertiseLore; private GuiButton skill50Display; private GuiButton outlineText; private GuiButton cakeTimer; + // Chat Messages + private GuiButton lividDagger; + private GuiButton sceptreMessages; + private GuiButton midasStaffMessages; + private GuiButton implosionMessages; + private GuiButton healMessages; + private GuiButton cooldownMessages; + private GuiButton manaMessages; + //Dungeons + private GuiButton dungeonTimer; private GuiButton lowHealthNotify; private GuiButton lividSolver; private GuiButton stopSalvageStarred; @@ -93,35 +97,36 @@ public class DankerGui extends GuiScreen { pickBlock = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled)); // Page 2 coords = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled)); - dungeonTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled)); + chatMaddox = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Click On-Screen to Open Maddox: " + Utils.getColouredBoolean(ToggleCommand.chatMaddoxToggled)); cakeTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Cake Timer: " + Utils.getColouredBoolean(ToggleCommand.cakeTimerToggled)); skill50Display = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled)); slayerCount = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal)); aotd = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Disable AOTD Ability: " + Utils.getColouredBoolean(ToggleCommand.aotdToggled)); lividDagger = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Disable Livid Dagger Ability: " + Utils.getColouredBoolean(ToggleCommand.lividDaggerToggled)); // Page 3 - chatMaddox = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Click On-Screen to Open Maddox: " + Utils.getColouredBoolean(ToggleCommand.chatMaddoxToggled)); - gparty = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); - spiritBearAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts)); - sceptreMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages)); - midasStaffMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages)); - implosionMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Implosion Messages: " + Utils.getColouredBoolean(ToggleCommand.implosionMessages)); - healMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages)); + spiritBearAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts)); + sceptreMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages)); + midasStaffMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages)); + implosionMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Implosion Messages: " + Utils.getColouredBoolean(ToggleCommand.implosionMessages)); + healMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages)); + cooldownMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Cooldown Messages: " + Utils.getColouredBoolean(ToggleCommand.cooldownMessages)); + manaMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Mana Messages: " + Utils.getColouredBoolean((ToggleCommand.manaMessages))); // Page 4 goldenEnch = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled)); petColours = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled)); expertiseLore = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled)); - lividSolver = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled)); + gparty = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); golemAlerts = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled)); rngesusAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts)); - lowHealthNotify = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled)); + splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); // Page 5 - stopSalvageStarred = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled)); - watcherReadyMessage = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); - splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); - notifySlayerSlain = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); - flowerWeapons = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); - + lowHealthNotify = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled)); + lividSolver = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled)); + dungeonTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled)); + stopSalvageStarred = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled)); + watcherReadyMessage = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); + notifySlayerSlain = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); + flowerWeapons = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); switch (page) { case 1: this.buttonList.add(changeDisplay); @@ -135,7 +140,7 @@ public class DankerGui extends GuiScreen { break; case 2: this.buttonList.add(coords); - this.buttonList.add(dungeonTimer); + this.buttonList.add(chatMaddox); this.buttonList.add(cakeTimer); this.buttonList.add(skill50Display); this.buttonList.add(slayerCount); @@ -145,13 +150,13 @@ public class DankerGui extends GuiScreen { this.buttonList.add(backPage); break; case 3: - this.buttonList.add(chatMaddox); - this.buttonList.add(gparty); this.buttonList.add(spiritBearAlert); this.buttonList.add(sceptreMessages); this.buttonList.add(midasStaffMessages); this.buttonList.add(implosionMessages); this.buttonList.add(healMessages); + this.buttonList.add(cooldownMessages); + this.buttonList.add(manaMessages); this.buttonList.add(nextPage); this.buttonList.add(backPage); break; @@ -159,19 +164,21 @@ public class DankerGui extends GuiScreen { this.buttonList.add(goldenEnch); this.buttonList.add(petColours); this.buttonList.add(expertiseLore); - this.buttonList.add(lividSolver); + this.buttonList.add(gparty); this.buttonList.add(golemAlerts); this.buttonList.add(rngesusAlert); - this.buttonList.add(lowHealthNotify); + this.buttonList.add(splitFishing); this.buttonList.add(nextPage); this.buttonList.add(backPage); break; case 5: + this.buttonList.add(lowHealthNotify); + this.buttonList.add(lividSolver); + this.buttonList.add(dungeonTimer); this.buttonList.add(stopSalvageStarred); this.buttonList.add(watcherReadyMessage); - this.buttonList.add(splitFishing); this.buttonList.add(notifySlayerSlain); - this.buttonList.add(flowerWeapons); + this.buttonList.add(flowerWeapons); this.buttonList.add(backPage); break; } @@ -304,6 +311,14 @@ public class DankerGui extends GuiScreen { ToggleCommand.healMessages = !ToggleCommand.healMessages; ConfigHandler.writeBooleanConfig("toggles", "HealMessages", ToggleCommand.healMessages); healMessages.displayString = "Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages); + } else if (button == cooldownMessages) { + ToggleCommand.cooldownMessages = !ToggleCommand.cooldownMessages; + ConfigHandler.writeBooleanConfig("toggles", "CooldownMessages", ToggleCommand.cooldownMessages); + cooldownMessages.displayString = "Cooldown Messages: " + Utils.getColouredBoolean(ToggleCommand.cooldownMessages); + } else if (button == manaMessages) { + ToggleCommand.manaMessages = !ToggleCommand.manaMessages; + ConfigHandler.writeBooleanConfig("toggles", "ManaMessages", ToggleCommand.manaMessages); + manaMessages.displayString = "Mana Messages: " + Utils.getColouredBoolean(ToggleCommand.manaMessages); } else if (button == lowHealthNotify) { ToggleCommand.lowHealthNotifyToggled = !ToggleCommand.lowHealthNotifyToggled; ConfigHandler.writeBooleanConfig("toggles", "LowHealthNotify", ToggleCommand.lowHealthNotifyToggled); diff --git a/src/main/java/me/Danker/gui/WarningGui.java b/src/main/java/me/Danker/gui/WarningGui.java new file mode 100644 index 0000000..63b4710 --- /dev/null +++ b/src/main/java/me/Danker/gui/WarningGui.java @@ -0,0 +1,61 @@ +package me.Danker.gui; + +import akka.event.Logging; +import me.Danker.handlers.TextRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiLabel; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +import javax.xml.soap.Text; +import java.util.ArrayList; +import java.util.List; + +public class WarningGui extends GuiScreen { + private GuiButton close; + + public WarningGui(){ + + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + close = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Close"); + + this.buttonList.add(close); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + String text0 = "§cWARNING!§0"; + int text0Width = mc.fontRendererObj.getStringWidth(text0); + new TextRenderer(mc, text0, (int)(width * 0.45) - text0Width / 2, (int) (height * 0.1), 2 ); + String text1 = "You are using SpiderFrog's Old Animations mod."; + int text1Width = mc.fontRendererObj.getStringWidth(text1); + new TextRenderer(mc, text1, width / 2 - text1Width / 2, (int) (height * 0.3), 1D ); + String text2 = "This mod breaks Danker's Skyblock Mod."; + int text2Width = mc.fontRendererObj.getStringWidth(text2); + new TextRenderer(mc, text2, width / 2 - text2Width / 2, (int) (height * 0.4), 1D); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @Override + public void actionPerformed(GuiButton button){ + if(button == close) { + Minecraft.getMinecraft().displayGuiScreen(null); + } + } +} diff --git a/src/main/java/me/Danker/gui/WarningGuiRedirect.java b/src/main/java/me/Danker/gui/WarningGuiRedirect.java new file mode 100644 index 0000000..78e6f18 --- /dev/null +++ b/src/main/java/me/Danker/gui/WarningGuiRedirect.java @@ -0,0 +1,28 @@ +package me.Danker.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +public class WarningGuiRedirect extends GuiMainMenu { + public GuiScreen guiToShow; + private GuiButton close; + + protected void keyTyped(char par1, int par2){} + public WarningGuiRedirect(GuiScreen g){ + guiToShow = g; + } + + public void initGui(){ + super.initGui(); + } + + + public void drawScreen(int par1, int par2, float par3){ + super.drawScreen(par1, par2, par3); + + mc.displayGuiScreen(guiToShow); + } +} diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 7bf6ce2..af61cfe 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -177,18 +177,25 @@ public class ConfigHandler { if (!hasKey("toggles", "SpiritBearAlerts")) writeBooleanConfig("toggles", "SpiritBearAlerts", true); if (!hasKey("toggles", "AOTD")) writeBooleanConfig("toggles", "AOTD", false); if (!hasKey("toggles", "LividDagger")) writeBooleanConfig("toggles", "LividDagger", false); - if (!hasKey("toggles", "SceptreMessages")) writeBooleanConfig("toggles", "SceptreMessages", true); if (!hasKey("toggles", "MidasStaffMessages")) writeBooleanConfig("toggles", "MidasStaffMessages", true); if (!hasKey("toggles", "ImplosionMessages")) writeBooleanConfig("toggles", "ImplosionMessages", true); if (!hasKey("toggles", "HealMessages")) writeBooleanConfig("toggles", "HealMessages", true); if (!hasKey("toggles", "PetColors")) writeBooleanConfig("toggles", "PetColors", false); - if (!hasKey("toggles", "DungeonTimer")) writeBooleanConfig("toggles", "DungeonTimer", false); if (!hasKey("toggles", "BlockSlayer")) writeStringConfig("toggles", "BlockSlayer", ""); if (!hasKey("toggles", "GolemAlerts")) writeBooleanConfig("toggles", "GolemAlerts", false); if (!hasKey("toggles", "ExpertiseLore")) writeBooleanConfig("toggles", "ExpertiseLore", true); if (!hasKey("toggles", "Skill50Display")) writeBooleanConfig("toggles", "Skill50Display", false); if (!hasKey("toggles", "OutlineText")) writeBooleanConfig("toggles", "OutlineText", false); if (!hasKey("toggles", "CakeTimer")) writeBooleanConfig("toggles", "CakeTimer", false); + // Chat Messages + if (!hasKey("toggles", "SceptreMessages")) writeBooleanConfig("toggles", "SceptreMessages", true); + if (!hasKey("toggles", "MidasStaffMessages")) writeBooleanConfig("toggles", "MidasStaffMessages", true); + if (!hasKey("toggles", "ImplosionMessages")) writeBooleanConfig("toggles", "ImplosionMessages", true); + if (!hasKey("toggles", "HealMessages")) writeBooleanConfig("toggles", "HealMessages", true); + if (!hasKey("toggles", "CooldownMessages")) writeBooleanConfig("toggles","CooldownMessages",true); + if (!hasKey("toggles", "ManaMessages")) writeBooleanConfig("toggles","ManaMessages",true); + // Dungeons + if (!hasKey("toggles", "DungeonTimer")) writeBooleanConfig("toggles", "DungeonTimer", false); if (!hasKey("toggles", "LowHealthNotify")) writeBooleanConfig("toggles", "LowHealthNotify", false); if (!hasKey("toggles", "LividSolver")) writeBooleanConfig("toggles", "LividSolver", false); if (!hasKey("toggles", "StopSalvageStarred")) writeBooleanConfig("toggles", "StopSalvageStarred", false); @@ -446,17 +453,21 @@ public class ConfigHandler { ToggleCommand.spiritBearAlerts = getBoolean("toggles", "SpiritBearAlerts"); ToggleCommand.aotdToggled = getBoolean("toggles", "AOTD"); ToggleCommand.lividDaggerToggled = getBoolean("toggles", "LividDagger"); - ToggleCommand.sceptreMessages = getBoolean("toggles", "SceptreMessages"); - ToggleCommand.midasStaffMessages = getBoolean("toggles", "MidasStaffMessages"); - ToggleCommand.implosionMessages = getBoolean("toggles", "ImplosionMessages"); - ToggleCommand.healMessages = getBoolean("toggles", "HealMessages"); ToggleCommand.petColoursToggled = getBoolean("toggles", "PetColors"); - ToggleCommand.dungeonTimerToggled = getBoolean("toggles", "DungeonTimer"); ToggleCommand.golemAlertToggled = getBoolean("toggles", "GolemAlerts"); ToggleCommand.expertiseLoreToggled = getBoolean("toggles", "ExpertiseLore"); ToggleCommand.skill50DisplayToggled = getBoolean("toggles", "Skill50Display"); ToggleCommand.outlineTextToggled = getBoolean("toggles", "OutlineText"); ToggleCommand.cakeTimerToggled = getBoolean("toggles", "CakeTimer"); + // Chat Messages + ToggleCommand.sceptreMessages = getBoolean("toggles", "SceptreMessages"); + ToggleCommand.midasStaffMessages = getBoolean("toggles", "MidasStaffMessages"); + ToggleCommand.implosionMessages = getBoolean("toggles", "ImplosionMessages"); + ToggleCommand.healMessages = getBoolean("toggles", "HealMessages"); + ToggleCommand.cooldownMessages = getBoolean("toggles", "CooldownMessages"); + ToggleCommand.manaMessages = getBoolean("toggles", "ManaMessages"); + //Dungeons + ToggleCommand.dungeonTimerToggled = getBoolean("toggles", "DungeonTimer"); ToggleCommand.lowHealthNotifyToggled = getBoolean("toggles", "LowHealthNotify"); ToggleCommand.lividSolverToggled = getBoolean("toggles", "LividSolver"); ToggleCommand.stopSalvageStarredToggled = getBoolean("toggles", "StopSalvageStarred"); |