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/de/cowtipper/cowlection/config | |
| 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/de/cowtipper/cowlection/config')
| -rw-r--r-- | src/main/java/de/cowtipper/cowlection/config/MooConfig.java | 24 |
1 files changed, 24 insertions, 0 deletions
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); } |
