diff options
author | Cow <cow@volloeko.de> | 2021-03-20 14:47:00 +0100 |
---|---|---|
committer | Cow <cow@volloeko.de> | 2021-03-20 14:47:00 +0100 |
commit | b3ec6cd425b6ae5d2795a32369f0f12792b2beaf (patch) | |
tree | 1a5801a5a286473511a125081fb841262fed6abc | |
parent | 27811afe485ce639bbc920d885fb98d4b052bcc6 (diff) | |
download | Cowlection-b3ec6cd425b6ae5d2795a32369f0f12792b2beaf.tar.gz Cowlection-b3ec6cd425b6ae5d2795a32369f0f12792b2beaf.tar.bz2 Cowlection-b3ec6cd425b6ae5d2795a32369f0f12792b2beaf.zip |
Added min Dungeon lvl req to Party Finder
4 files changed, 26 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 5acff3c..ce92476 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - only works on enchanted books with *one* enchantment - enabled for all ultimate and Turbo-crop enchantments - additional enchantments can be added via `/moo config` *(Keep in mind that not all high-level enchantments can be created by combining lower level books!)* +- SkyBlock Dungeon Party Finder additions: + - new `/moo config` option: `Minimum "Dungeon level required"` ### Changed - Refined the comma representation of large numbers abbreviated with k, m, b diff --git a/src/main/java/de/cowtipper/cowlection/config/MooConfig.java b/src/main/java/de/cowtipper/cowlection/config/MooConfig.java index a19218e..d23592b 100644 --- a/src/main/java/de/cowtipper/cowlection/config/MooConfig.java +++ b/src/main/java/de/cowtipper/cowlection/config/MooConfig.java @@ -100,6 +100,7 @@ public class MooConfig { public static boolean dungPartyFullLookup; public static boolean dungPartyFinderPartyLookup; public static boolean dungPartiesSize; + public static int dungDungeonReqMin; public static int dungClassMin; private static String dungMarkPartiesWithCarry; private static String dungMarkPartiesWithHyperion; @@ -524,8 +525,10 @@ public class MooConfig { "Marks parties...", " ‣ you cannot join: " + EnumChatFormatting.RED + "⬛", " ‣ that do not meet all your criteria: " + EnumChatFormatting.GOLD + "⬛", + " ‣ with \"Dungeon Level Required\" below a certain level " + EnumChatFormatting.GRAY + "(if present)" + EnumChatFormatting.RESET + ": " + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + "ᐯ" + EnumChatFormatting.RESET, " ‣ with someone below a certain class level: " + EnumChatFormatting.RED + EnumChatFormatting.BOLD + "ᐯ" + EnumChatFormatting.RESET, - " ‣ with duplicated roles you specify below: " + EnumChatFormatting.GOLD + "²⁺", + " ‣ with duplicated roles you specify: " + EnumChatFormatting.GOLD + "²⁺", + " ‣ with someone with a role you specify: " + EnumChatFormatting.GRAY + "e.g. " + EnumChatFormatting.WHITE + "H " + EnumChatFormatting.GRAY + "(class' 1ˢᵗ letter)", " ‣ that match your criteria: " + EnumChatFormatting.GREEN + "⬛"); Property propDungPartyFinderPlayerLookup = subCat.addConfigEntry(cfg.get(configCat.getConfigName(), @@ -541,6 +544,11 @@ public class MooConfig { "dungPartiesSize", true, "Show size of parties?"), new MooConfigPreview(new MooChatComponent("Marked with: " + EnumChatFormatting.WHITE + "1 - 4").gray())); + Property propDungDungeonReqMin = subCat.addConfigEntry(cfg.get(configCat.getConfigName(), + "dungDungeonReqMin", 0, "Marks parties with lower Dungeon level req than this value") + .setMinValue(0).setMaxValue(50), + new MooConfigPreview(new MooChatComponent("Marked with: " + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + "ᐯ").gray())); + Property propDungClassMin = subCat.addConfigEntry(cfg.get(configCat.getConfigName(), "dungClassMin", 0, "Marks parties with members with lower class level than this value") .setMinValue(0).setMaxValue(50), @@ -634,6 +642,7 @@ public class MooConfig { dungPartyFullLookup = propDungPartyFullLookup.getBoolean(); dungPartyFinderPartyLookup = propDungPartyFinderPartyLookup.getBoolean(); dungPartiesSize = propDungPartiesSize.getBoolean(); + dungDungeonReqMin = propDungDungeonReqMin.getInt(); dungClassMin = propDungClassMin.getInt(); dungMarkPartiesWithCarry = propDungMarkPartiesWithCarry.getString(); dungMarkPartiesWithHyperion = propDungMarkPartiesWithHyperion.getString(); @@ -704,6 +713,7 @@ public class MooConfig { propDungPartyFullLookup.set(dungPartyFullLookup); propDungPartyFinderPartyLookup.set(dungPartyFinderPartyLookup); propDungPartiesSize.set(dungPartiesSize); + propDungDungeonReqMin.set(dungDungeonReqMin); propDungClassMin.set(dungClassMin); propDungMarkPartiesWithCarry.set(dungMarkPartiesWithCarry); propDungMarkPartiesWithHyperion.set(dungMarkPartiesWithHyperion); 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 deb4385..5ae3846 100644 --- a/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java +++ b/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java @@ -307,6 +307,7 @@ public class DungeonsListener { int partySize = 5; boolean memberTooLowLevel = false; + boolean partyReqTooLowLevel = false; String middleText = null; for (String toolTipLine : itemTooltip) { @@ -328,6 +329,7 @@ public class DungeonsListener { String partyNote = toolTipLineWithoutFormatting.toLowerCase(); DataHelper.PartyType partyTypeCarry = MooConfig.getDungPartyFinderMarkCarry(); DataHelper.PartyType partyTypeHyperion = MooConfig.getDungPartyFinderMarkHyperion(); + // TODO make trigger words in party notes configurable if (partyTypeCarry != DataHelper.PartyType.NONE && (partyNote.contains("carry") || partyNote.contains("carries"))) { partyType = partyTypeCarry; if (partyTypeCarry != DataHelper.PartyType.UNJOINABLE) { @@ -339,6 +341,11 @@ public class DungeonsListener { middleText = "hyper"; } } + } else if (toolTipLineWithoutFormatting.startsWith("Dungeon Level Required: ")) { + int minDungLevelReq = MathHelper.parseIntWithDefault(toolTipLineWithoutFormatting.substring(toolTipLineWithoutFormatting.lastIndexOf(' ') + 1), 100); + if (minDungLevelReq < MooConfig.dungDungeonReqMin) { + partyReqTooLowLevel = true; + } } } FontRenderer font = Minecraft.getMinecraft().fontRendererObj; @@ -351,12 +358,12 @@ public class DungeonsListener { GlStateManager.popMatrix(); } if (partyType != DataHelper.PartyType.UNJOINABLE) { - if (memberTooLowLevel) { - // at least one party member is lower than the min class level + if (memberTooLowLevel || partyReqTooLowLevel) { + // at least one party member is lower than the min class level or party min Dungeon level req is too low partyType = DataHelper.PartyType.UNIDEAL; GlStateManager.pushMatrix(); GlStateManager.translate(0, 0, 280); - font.drawStringWithShadow(EnumChatFormatting.BOLD + "ᐯ", x + 1, y + 8, new Color(220, 20, 20, 255).getRGB()); + font.drawStringWithShadow(EnumChatFormatting.BOLD + "ᐯ", x + 1, y + 8, partyReqTooLowLevel ? new Color(170, 0, 0).getRGB() : new Color(220, 20, 20, 255).getRGB()); GlStateManager.popMatrix(); } StringBuilder unwantedClasses = new StringBuilder(); @@ -394,7 +401,7 @@ public class DungeonsListener { GlStateManager.scale(scaleFactor, scaleFactor, 0); font.drawStringWithShadow(badClasses.toString(), (float) (x / scaleFactor), (float) (y / scaleFactor), new Color(255, 170, 0, 255).getRGB()); GlStateManager.popMatrix(); - } else if (!memberTooLowLevel && middleText == null) { + } else if (!memberTooLowLevel && !partyReqTooLowLevel && middleText == null) { // party matches our criteria! partyType = DataHelper.PartyType.SUITABLE; } diff --git a/src/main/resources/assets/cowlection/lang/en_US.lang b/src/main/resources/assets/cowlection/lang/en_US.lang index c531329..6836fd4 100644 --- a/src/main/resources/assets/cowlection/lang/en_US.lang +++ b/src/main/resources/assets/cowlection/lang/en_US.lang @@ -96,6 +96,8 @@ cowlection.config.dungPartyFinderPartyLookup=Lookup info when joining another pa cowlection.config.dungPartyFinderPartyLookup.tooltip=Lookup armor and dungeons stats of each party member when joining via party finder?\n§7Alternatively: §e/moo dungeon party §7or §e/m dp\n§d§l⚷ §eRequires a valid API key! cowlection.config.dungPartiesSize=Show party sizes? cowlection.config.dungPartiesSize.tooltip=Show sizes of parties? +cowlection.config.dungDungeonReqMin=Minimum "Dungeon level required" +cowlection.config.dungDungeonReqMin.tooltip=Marks parties with lower "Dungeon level required" set than this value cowlection.config.dungClassMin=Minimum preferred class level cowlection.config.dungClassMin.tooltip=Marks parties with members with lower class level than this value cowlection.config.dungMarkPartiesWithCarry=Mark 'carry' parties? |