aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-18 00:27:01 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-18 00:27:01 +0200
commita10c097974d0b476be275c1fd2888d7502508efd (patch)
treeb9059f9ff1d010ce7ee32c4aece25a5dbc4141c3 /src/main/java/at/hannibal2/skyhanni/features/misc
parent88bff6a920bd597e7ef2a22bbcd99750158e6816 (diff)
downloadskyhanni-a10c097974d0b476be275c1fd2888d7502508efd.tar.gz
skyhanni-a10c097974d0b476be275c1fd2888d7502508efd.tar.bz2
skyhanni-a10c097974d0b476be275c1fd2888d7502508efd.zip
added profile specific config support
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt18
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt12
2 files changed, 17 insertions, 13 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt
index 693c40210..bb21b7da6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.features.misc
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.utils.LorenzUtils
@@ -10,23 +11,23 @@ import at.hannibal2.skyhanni.utils.StringUtils.matchRegex
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class CurrentPetDisplay {
- private val config get() = SkyHanniMod.feature.hidden
@SubscribeEvent
fun onChatMessage(event: LorenzChatEvent) {
- if (!LorenzUtils.inSkyBlock) return
-
+ val message = event.message
+ val config = ProfileStorageData.profileSpecific ?: return
var blocked = false
+ if (message.matchRegex("§cAutopet §eequipped your §7(.*)§e! §a§lVIEW RULE")) {
+ config.currentPet = message.between("] ", "§e!")
+ blocked = true
+ }
+
+ if (!LorenzUtils.inSkyBlock) return
- val message = event.message
if (message.matchRegex("§aYou summoned your §r(.*)§r§a!")) {
config.currentPet = message.between("your §r", "§r§a")
blocked = true
}
- if (message.matchRegex("§cAutopet §eequipped your §7(.*)§e! §a§lVIEW RULE")) {
- config.currentPet = message.between("] ", "§e!")
- blocked = true
- }
if (message.matchRegex("§aYou despawned your §r(.*)§r§a!")) {
config.currentPet = ""
blocked = true
@@ -42,6 +43,7 @@ class CurrentPetDisplay {
if (!LorenzUtils.inSkyBlock) return
if (!SkyHanniMod.feature.misc.petDisplay) return
+ val config = ProfileStorageData.profileSpecific ?: return
SkyHanniMod.feature.misc.petDisplayPos.renderString(config.currentPet, posLabel = "Current Pet")
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt
index fae6b5104..9a57ddd5e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt
@@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.data.GardenCropMilestones.Companion.getCounter
import at.hannibal2.skyhanni.data.GardenCropMilestones.Companion.getTierForCrops
import at.hannibal2.skyhanni.data.GardenCropMilestones.Companion.progressToNextLevel
import at.hannibal2.skyhanni.data.HypixelData
+import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.data.ScoreboardData
import at.hannibal2.skyhanni.features.garden.GardenAPI.getCropType
import at.hannibal2.skyhanni.utils.LorenzUtils
@@ -174,12 +175,13 @@ enum class DiscordStatus(private val displayMessageSupplier: Supplier<String>?)
}),
PETS({
- val pet = SkyHanniMod.feature.hidden.currentPet
- val colorCode = pet.substring(1..2).first()
- val petName = pet.substring(2)
- val petLevel = getCurrentPet().petLevel.currentLevel
+ ProfileStorageData.profileSpecific?.currentPet?.let {
+ val colorCode = it.substring(1..2).first()
+ val petName = it.substring(2)
+ val petLevel = getCurrentPet().petLevel.currentLevel
- "[Lvl $petLevel] ${colorCodeToRarity(colorCode)} $petName"
+ "[Lvl $petLevel] ${colorCodeToRarity(colorCode)} $petName"
+ } ?: ""
})
;