diff options
author | Cow <cow@volloeko.de> | 2021-03-29 01:50:55 +0200 |
---|---|---|
committer | Cow <cow@volloeko.de> | 2021-03-29 01:50:55 +0200 |
commit | 911e7b32e781b327fb87f7229bfea34389636b5d (patch) | |
tree | 3bad42657faf8f258e2b81cfc7c4894dc1d36168 /src/main/java | |
parent | ac07fa07ec3fba56fad189c10866e7b22f232434 (diff) | |
download | Cowlection-911e7b32e781b327fb87f7229bfea34389636b5d.tar.gz Cowlection-911e7b32e781b327fb87f7229bfea34389636b5d.tar.bz2 Cowlection-911e7b32e781b327fb87f7229bfea34389636b5d.zip |
Added mini-"tutorial" to open config gui
Diffstat (limited to 'src/main/java')
3 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/command/MooCommand.java b/src/main/java/de/cowtipper/cowlection/command/MooCommand.java index 2f941c0..52dee14 100644 --- a/src/main/java/de/cowtipper/cowlection/command/MooCommand.java +++ b/src/main/java/de/cowtipper/cowlection/command/MooCommand.java @@ -129,6 +129,7 @@ public class MooCommand extends CommandBase { //endregion //region sub-commands: miscellaneous else if (args[0].equalsIgnoreCase("config")) { + main.getConfig().theyOpenedTheConfigGui(); displayGuiScreen(new MooConfigGui()); } else if (args[0].equalsIgnoreCase("search")) { displayGuiScreen(new GuiSearch(main.getConfigDirectory(), CommandBase.buildString(args, 1))); diff --git a/src/main/java/de/cowtipper/cowlection/config/MooConfig.java b/src/main/java/de/cowtipper/cowlection/config/MooConfig.java index d23592b..5a9750d 100644 --- a/src/main/java/de/cowtipper/cowlection/config/MooConfig.java +++ b/src/main/java/de/cowtipper/cowlection/config/MooConfig.java @@ -50,6 +50,7 @@ import java.util.regex.Pattern; public class MooConfig { // Category: General private static String configGuiExplanations; + public static boolean hasOpenedConfigGui; public static String mooCmdAlias; public static boolean fixReplyCmd; public static boolean enableCopyInventory; @@ -252,6 +253,12 @@ public class MooConfig { "configGuiExplanations", "tooltip ① §0⬛", "Display config settings explanations", new String[]{"as tooltip ①§0⬛", "as tooltip ②§f⬛", "as text", "hidden"})); + + // (not visible in config gui: has opened config? or: knows how to move the dungeon overlay?) + Property propHasOpenedConfigGui = cfg.get(configCat.getConfigName(), + "hasOpenedConfigGui", false, "Already opened config gui?") + .setShowInGui(false); + // Sub-Category: API settings subCat = configCat.addSubCategory("API settings"); subCat.addExplanations("Some features use the official Hypixel API and therefore require your API key.", @@ -594,6 +601,7 @@ public class MooConfig { if (readFieldsFromConfig) { // Category: General configGuiExplanations = propConfigGuiExplanations.getString(); + hasOpenedConfigGui = propHasOpenedConfigGui.getBoolean(); mooCmdAlias = propMooCmdAlias.getString(); fixReplyCmd = propFixReplyCmd.getBoolean(); enableCopyInventory = propEnableCopyInventory.getBoolean(); @@ -652,6 +660,10 @@ public class MooConfig { dungMarkPartiesWithMage = propDungMarkPartiesWithMage.getString(); dungMarkPartiesWithTank = propDungMarkPartiesWithTank.getString(); + if (!hasOpenedConfigGui && (!propDungOverlayEnabled.isDefault() || !propDungOverlayPositionX.isDefault() || !propDungOverlayPositionY.isDefault() || !propDungOverlayGuiScale.isDefault())) { + // player hasn't opened config gui yet and but already moved the dungeon overlay + hasOpenedConfigGui = true; + } if (!StringUtils.equals(mooCmdAliasPreChange, mooCmdAlias)) { modifiedMooCmdAlias = true; } @@ -665,6 +677,7 @@ public class MooConfig { // Category: General propConfigGuiExplanations.set(configGuiExplanations); + propHasOpenedConfigGui.set(hasOpenedConfigGui); propMooCmdAlias.set(mooCmdAlias); propFixReplyCmd.set(fixReplyCmd); propEnableCopyInventory.set(enableCopyInventory); @@ -816,6 +829,17 @@ public class MooConfig { return Setting.get(configGuiExplanations); } + public void theyOpenedTheConfigGui() { + if (!hasOpenedConfigGui) { + // opened config gui for the first time! + main.getChatHelper().sendMessage(new MooChatComponent(EnumChatFormatting.DARK_GREEN + " ❢ " + EnumChatFormatting.GREEN + "To configure " + EnumChatFormatting.GOLD + "Cowlection " + EnumChatFormatting.GREEN + "features use " + EnumChatFormatting.LIGHT_PURPLE + "/moo config").green() + .setSuggestCommand("/moo config") + .appendFreshSibling(new MooChatComponent(" (this message will be displayed only once)").gray())); + hasOpenedConfigGui = true; + syncFromFields(); + } + } + public static boolean keepFullWailaInfo() { return "all info".equals(wailaLevelOfDetail); } diff --git a/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java b/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java index 106a8c6..69c794a 100644 --- a/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java +++ b/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java @@ -642,6 +642,11 @@ public class DungeonsListener { } else if (elapsedMinutes > 20) { dungeonPerformanceEntries.add(EnumChatFormatting.GOLD + " Time penalty: " + EnumChatFormatting.RED + ((int) (2.2 * (elapsedMinutes - 20))) + " points"); } + if (!MooConfig.hasOpenedConfigGui) { + dungeonPerformanceEntries.add(EnumChatFormatting.RED + "Want to move me? " + EnumChatFormatting.LIGHT_PURPLE + "/moo config " + + EnumChatFormatting.DARK_GRAY + "➡ " + EnumChatFormatting.WHITE + "SB Dungeons " + + EnumChatFormatting.DARK_GRAY + "➡ " + EnumChatFormatting.WHITE + "Performance Overlay"); + } FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; GlStateManager.pushMatrix(); |