diff options
author | syeyoung <cyong06@naver.com> | 2021-08-03 17:23:41 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-08-03 17:23:41 +0900 |
commit | 982e460c861579f49959c08e25505a27e9c6b3f0 (patch) | |
tree | 4cccbe086fd69f5f5be138a3eb24237e0211b76e /src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java | |
parent | d1c36c2412b98350f8336e38361e49b3655982d5 (diff) | |
download | Skyblock-Dungeons-Guide-982e460c861579f49959c08e25505a27e9c6b3f0.tar.gz Skyblock-Dungeons-Guide-982e460c861579f49959c08e25505a27e9c6b3f0.tar.bz2 Skyblock-Dungeons-Guide-982e460c861579f49959c08e25505a27e9c6b3f0.zip |
Too many changes to describe
Config gui overhaul. v2
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java index 5709906f..3c223d84 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java @@ -24,9 +24,11 @@ import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; @@ -74,8 +76,9 @@ public class MToggleButton extends MPanel { @Override public void mouseClicked(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int mouseButton) { - if (onToggle != null && lastAbsClip.contains(absMouseX, absMouseY)) { + if (onToggle != null && lastAbsClip.contains(absMouseX, absMouseY) && getTooltipsOpen() == 0) { enabled = !enabled; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); onToggle.run(); } } |