aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-03-21 21:08:34 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-03-21 21:08:34 +0100
commit181d311d5c02e28995082edc59916371be991f68 (patch)
tree75dd1d783b23de02c6f3092b59ec350dd2c5bb43 /src
parente66f45ac7ea014bcf579b7a3d56033d082ebb763 (diff)
downloadskyhanni-181d311d5c02e28995082edc59916371be991f68.tar.gz
skyhanni-181d311d5c02e28995082edc59916371be991f68.tar.bz2
skyhanni-181d311d5c02e28995082edc59916371be991f68.zip
code cleanup
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt36
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt26
4 files changed, 39 insertions, 34 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
index 106d6e84d..8c6d7fdec 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
@@ -284,8 +284,9 @@ object GhostCounter {
}
val moneyMadeWithClickableTips = Renderable.clickAndHover(
textFormatting.moneyMadeFormat.formatText(moneyMade.addSeparators()),
- moneyMadeTips, onClick =
- { OSUtils.copyToClipboard(moneyMadeTips.joinToString("\n").removeColor()) })
+ moneyMadeTips,
+ onClick = { OSUtils.copyToClipboard(moneyMadeTips.joinToString("\n").removeColor()) }
+ )
addAsSingletonList(textFormatting.moneyHourFormat.formatText(final))
addAsSingletonList(moneyMadeWithClickableTips)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt
index 458806e21..eda69d483 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt
@@ -131,18 +131,18 @@ class FarmingWeightDisplay {
listOf("§eClick here to reload the data right now!"),
onClick = recalculate
), Renderable.clickAndHover(
- "§cdata from Elite Farmers!",
- listOf("§eClick here to reload the data right now!"),
- onClick = recalculate
- ), Renderable.clickAndHover(
- "§eRejoin the garden or",
- listOf("§eClick here to reload the data right now!"),
- onClick = recalculate
- ), Renderable.clickAndHover(
- "§eclick here to fix it.",
- listOf("§eClick here to reload the data right now!"),
- onClick = recalculate
- )
+ "§cdata from Elite Farmers!",
+ listOf("§eClick here to reload the data right now!"),
+ onClick = recalculate
+ ), Renderable.clickAndHover(
+ "§eRejoin the garden or",
+ listOf("§eClick here to reload the data right now!"),
+ onClick = recalculate
+ ), Renderable.clickAndHover(
+ "§eclick here to fix it.",
+ listOf("§eClick here to reload the data right now!"),
+ onClick = recalculate
+ )
)
}
@@ -180,9 +180,9 @@ class FarmingWeightDisplay {
list.add(
Renderable.clickAndHover(
"§6Farming Weight§7: $weight$leaderboard",
- listOf("§eClick to open your Farming Profile."), onClick = {
- openWebsite(LorenzUtils.getPlayerName())
- })
+ listOf("§eClick to open your Farming Profile."),
+ onClick = { openWebsite(LorenzUtils.getPlayerName()) }
+ )
)
if (isEtaEnabled() && (weightPerSecond != -1.0 || config.overtakeETAAlways)) {
@@ -306,9 +306,9 @@ class FarmingWeightDisplay {
} else {
Renderable.clickAndHover(
text,
- listOf("§eClick to open the Farming Profile of §b$nextName."), onClick = {
- openWebsite(nextName)
- })
+ listOf("§eClick to open the Farming Profile of §b$nextName."),
+ onClick = { openWebsite(nextName) }
+ )
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt
index ceb8f1922..ee6d1306b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt
@@ -377,12 +377,14 @@ object SkillProgress {
val session = xpInfo.timeActive.seconds.format(TimeUnit.HOUR)
add(
Renderable.clickAndHover("§7Session: §e$session ${if (xpInfo.sessionTimerActive) "" else "§c(PAUSED)"}",
- listOf("§eClick to reset!"), onClick = {
+ listOf("§eClick to reset!"),
+ onClick = {
xpInfo.sessionTimerActive = false
xpInfo.timeActive = 0L
chat("Timer for §b${activeSkill.displayName} §ehas been reset!")
- })
+ }
+ )
)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt
index bd582ea5d..a64471e75 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt
@@ -129,21 +129,23 @@ class SkyHanniItemTracker<Data : ItemTrackerData>(
}
val lore = buildLore(data, itemProfit, hidden, newDrop, internalName)
- val renderable = if (isInventoryOpen()) Renderable.clickAndHover(displayName, lore, onClick = {
- if (System.currentTimeMillis() > lastClickDelay + 150) {
- if (KeyboardManager.isModifierKeyDown()) {
- data.items.remove(internalName)
- ChatUtils.chat("Removed $cleanName §efrom $name.")
- lastClickDelay = System.currentTimeMillis() + 500
- } else {
- modify {
- it.items[internalName]?.hidden = !hidden
+ val renderable = if (isInventoryOpen()) Renderable.clickAndHover(displayName, lore,
+ onClick = {
+ if (System.currentTimeMillis() > lastClickDelay + 150) {
+ if (KeyboardManager.isModifierKeyDown()) {
+ data.items.remove(internalName)
+ ChatUtils.chat("Removed $cleanName §efrom $name.")
+ lastClickDelay = System.currentTimeMillis() + 500
+ } else {
+ modify {
+ it.items[internalName]?.hidden = !hidden
+ }
+ lastClickDelay = System.currentTimeMillis()
}
- lastClickDelay = System.currentTimeMillis()
+ update()
}
- update()
}
- }) else Renderable.string(displayName)
+ ) else Renderable.string(displayName)
lists.addAsSingletonList(renderable)
}