aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/roomedit
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-07-20 13:35:06 +0900
committersyeyoung <cyong06@naver.com>2021-07-20 14:42:12 +0900
commiteb27fcef7ac26c71941c7911ebf6aa20254a2855 (patch)
tree65a84edb26375f34bf1f43b6ec4315700032da23 /src/main/java/kr/syeyoung/dungeonsguide/roomedit
parent0af44a60844be83fb371c2f0eaeb2feccd1f0207 (diff)
downloadSkyblock-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/roomedit')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomMatchDisplayPane.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomMatchDisplayPane.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomMatchDisplayPane.java
index 21ef701f..5290291f 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomMatchDisplayPane.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomMatchDisplayPane.java
@@ -22,6 +22,8 @@ import kr.syeyoung.dungeonsguide.config.guiconfig.FeatureEditPane;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry;
import kr.syeyoung.dungeonsguide.gui.MPanel;
+import kr.syeyoung.dungeonsguide.gui.elements.MTooltip;
+import kr.syeyoung.dungeonsguide.gui.elements.MTooltipText;
import kr.syeyoung.dungeonsguide.utils.ArrayUtils;
import kr.syeyoung.dungeonsguide.utils.RenderUtils;
import net.minecraft.block.Block;
@@ -54,6 +56,9 @@ public class RoomMatchDisplayPane extends MPanel {
targetBlocks = ArrayUtils.rotateCounterClockwise(targetBlocks);
}
+ MTooltip mTooltip;
+ int lastTooltipX = -1, lastTooltipZ = -1;
+
@Override
public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle clip) {
ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
@@ -80,6 +85,7 @@ public class RoomMatchDisplayPane extends MPanel {
int hoverY = (relMousey0 - offsetY - 10) / 16;
// draw Content
clip(sr, clip.x + 10, clip.y +10, clip.width - 10, clip.height - 10);
+ boolean tooltiped=false;
for (int z = 0; z < height; z++) {
for (int x = 0; x < width; x++) {
int data1;
@@ -103,10 +109,19 @@ public class RoomMatchDisplayPane extends MPanel {
fr.drawString("N", x *16 +10 + offsetX, z *16 +10 + offsetY,0xFFFF0000);
}
if (z == hoverY && x == hoverX) {
- RenderUtils.drawHoveringText(Arrays.asList("Expected "+data2 +" But found "+data1), relMousex0, relMousey0, fr);
+ tooltiped = true;
+ if (lastTooltipX != x || lastTooltipZ != z){
+ if (mTooltip != null) mTooltip.close();
+ mTooltip = new MTooltipText(Arrays.asList("Expected "+data2 +" But found "+data1));
+ mTooltip.open(this);
+ }
}
}
}
+ if (!tooltiped && mTooltip != null) {
+ mTooltip.close();
+ mTooltip = null;
+ }
}
private void drawItemStack(ItemStack stack, int x, int y)