diff options
author | syeyoung <cyong06@naver.com> | 2021-07-20 13:35:06 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-07-20 14:42:12 +0900 |
commit | eb27fcef7ac26c71941c7911ebf6aa20254a2855 (patch) | |
tree | 65a84edb26375f34bf1f43b6ec4315700032da23 /src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDefaultParameterConfig.java | |
parent | 0af44a60844be83fb371c2f0eaeb2feccd1f0207 (diff) | |
download | Skyblock-Dungeons-Guide-eb27fcef7ac26c71941c7911ebf6aa20254a2855.tar.gz Skyblock-Dungeons-Guide-eb27fcef7ac26c71941c7911ebf6aa20254a2855.tar.bz2 Skyblock-Dungeons-Guide-eb27fcef7ac26c71941c7911ebf6aa20254a2855.zip |
Better snapping and use the new tooltips
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDefaultParameterConfig.java')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDefaultParameterConfig.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDefaultParameterConfig.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDefaultParameterConfig.java index 0af9e2f0..a38f1a06 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDefaultParameterConfig.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDefaultParameterConfig.java @@ -22,6 +22,8 @@ import kr.syeyoung.dungeonsguide.features.AbstractFeature; import kr.syeyoung.dungeonsguide.features.FeatureParameter; import kr.syeyoung.dungeonsguide.gui.MPanel; import kr.syeyoung.dungeonsguide.gui.elements.MButton; +import kr.syeyoung.dungeonsguide.gui.elements.MTooltip; +import kr.syeyoung.dungeonsguide.gui.elements.MTooltipText; import kr.syeyoung.dungeonsguide.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; @@ -68,6 +70,8 @@ public class PanelDefaultParameterConfig extends MPanel { MPanel within; + MTooltip mTooltip; + MParameter lastWithin; @Override public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle scissor) { int heights = 0; @@ -80,9 +84,16 @@ public class PanelDefaultParameterConfig extends MPanel { } if (within instanceof MParameter) { FeatureParameter feature = ((MParameter) within).getParameter(); - GL11.glDisable(GL11.GL_SCISSOR_TEST); - RenderUtils.drawHoveringText(new ArrayList<String>(Arrays.asList(feature.getDescription().split("\n"))), relMousex0,relMousey0, Minecraft.getMinecraft().fontRendererObj); - GL11.glEnable(GL11.GL_SCISSOR_TEST); + if (lastWithin != within) { + if (mTooltip != null) mTooltip.close(); + mTooltip = new MTooltipText(Arrays.asList(feature.getDescription().split("\n"))); + mTooltip.open(this); + } + } else { + if (mTooltip != null) { + mTooltip.close(); + mTooltip = null; + } } } |