diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/diana/InquisitorSharingConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/diana/InquisitorSharingConfig.java index 42d0313e0b5c..52931ceab291 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/diana/InquisitorSharingConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/diana/InquisitorSharingConfig.java @@ -2,6 +2,7 @@ import at.hannibal2.skyhanni.config.FeatureToggle; import com.google.gson.annotations.Expose; +import io.github.notenoughupdates.moulconfig.annotations.Accordion; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorKeybind; import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; @@ -30,6 +31,11 @@ public class InquisitorSharingConfig { @ConfigEditorKeybind(defaultKey = Keyboard.KEY_Y) public int keyBindShare = Keyboard.KEY_Y; + @Expose + @ConfigOption(name = "Inquisitor Sound", desc = "") + @Accordion + public InquisitorSoundConfig sound = new InquisitorSoundConfig(); + @Expose @ConfigOption(name = "Show Despawn Time", desc = "Show the time until the shared Inquisitor will despawn.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/diana/InquisitorSoundConfig.kt b/src/main/java/at/hannibal2/skyhanni/config/features/event/diana/InquisitorSoundConfig.kt new file mode 100644 index 000000000000..e07b77cc75fd --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/diana/InquisitorSoundConfig.kt @@ -0,0 +1,33 @@ +package at.hannibal2.skyhanni.config.features.event.diana + +import at.hannibal2.skyhanni.features.event.diana.InquisitorWaypointShare +import at.hannibal2.skyhanni.utils.OSUtils.openBrowser +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorButton +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorText +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption + +class InquisitorSoundConfig { + @Expose + @ConfigOption(name = "Notification Sound", desc = "The sound played when an Inquisitor is found.") + @ConfigEditorText + var name: String = "random.orb" + + @Expose + @ConfigOption(name = "Pitch", desc = "The pitch of the sound.") + @ConfigEditorSlider(minValue = 0.5f, maxValue = 2.0f, minStep = 0.1f) + var pitch: Float = 1.0f + + @ConfigOption(name = "Test Sound", desc = "Test current sound settings.") + @ConfigEditorButton(buttonText = "Test") + var testSound: Runnable = Runnable { InquisitorWaypointShare.playUserSound() } + + @ConfigOption(name = "List of Sounds", desc = "A list of available sounds.") + @ConfigEditorButton(buttonText = "Open") + @Suppress("MaxLineLength") + var listOfSounds: Runnable = + Runnable { + openBrowser("https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/mapping-and-modding-tutorials/2213619-1-8-all-playsound-sound-arguments") + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt index ae474ae04772..3b156564b273 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt @@ -23,6 +23,7 @@ import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.RegexUtils.matches import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.SoundUtils +import at.hannibal2.skyhanni.utils.SoundUtils.playSound import at.hannibal2.skyhanni.utils.StringUtils.cleanPlayerName import at.hannibal2.skyhanni.utils.StringUtils.stripHypixelMessage import at.hannibal2.skyhanni.utils.getLorenzVec @@ -299,7 +300,7 @@ object InquisitorWaypointShare { ChatUtils.chat("$displayName §l§efound an inquisitor at §l§c${x.toInt()} ${y.toInt()} ${z.toInt()}!") if (name != LorenzUtils.getPlayerName()) { LorenzUtils.sendTitle("§dINQUISITOR §efrom §b$displayName", 5.seconds) - SoundUtils.playBeepSound() + playUserSound() } } val inquis = SharedInquisitor(name, displayName, location, SimpleTimeMark.now()) @@ -317,4 +318,11 @@ object InquisitorWaypointShare { ChatUtils.chat("Inquisitor from ${inquis.displayName} §enot found, deleting.") } } + + @JvmStatic + fun playUserSound() { + with(config.sound) { + SoundUtils.createSound(name, pitch).playSound() + } + } }