diff --git a/src/main/java/me/zeroeightsix/kami/command/Command.java b/src/main/java/me/zeroeightsix/kami/command/Command.java index dedaca99..e50c726e 100644 --- a/src/main/java/me/zeroeightsix/kami/command/Command.java +++ b/src/main/java/me/zeroeightsix/kami/command/Command.java @@ -2,6 +2,7 @@ package me.zeroeightsix.kami.command; import me.zeroeightsix.kami.KamiMod; import me.zeroeightsix.kami.command.syntax.SyntaxChunk; +import me.zeroeightsix.kami.module.ModuleManager; import me.zeroeightsix.kami.setting.Setting; import me.zeroeightsix.kami.setting.Settings; import me.zeroeightsix.kami.util.Wrapper; @@ -53,6 +54,15 @@ public abstract class Command { for (String s : messages) sendRawChatMessage(s); } + public static void sendDisableMessage(String moduleName) { + sendErrorMessage("Error: The " + moduleName + " module is only for configuring the GUI element. In order to show the GUI element you need to hit the pin in the upper left of the module"); + ModuleManager.getModuleByName(moduleName).enable(); + } + + public static void sendAutoDisableMessage(String moduleName, boolean startup) { + if (startup) sendWarningMessage("Note: The " + moduleName + " module has automatic startup enabled. If you want to keep it disabled, disable the automatic startup setting"); + } + public static void sendRawChatMessage(String message) { if (Minecraft.getMinecraft().player != null) { Wrapper.getPlayer().sendMessage(new ChatMessage(message)); diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/capes/Capes.java b/src/main/java/me/zeroeightsix/kami/module/modules/capes/Capes.java index fcfb302d..f64ec3df 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/capes/Capes.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/capes/Capes.java @@ -2,6 +2,7 @@ package me.zeroeightsix.kami.module.modules.capes; import com.google.gson.Gson; import me.zeroeightsix.kami.KamiMod; +import me.zeroeightsix.kami.command.Command; import me.zeroeightsix.kami.util.Wrapper; import me.zeroeightsix.kami.setting.Setting; import me.zeroeightsix.kami.setting.Settings; @@ -152,4 +153,6 @@ public class Capes extends Module { textureManager.loadTexture(location, textureCape); } } + + public void onDisable() { Command.sendAutoDisableMessage(getName(), startupGlobal.getValue()); } } diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/chat/CustomChat.java b/src/main/java/me/zeroeightsix/kami/module/modules/chat/CustomChat.java index 06df7e45..43f20375 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/chat/CustomChat.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/chat/CustomChat.java @@ -76,4 +76,6 @@ public class CustomChat extends Module { startTime = System.currentTimeMillis(); } } + + public void onDisable() { Command.sendAutoDisableMessage(getName(), startupGlobal.getValue()); } } diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/gui/CleanGUI.java b/src/main/java/me/zeroeightsix/kami/module/modules/gui/CleanGUI.java index 329d63a7..8bd0ea7c 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/gui/CleanGUI.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/gui/CleanGUI.java @@ -1,5 +1,6 @@ package me.zeroeightsix.kami.module.modules.gui; +import me.zeroeightsix.kami.command.Command; import me.zeroeightsix.kami.module.Module; import me.zeroeightsix.kami.setting.Setting; import me.zeroeightsix.kami.setting.Settings; @@ -25,4 +26,5 @@ public class CleanGUI extends Module { return INSTANCE.isEnabled(); } + public void onDisable() { Command.sendAutoDisableMessage(getName(), startupGlobal.getValue()); } } diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/gui/InfoOverlay.java b/src/main/java/me/zeroeightsix/kami/module/modules/gui/InfoOverlay.java index f8569270..10d8f841 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/gui/InfoOverlay.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/gui/InfoOverlay.java @@ -16,6 +16,7 @@ import net.minecraft.util.text.TextFormatting; import java.util.ArrayList; +import static me.zeroeightsix.kami.command.Command.sendDisableMessage; import static me.zeroeightsix.kami.util.ColourUtils.getStringColour; /** @@ -119,5 +120,5 @@ public class InfoOverlay extends Module { return infoContents; } - public void onDisable() { enable(); } + public void onDisable() { sendDisableMessage(getName()); } } diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/gui/InventoryViewer.java b/src/main/java/me/zeroeightsix/kami/module/modules/gui/InventoryViewer.java index b2a357ef..b4e661b3 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/gui/InventoryViewer.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/gui/InventoryViewer.java @@ -164,6 +164,5 @@ public class InventoryViewer extends Module { GlStateManager.popMatrix(); } - @Override - public void onDisable() { enable(); } + public void onDisable() { sendDisableMessage(getName()); } } diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/gui/PrefixChat.java b/src/main/java/me/zeroeightsix/kami/module/modules/gui/PrefixChat.java index 916a1163..af7b8586 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/gui/PrefixChat.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/gui/PrefixChat.java @@ -1,5 +1,6 @@ package me.zeroeightsix.kami.module.modules.gui; +import me.zeroeightsix.kami.command.Command; import me.zeroeightsix.kami.module.Module; import me.zeroeightsix.kami.setting.Setting; import me.zeroeightsix.kami.setting.Settings; @@ -7,4 +8,6 @@ import me.zeroeightsix.kami.setting.Settings; @Module.Info(name = "PrefixChat", category = Module.Category.GUI, description = "Opens chat with prefix inside when prefix is pressed.", showOnArray = Module.ShowOnArray.OFF) public class PrefixChat extends Module { public Setting startupGlobal = register(Settings.b("Enable Automatically", true)); + + public void onDisable() { Command.sendAutoDisableMessage(getName(), startupGlobal.getValue()); } } diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/misc/DiscordSettings.java b/src/main/java/me/zeroeightsix/kami/module/modules/misc/DiscordSettings.java index e61cc2e8..afd815fa 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/misc/DiscordSettings.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/misc/DiscordSettings.java @@ -68,4 +68,5 @@ public class DiscordSettings extends Module { } } + public void onDisable() { Command.sendAutoDisableMessage(getName(), startupGlobal.getValue()); } } diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/render/TabFriends.java b/src/main/java/me/zeroeightsix/kami/module/modules/render/TabFriends.java index 27e18369..2b78d499 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/render/TabFriends.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/render/TabFriends.java @@ -1,6 +1,7 @@ package me.zeroeightsix.kami.module.modules.render; import me.zeroeightsix.kami.KamiMod; +import me.zeroeightsix.kami.command.Command; import me.zeroeightsix.kami.module.Module; import me.zeroeightsix.kami.setting.Setting; import me.zeroeightsix.kami.setting.Settings; @@ -23,4 +24,6 @@ public class TabFriends extends Module { if (Friends.isFriend(dname)) return String.format("%sa%s", KamiMod.colour, dname); return dname; } + + public void onDisable() { Command.sendAutoDisableMessage(getName(), startupGlobal.getValue()); } }