From 2d2ba2a02f542d288e142cf3a626dc81cb163006 Mon Sep 17 00:00:00 2001 From: Ovi-111 <142670705+Ovi-111@users.noreply.github.com> Date: Sun, 8 Sep 2024 01:00:55 +0600 Subject: Feature: Dungeon Secret Chime (#2478) Co-authored-by: Ovi Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../config/features/dungeon/DungeonConfig.java | 5 +++ .../config/features/dungeon/SecretChimeConfig.java | 40 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/dungeon/SecretChimeConfig.java (limited to 'src/main/java/at/hannibal2/skyhanni/config') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/DungeonConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/DungeonConfig.java index 60809f44f..ec2bc0c4b 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/DungeonConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/DungeonConfig.java @@ -15,6 +15,11 @@ public class DungeonConfig { @Accordion public HighlightClickedBlocksConfig clickedBlocks = new HighlightClickedBlocksConfig(); + @Expose + @ConfigOption(name = "Secret Chime", desc = "Play a sound effect when levers, chests, and wither essence are clicked in dungeons.") + @Accordion + public SecretChimeConfig secretChime = new SecretChimeConfig(); + @Expose @ConfigOption(name = "Milestones Display", desc = "Show the current milestone in Dungeons.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/SecretChimeConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/SecretChimeConfig.java new file mode 100644 index 000000000..99a1e103d --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/SecretChimeConfig.java @@ -0,0 +1,40 @@ +package at.hannibal2.skyhanni.config.features.dungeon; + +import at.hannibal2.skyhanni.config.FeatureToggle; +import at.hannibal2.skyhanni.features.dungeon.DungeonSecretChime; +import at.hannibal2.skyhanni.utils.OSUtils; +import com.google.gson.annotations.Expose; +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; +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; + +public class SecretChimeConfig { + @Expose + @ConfigOption(name = "Enabled", desc = "Play a sound effect when levers, chests, and wither essence are clicked in dungeons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = false; + + @Expose + @ConfigOption(name = "Secret Chime Sound", desc = "The sound played for the secret chime.") + @ConfigEditorText + public String soundName = "random.orb"; + + @Expose + @ConfigOption(name = "Pitch", desc = "The pitch of the secret chime sound.") + @ConfigEditorSlider(minValue = 0.5f, maxValue = 2.0f, minStep = 0.1f) + public float soundPitch = 1.0f; + + @ConfigOption(name = "Sounds", + desc = "Click to open the list of available sounds.\n" + + "§l§cWarning: Clicking this will open a webpage in your browser." + ) + @ConfigEditorButton(buttonText = "OPEN") + public Runnable soundsListURL = () -> OSUtils.openBrowser("https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/mapping-and-modding-tutorials/2213619-1-8-all-playsound-sound-arguments"); + + @ConfigOption(name = "Play Sound", desc = "Plays current secret chime sound.") + @ConfigEditorButton(buttonText = "Play") + public Runnable checkSound = DungeonSecretChime::playSound; +} -- cgit