aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt
diff options
context:
space:
mode:
authoringlettronald <71849533+inglettronald@users.noreply.github.com>2023-03-21 18:08:57 -0500
committerGitHub <noreply@github.com>2023-03-21 18:08:57 -0500
commit2cb6f4cffee0ab505b35938cf71518e4640a229a (patch)
tree02224acacc7e7823079a8e2cc24377eafe33700c /src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt
parent05c6b155f1de3a96ef081627ff7805238742162f (diff)
parent3968c49ccfb1fb3b0c6a8274f4d45ed0ba50ec48 (diff)
downloadDulkirMod-2cb6f4cffee0ab505b35938cf71518e4640a229a.tar.gz
DulkirMod-2cb6f4cffee0ab505b35938cf71518e4640a229a.tar.bz2
DulkirMod-2cb6f4cffee0ab505b35938cf71518e4640a229a.zip
Merge pull request #11 from IlmarsXd/master
refactor modules (class -> object), add memory leak fix
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt')
-rw-r--r--src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt b/src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt
index b3113bd..8bcd145 100644
--- a/src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt
+++ b/src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt
@@ -3,9 +3,10 @@ package dulkirmod.features
import dulkirmod.DulkirMod
import dulkirmod.config.Config
import dulkirmod.utils.TabListUtils
+import dulkirmod.utils.TitleUtils
import dulkirmod.utils.Utils
-class GardenVisitorAlert {
+object GardenVisitorAlert {
private var hasSentAlert = false
private var lastAlert = 0
@@ -19,7 +20,7 @@ class GardenVisitorAlert {
if (TabListUtils.maxVisitors && !hasSentAlert) {
val color = Utils.getColorString(Config.bestiaryNotifColor)
- DulkirMod.titleUtils.drawStringForTime("${color}Max Visitors", 5000)
+ TitleUtils.drawStringForTime("${color}Max Visitors", 5000)
DulkirMod.mc.thePlayer.playSound("note.pling", 1f * Config.bestiaryNotifVol, .3f)
DulkirMod.mc.thePlayer.playSound("note.pling", 1f * Config.bestiaryNotifVol, .6f)
DulkirMod.mc.thePlayer.playSound("note.pling", 1f * Config.bestiaryNotifVol, .9f)
@@ -32,7 +33,7 @@ class GardenVisitorAlert {
if (TabListUtils.maxVisitors && hasSentAlert && timeSinceLastAlert > 5000 && Config.persistentAlert) {
lastAlert = System.currentTimeMillis().toInt()
val color = Utils.getColorString(Config.bestiaryNotifColor)
- DulkirMod.titleUtils.drawStringForTime("${color}Max Visitors", 5000)
+ TitleUtils.drawStringForTime("${color}Max Visitors", 5000)
DulkirMod.mc.thePlayer.playSound("note.pling", 1f * Config.bestiaryNotifVol, .3f)
DulkirMod.mc.thePlayer.playSound("note.pling", 1f * Config.bestiaryNotifVol, .6f)
DulkirMod.mc.thePlayer.playSound("note.pling", 1f * Config.bestiaryNotifVol, .9f)