diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
7 files changed, 30 insertions, 16 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt index 9de3e4eba..e762273f0 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt @@ -11,7 +11,7 @@ import com.google.gson.JsonPrimitive object ConfigUpdaterMigrator { val logger = LorenzLogger("ConfigMigration") - const val CONFIG_VERSION = 32 + const val CONFIG_VERSION = 33 fun JsonElement.at(chain: List<String>, init: Boolean): JsonElement? { if (chain.isEmpty()) return this if (this !is JsonObject) return null diff --git a/src/main/java/at/hannibal2/skyhanni/config/enums/OutsideSbFeature.kt b/src/main/java/at/hannibal2/skyhanni/config/enums/OutsideSbFeature.kt index de4296955..c407de4f2 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/enums/OutsideSbFeature.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/enums/OutsideSbFeature.kt @@ -9,9 +9,10 @@ enum class OutsideSbFeature(private val displayName: String) { TPS_DISPLAY("TPS Display"), MARKED_PLAYERS("Marked Players"), FARMING_WEIGHT("Farming Weight"), - NEXT_JACOB_CONTEXT("Next Jacobs's Context"), + NEXT_JACOB_CONTEST("Next Jacobs's Contest"), COMPOSTER_TIME("Composter Time"), YAW_AND_PITCH("Yaw and Pitch"), + ATMOSPHERIC_FILTER("Atmospheric Filter"), QUICK_MOD_MENU_SWITCH("Quick Mod Menu Switch"), FOLLOWING_LINE("Following Line"), ARROW_TRAIL("Arrow Trail"), diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/AtmosphericFilterDisplayConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/AtmosphericFilterDisplayConfig.java index 23a0ae259..543cd252b 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/AtmosphericFilterDisplayConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/AtmosphericFilterDisplayConfig.java @@ -34,13 +34,13 @@ public class AtmosphericFilterDisplayConfig { @Expose @ConfigOption(name = "Outside Garden", desc = "Shows this HUD everywhere, including outside of the Garden.") @ConfigEditorBoolean - public boolean everywhere = false; + public boolean outsideGarden = false; @Expose @ConfigLink(owner = AtmosphericFilterDisplayConfig.class, field = "enabled") public Position position = new Position(10, 10, true, true); @Expose - @ConfigLink(owner = AtmosphericFilterDisplayConfig.class, field = "everywhere") + @ConfigLink(owner = AtmosphericFilterDisplayConfig.class, field = "outsideGarden") public Position positionOutside = new Position(20, 20, true, true); } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java index 794eb7692..7f1cdf79d 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java @@ -184,7 +184,7 @@ public class GardenConfig { ) @ConfigEditorBoolean @FeatureToggle - public boolean jacobContextTimes = true; + public boolean jacobContestTimes = true; @Expose @ConfigOption( @@ -205,8 +205,8 @@ public class GardenConfig { public double jacobContestCustomBpsValue = 19.9; @Expose - @ConfigLink(owner = GardenConfig.class, field = "jacobContextTimes") - public Position jacobContextTimesPos = new Position(-359, 149, false, true); + @ConfigLink(owner = GardenConfig.class, field = "jacobContestTimes") + public Position jacobContestTimesPosition = new Position(-359, 149, false, true); @Expose @ConfigOption( diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/AtmosphericFilterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/AtmosphericFilterDisplay.kt index 9fddb9fc6..e4f81bf2e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/AtmosphericFilterDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/AtmosphericFilterDisplay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.utils.LorenzUtils @@ -17,7 +18,7 @@ class AtmosphericFilterDisplay { @SubscribeEvent fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return - if (!GardenAPI.inGarden() && !config.everywhere) return + if (!GardenAPI.inGarden() && !config.outsideGarden) return if (!event.repeatSeconds(1)) return display = drawDisplay(Season.getCurrentSeason() ?: return) } @@ -25,10 +26,10 @@ class AtmosphericFilterDisplay { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!isEnabled()) return - if (!GardenAPI.inGarden() && config.everywhere) { - config.positionOutside.renderString(display, posLabel = "Atmospheric Filter Perk Display") - } else if (GardenAPI.inGarden()) { + if (GardenAPI.inGarden()) { config.position.renderString(display, posLabel = "Atmospheric Filter Perk Display") + } else { + config.positionOutside.renderString(display, posLabel = "Atmospheric Filter Perk Display") } } @@ -40,5 +41,8 @@ class AtmosphericFilterDisplay { append(season.getPerk(config.abbreviatePerk)) } - private fun isEnabled(): Boolean = LorenzUtils.inSkyBlock && config.enabled + private fun isEnabled() = LorenzUtils.onHypixel && config.enabled && ( + (OutsideSbFeature.ATMOSPHERIC_FILTER.isSelected() && !LorenzUtils.inSkyBlock) || + (LorenzUtils.inSkyBlock && (GardenAPI.inGarden() || config.outsideGarden)) + ) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt index 1e2748086..055b79a02 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt @@ -31,7 +31,9 @@ import at.hannibal2.skyhanni.utils.TabListData import at.hannibal2.skyhanni.utils.TimeUtils.format import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import com.google.gson.Gson +import com.google.gson.JsonPrimitive import io.github.moulberry.notenoughupdates.util.SkyBlockTime +import io.github.moulberry.notenoughupdates.util.toJsonArray import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext @@ -512,7 +514,7 @@ object GardenNextJacobContest { private fun isEnabled() = config.display && ((LorenzUtils.inSkyBlock && (GardenAPI.inGarden() || config.showOutsideGarden)) || - (OutsideSbFeature.NEXT_JACOB_CONTEXT.isSelected() && !LorenzUtils.inSkyBlock)) + (OutsideSbFeature.NEXT_JACOB_CONTEST.isSelected() && !LorenzUtils.inSkyBlock)) private fun isFetchEnabled() = isEnabled() && config.fetchAutomatically private fun isSendEnabled() = @@ -644,6 +646,13 @@ object GardenNextJacobContest { ConfigUtils.migrateIntToEnum(element, ShareContestsEntry::class.java) } event.move(18, "garden.nextJacobContests.everywhere", "garden.nextJacobContests.showOutsideGarden") + event.move(33, "garden.jacobContextTimesPos", "garden.jacobContestTimesPosition") + event.move(33, "garden.jacobContextTimes", "garden.jacobContestTimes") + event.move(33, "garden.everywhere", "garden.outsideGarden") + event.transform(33, "misc.showOutsideSB") { element -> + element.asJsonArray.map { setting -> + if (setting.asString == "NEXT_JACOB_CONTEXT") JsonPrimitive("NEXT_JACOB_CONTEST") else setting + }.toJsonArray() + } } } - diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt index 7510bc1e4..bc9f55136 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt @@ -188,8 +188,8 @@ class JacobContestTimeNeeded { fun onBackgroundDraw(event: GuiRenderEvent.ChestGuiOverlayRenderEvent) { if (!isEnabled()) return if (!FarmingContestAPI.inInventory) return - config.jacobContextTimesPos.renderStringsAndItems(display, posLabel = "Jacob Contest Time Needed") + config.jacobContestTimesPosition.renderStringsAndItems(display, posLabel = "Jacob Contest Time Needed") } - fun isEnabled() = LorenzUtils.inSkyBlock && config.jacobContextTimes + fun isEnabled() = LorenzUtils.inSkyBlock && config.jacobContestTimes } |