diff options
author | syeyoung <cyong06@naver.com> | 2021-07-20 21:49:59 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-07-20 21:49:59 +0900 |
commit | aa804403a1dcc8f9b36672e0e56e591e810147b3 (patch) | |
tree | dbfbda2b57c23da17791031507a8693fb7313b0e /src/main/java/kr/syeyoung/dungeonsguide/config | |
parent | 82a849d7aee17d7e59397f0858a24b51b59a69a6 (diff) | |
download | Skyblock-Dungeons-Guide-aa804403a1dcc8f9b36672e0e56e591e810147b3.tar.gz Skyblock-Dungeons-Guide-aa804403a1dcc8f9b36672e0e56e591e810147b3.tar.bz2 Skyblock-Dungeons-Guide-aa804403a1dcc8f9b36672e0e56e591e810147b3.zip |
Popups in gui config
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/config')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java | 1 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDelegate.java | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java index 2304378b..b68c0b0c 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java @@ -40,6 +40,7 @@ import java.util.List; public class GuiGuiLocationConfig extends MGui { + @Getter private final GuiScreen before; @Getter diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDelegate.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDelegate.java index 71cafd83..bfd92cef 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDelegate.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDelegate.java @@ -21,6 +21,8 @@ package kr.syeyoung.dungeonsguide.config.guiconfig; import kr.syeyoung.dungeonsguide.config.types.GUIRectangle; import kr.syeyoung.dungeonsguide.features.GuiFeature; import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.gui.elements.MPopupMenu; +import kr.syeyoung.dungeonsguide.gui.elements.MTooltip; import kr.syeyoung.dungeonsguide.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; @@ -65,6 +67,7 @@ public class PanelDelegate extends MPanel { @Override public void render(int absMousex, int absMousey, int relMouseX, int relMouseY, float partialTicks, Rectangle scissor) { + if (!guiFeature.isEnabled()) return; GlStateManager.pushMatrix(); guiFeature.drawDemo(partialTicks); @@ -277,9 +280,13 @@ public class PanelDelegate extends MPanel { } } + MTooltip mTooltip; + @Override public void mouseClicked(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int mouseButton) { if (!draggable) return; + if (!guiFeature.isEnabled()) return; + if (getTooltipsOpen() > 0) return; if (!lastAbsClip.contains(absMouseX, absMouseY)) return; if (mouseButton == 0) { internallyThinking = guiFeature.getFeatureRect().getRectangleNoScale(); @@ -306,6 +313,10 @@ public class PanelDelegate extends MPanel { lastY = absMouseY; applyConstraint(); + } else if (getTooltipsOpen() == 0){ + if (mTooltip != null) mTooltip.close(); + mTooltip = new MPopupMenu(absMouseX, absMouseY, guiFeature.getTooltipForEditor(guiGuiLocationConfig)); + mTooltip.open(this); } throw new IllegalArgumentException("bruh, a hack to stop event progress"); } @@ -313,6 +324,7 @@ public class PanelDelegate extends MPanel { @Override public void mouseReleased(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int state) { if (!draggable) return; + if (!guiFeature.isEnabled()) return; if (selectedPart >= -1) { guiFeature.setFeatureRect(new GUIRectangle(constraintApplied)); } @@ -323,6 +335,7 @@ public class PanelDelegate extends MPanel { @Override public void mouseClickMove(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int clickedMouseButton, long timeSinceLastClick) { if (!draggable) return; + if (!guiFeature.isEnabled()) return; int dx = (absMouseX - lastX); int dy = (absMouseY - lastY); if (selectedPart >= 0) { |