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/MButton.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/MButton.java')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java index ff8061e7..6f147472 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.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; @@ -53,7 +55,8 @@ public class MButton extends MPanel { Dimension bounds = getSize(); int bg = background; - if (!enabled) { + if (getTooltipsOpen() > 0) { + } else if (!enabled) { bg = disabled; } else if (isclicked) { bg = clicked; @@ -80,10 +83,11 @@ public class MButton extends MPanel { boolean isclicked = false; @Override public void mouseClicked(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int mouseButton) { - if (lastAbsClip.contains(absMouseX, absMouseY)) { + if (lastAbsClip.contains(absMouseX, absMouseY) && getTooltipsOpen() == 0) { isclicked = true; if (onActionPerformed != null) onActionPerformed.run(); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); } } |