diff options
Diffstat (limited to 'src/main/java/at')
6 files changed, 155 insertions, 123 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java index 5b0e7e9ff..61ceee900 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java @@ -595,6 +595,51 @@ public class CombatConfig { } @Expose + @ConfigOption(name = "Bestiary", desc = "") + @Accordion + public BestiaryConfig bestiary = new BestiaryConfig(); + + public static class BestiaryConfig { + @Expose + @ConfigOption(name = "Enable", desc = "Show Bestiary Data overlay in the Bestiary menu.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = false; + + @Expose + @ConfigOption(name = "Number format", desc = "Short: 1.1k\nLong: 1.100") + @ConfigEditorDropdown(values = {"Short", "Long"}) + public int numberFormat = 0; + + @Expose + @ConfigOption(name = "Display type", desc = "Choose what the display should show") + @ConfigEditorDropdown(values = { + "Global to max", + "Global to next tier", + "Lowest total kills", + "Highest total kills", + "Lowest kills needed to max", + "Highest kills needed to max", + "Lowest kills needed to next tier", + "Highest kills needed to next tier" + }) + public int displayType = 0; + + @Expose + @ConfigOption(name = "Hide maxed", desc = "Hide maxed mobs") + @ConfigEditorBoolean + public boolean hideMaxed = false; + + @Expose + @ConfigOption(name = "Replace Romans", desc = "Replace Roman numerals (IX) with regular numbers (9)") + @ConfigEditorBoolean + public boolean replaceRoman = false; + + @Expose + public Position position = new Position(100, 100, false, true); + } + + @Expose @ConfigOption(name = "Hide Damage Splash", desc = "Hide all damage splashes anywhere in SkyBlock.") @ConfigEditorBoolean @FeatureToggle diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java index f8b5d0e43..a76c49858 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java @@ -7,6 +7,10 @@ import io.github.moulberry.moulconfig.annotations.*; import io.github.moulberry.moulconfig.observer.Property; import org.lwjgl.input.Keyboard; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + public class EventConfig { @ConfigOption(name = "Monthly Bingo", desc = "") @@ -190,6 +194,88 @@ public class EventConfig { public boolean petWarning = true; } + @ConfigOption(name = "Winter Season on Jerry's Island", desc = "") + @Accordion + @Expose + public WinterConfig winter = new WinterConfig(); + + public static class WinterConfig { + + @Expose + @ConfigOption(name = "Frozen Treasure Tracker", desc = "") + @Accordion + public FrozenTreasureConfig frozenTreasureTracker = new FrozenTreasureConfig(); + + public static class FrozenTreasureConfig { + + @Expose + @ConfigOption( + name = "Enabled", + desc = "Tracks all of your drops from Frozen Treasure in the Glacial Caves.\n" + + "§eIce calculations are an estimate but are relatively accurate." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = true; + + @Expose + @ConfigOption( + name = "Text Format", + desc = "Drag text to change the appearance of the overlay." + ) + @ConfigEditorDraggableList( + exampleText = { + "§1§lFrozen Treasure Tracker", + "§61,636 Treasures Mined", + "§33.2m Total Ice", + "§3342,192 Ice/hr", + "§81,002 Compact Procs", + " ", + "§b182 §fWhite Gift", + "§b94 §aGreen Gift", + "§b17 §9§cRed Gift", + "§b328 §fPacked Ice", + "§b80 §aEnchanted Ice", + "§b4 §9Enchanted Packed Ice", + "§b182 §aIce Bait", + "§b3 §aGlowy Chum Bait", + "§b36 §5Glacial Fragment", + "§b6 §fGlacial Talisman", + " ", + } + ) + public List<Integer> textFormat = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 14, 15)); + + @Expose + @ConfigOption(name = "Only in Glacial Cave", desc = "Only shows the overlay while in the Glacial Cave.") + @ConfigEditorBoolean + public boolean onlyInCave = true; + + @Expose + @ConfigOption(name = "Show as drops", desc = "Multiplies the numbers on the display by the base drop. \n" + + "E.g. 3 Ice Bait -> 48 Ice Bait") + @ConfigEditorBoolean + public boolean showAsDrops = false; + + @Expose + @ConfigOption(name = "Hide Chat messages", desc = "Hides the chat messages from Frozen Treasures.") + @ConfigEditorBoolean + public boolean hideMessages = false; + + @Expose + public Position position = new Position(10, 80, false, true); + } + + @Expose + @ConfigOption(name = "Island Close Time", desc = "While on the Winter Island, show a timer until Jerry's Workshop closes.") + @ConfigEditorBoolean + @FeatureToggle + public boolean islandCloseTime = true; + + @Expose + public Position islandCloseTimePosition = new Position(10, 10, false, true); + + } // comment in if the event is needed again // @ConfigOption(name = "300þ Anniversary Celebration", desc = "Features for the 300þ year of SkyBlock") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java index 9ea25e9cf..bd231257d 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -70,15 +70,6 @@ public class MiscConfig { @Expose public Position realTimePos = new Position(10, 10, false, true); - - @Expose - @ConfigOption(name = "Winter Time", desc = "While on the Winter Island, show a timer until Jerry's Workshop closes.") - @ConfigEditorBoolean - @FeatureToggle - public boolean winterTime = true; - - @Expose - public Position winterTimePos = new Position(10, 10, false, true); } @ConfigOption(name = "Hide Armor", desc = "") @@ -464,71 +455,6 @@ public class MiscConfig { } @Expose - @ConfigOption(name = "Frozen Treasure Tracker", desc = "") - @Accordion - public MiscConfig.FrozenTreasureTracker frozenTreasureTracker = new MiscConfig.FrozenTreasureTracker(); - - public static class FrozenTreasureTracker { - - @Expose - @ConfigOption( - name = "Enabled", - desc = "Tracks all of your drops from Frozen Treasure in the Glacial Caves.\n" + - "§eIce calculations are an estimate but are relatively accurate." - ) - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = true; - - @Expose - @ConfigOption( - name = "Text Format", - desc = "Drag text to change the appearance of the overlay." - ) - @ConfigEditorDraggableList( - exampleText = { - "§1§lFrozen Treasure Tracker", - "§61,636 Treasures Mined", - "§33.2m Total Ice", - "§3342,192 Ice/hr", - "§81,002 Compact Procs", - " ", - "§b182 §fWhite Gift", - "§b94 §aGreen Gift", - "§b17 §9§cRed Gift", - "§b328 §fPacked Ice", - "§b80 §aEnchanted Ice", - "§b4 §9Enchanted Packed Ice", - "§b182 §aIce Bait", - "§b3 §aGlowy Chum Bait", - "§b36 §5Glacial Fragment", - "§b6 §fGlacial Talisman", - " ", - } - ) - public List<Integer> textFormat = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 14, 15)); - - @Expose - @ConfigOption(name = "Only in Glacial Cave", desc = "Only shows the overlay while in the Glacial Cave.") - @ConfigEditorBoolean - public boolean onlyInCave = true; - - @Expose - @ConfigOption(name = "Show as drops", desc = "Multiplies the numbers on the display by the base drop. \n" + - "E.g. 3 Ice Bait -> 48 Ice Bait") - @ConfigEditorBoolean - public boolean showAsDrops = false; - - @Expose - @ConfigOption(name = "Hide Chat messages", desc = "Hides the chat messages from Frozen Treasures.") - @ConfigEditorBoolean - public boolean hideMessages = false; - - @Expose - public Position position = new Position(10, 80, false, true); - } - - @Expose @ConfigOption(name = "Ender Node Tracker", desc = "") @Accordion public EnderNodeTracker enderNodeTracker = new EnderNodeTracker(); @@ -608,51 +534,6 @@ public class MiscConfig { } @Expose - @ConfigOption(name = "Bestiary Data", desc = "") - @Accordion - public BestiaryDataConfig bestiaryData = new BestiaryDataConfig(); - - public static class BestiaryDataConfig { - @Expose - @ConfigOption(name = "Enable", desc = "Show Bestiary Data overlay in the Bestiary menu.") - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = false; - - @Expose - @ConfigOption(name = "Number format", desc = "Short: 1.1k\nLong: 1.100") - @ConfigEditorDropdown(values = {"Short", "Long"}) - public int numberFormat = 0; - - @Expose - @ConfigOption(name = "Display type", desc = "Choose what the display should show") - @ConfigEditorDropdown(values = { - "Global to max", - "Global to next tier", - "Lowest total kills", - "Highest total kills", - "Lowest kills needed to max", - "Highest kills needed to max", - "Lowest kills needed to next tier", - "Highest kills needed to next tier" - }) - public int displayType = 0; - - @Expose - @ConfigOption(name = "Hide maxed", desc = "Hide maxed mobs") - @ConfigEditorBoolean - public boolean hideMaxed = false; - - @Expose - @ConfigOption(name = "Replace Romans", desc = "Replace Roman numerals (IX) with regular numbers (9)") - @ConfigEditorBoolean - public boolean replaceRoman = false; - - @Expose - public Position position = new Position(100, 100, false, true); - } - - @Expose @ConfigOption(name = "Cosmetic", desc = "") @Accordion public CosmeticConfig cosmeticConfig = new CosmeticConfig(); diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/BestiaryData.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/BestiaryData.kt index 949a326a9..6b33e0b47 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/BestiaryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/BestiaryData.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -28,7 +29,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object BestiaryData { - private val config get() = SkyHanniMod.feature.misc.bestiaryData + private val config get() = SkyHanniMod.feature.combat.bestiary private var display = emptyList<List<Any>>() private val mobList = mutableListOf<BestiaryMob>() private val stackList = mutableMapOf<Int, ItemStack>() @@ -95,6 +96,11 @@ object BestiaryData { inInventory = false } + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(2, "misc.bestiaryData", "combat.bestiary") + } + private fun update() { display = drawDisplay() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/FrozenTreasureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/FrozenTreasureTracker.kt index eb99d1674..e80c5b15b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/FrozenTreasureTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/FrozenTreasureTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.Storage import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.ProfileStorageData @@ -21,7 +22,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.concurrent.fixedRateTimer class FrozenTreasureTracker { - private val config get() = SkyHanniMod.feature.misc.frozenTreasureTracker + private val config get() = SkyHanniMod.feature.event.winter.frozenTreasureTracker private var display = emptyList<List<Any>>() private var estimatedIce = 0L private var lastEstimatedIce = 0L @@ -150,6 +151,11 @@ class FrozenTreasureTracker { config.position.renderStringsAndItems(display, posLabel = "Frozen Treasure Tracker") } + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(2, "misc.frozenTreasureTracker", "event.winter.frozenTreasureTracker") + } + private fun onJerryWorkshop() = LorenzUtils.inIsland(IslandType.WINTER) private fun inGlacialCave() = onJerryWorkshop() && ScoreboardData.sidebarLinesFormatted.contains(" §7⏣ §3Glacial Cave") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt index b8f41204b..0ec010924 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.utils.LorenzUtils @@ -17,6 +18,7 @@ import kotlin.time.Duration.Companion.seconds class TimeFeatures { private val config get() = SkyHanniMod.feature.misc.timeConfigs + private val winterConfig get() = SkyHanniMod.feature.event.winter private val format = SimpleDateFormat("HH:mm:ss") @@ -32,7 +34,7 @@ class TimeFeatures { config.realTimePos.renderString(format.format(System.currentTimeMillis()), posLabel = "Real Time") } - if (config.winterTime && IslandType.WINTER.isInIsland()) { + if (winterConfig.islandCloseTime && IslandType.WINTER.isInIsland()) { val timeTillNextYear = startOfNextYear.getValue().timeUntil() val alreadyInNextYear = timeTillNextYear > 5.days val text = if (alreadyInNextYear) { @@ -40,7 +42,13 @@ class TimeFeatures { } else { "§fJerry's Workshop §ecloses in §b${timeTillNextYear.format()}" } - config.winterTimePos.renderString(text, posLabel = "Winter Time") + winterConfig.islandCloseTimePosition.renderString(text, posLabel = "Winter Time") } } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(2, "misc.timeConfigs.winterTime", "event.winter.islandCloseTime") + event.move(2, "misc.timeConfigs.winterTimePos", "event.winter.islandCloseTimePosition") + } }
\ No newline at end of file |