aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-19 15:55:02 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-19 15:55:02 +0100
commit51912a4500ab8fd3c36776bb503631db143a57f7 (patch)
tree5fb4216533e345e5d932ff62560a7985243fb2f4 /src/main/java/at
parent1aa908bfe97a057b3fba26e3052ef96cc451253c (diff)
downloadskyhanni-51912a4500ab8fd3c36776bb503631db143a57f7.tar.gz
skyhanni-51912a4500ab8fd3c36776bb503631db143a57f7.tar.bz2
skyhanni-51912a4500ab8fd3c36776bb503631db143a57f7.zip
Added nextJacobContestOtherGuis support to always show jacob farming contest
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Garden.java16
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenBestCropTime.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt10
4 files changed, 27 insertions, 11 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
index acc7a7dcc..a81622cdb 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
@@ -402,25 +402,31 @@ public class Garden {
@Expose
@ConfigOption(name = "Next Jacob Contest", desc = "")
- @ConfigEditorAccordion(id = 12)
+ @ConfigEditorAccordion(id = 14)
public boolean nextJacobContest = false;
@Expose
@ConfigOption(name = "Show Jacob Contest", desc = "Show the current or next jacob farming contest time and crops.")
@ConfigEditorBoolean
- @ConfigAccordionId(id = 12)
+ @ConfigAccordionId(id = 14)
public boolean nextJacobContestDisplay = true;
@Expose
- @ConfigOption(name = "Show everywhere", desc = "Show the timer not only in garden but everywhere in skyblock.")
+ @ConfigOption(name = "Outside Garden", desc = "Show the timer not only in garden but everywhere in skyblock.")
@ConfigEditorBoolean
- @ConfigAccordionId(id = 12)
+ @ConfigAccordionId(id = 14)
public boolean nextJacobContestEverywhere = false;
@Expose
+ @ConfigOption(name = "In Other Guis", desc = "Mark the current or next farming contest crops in other farming guis as underlined.")
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 14)
+ public boolean nextJacobContestOtherGuis = false;
+
+ @Expose
@ConfigOption(name = "Jacob Contest Position", desc = "")
@ConfigEditorButton(runnableId = "nextJacobContest", buttonText = "Edit")
- @ConfigAccordionId(id = 12)
+ @ConfigAccordionId(id = 14)
public Position nextJacobContestPos = new Position(16, -232, false, true);
@Expose
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt
index 8af8bf742..a0a58ffb2 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt
@@ -77,7 +77,7 @@ class CropMoneyDisplay {
} else {
for ((internalName, moneyPerHour) in map.sortedDesc()) {
number++
- val cropName = cropNames[internalName]
+ val cropName = cropNames[internalName]!!
val isCurrent = cropName == GardenAPI.cropInHand
if (number > config.moneyPerHourShowOnlyBest && !isCurrent) continue
@@ -93,7 +93,8 @@ class CropMoneyDisplay {
val format = LorenzUtils.formatInteger(moneyPerHour.toLong())
val itemName = NEUItems.getItemStack(internalName).name?.removeColor() ?: continue
val color = if (isCurrent) "§e" else "§7"
- list.add("$color$itemName§7: §6$format")
+ val contestFormat = if (GardenNextJacobContest.isNextCrop(cropName)) "§n" else ""
+ list.add("$color$contestFormat$itemName§7: §6$format")
newDisplay.add(list)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenBestCropTime.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenBestCropTime.kt
index bea64af34..6bbe18953 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenBestCropTime.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenBestCropTime.kt
@@ -42,12 +42,13 @@ class GardenBestCropTime {
for (cropName in sorted.keys) {
val millis = timeTillNextCrop[cropName]!!
val duration = TimeUtils.formatDuration(millis)
-
val isCurrent = cropName == currentCrop
- val color = if (isCurrent) "§e" else ""
number++
if (number > config.cropMilestoneShowOnlyBest && !isCurrent) continue
- val cropNameDisplay = "§7$number# $color$cropName"
+
+ val color = if (isCurrent) "§e" else ""
+ val contestFormat = if (GardenNextJacobContest.isNextCrop(cropName)) "§n" else ""
+ val cropNameDisplay = "§7$number# $color$contestFormat$cropName§r"
if (gardenExp) {
val crops = GardenCropMilestones.cropCounter[cropName]!!
val currentTier = GardenCropMilestones.getTierForCrops(crops)
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 ec50cc911..39d6927bb 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt
@@ -17,7 +17,6 @@ import java.time.Instant
import java.util.regex.Pattern
class GardenNextJacobContest {
- private val config get() = SkyHanniMod.feature.garden
private val display = mutableListOf<Any>()
private var tick = 0
private var contests = mutableMapOf<Long, FarmingContest>()
@@ -121,6 +120,7 @@ class GardenNextJacobContest {
class FarmingContest(val endTime: Long, val crops: List<String>)
private fun update() {
+ nextContestCrops.clear()
val newDisplay = drawDisplay()
display.clear()
display.addAll(newDisplay)
@@ -172,6 +172,7 @@ class GardenNextJacobContest {
for (crop in nextContest.crops) {
list.add(" ")
GardenAPI.addGardenCropToList(crop, list)
+ nextContestCrops.add(crop)
}
val format = TimeUtils.formatDuration(duration)
list.add("§7(§b$format§7)")
@@ -196,4 +197,11 @@ class GardenNextJacobContest {
private fun isEnabled() = LorenzUtils.inSkyBlock && config.nextJacobContestDisplay
&& (GardenAPI.inGarden() || config.nextJacobContestEverywhere)
+
+ companion object {
+ private val config get() = SkyHanniMod.feature.garden
+ private val nextContestCrops = mutableListOf<String>()
+
+ fun isNextCrop(cropName: String) = nextContestCrops.contains(cropName) && config.nextJacobContestOtherGuis
+ }
} \ No newline at end of file