From 41cdb65072e4d673363694e48647f91aaf7a3710 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Fri, 6 Aug 2021 13:02:24 +0900 Subject: Tooltips can now go left --- .../features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/kr/syeyoung/dungeonsguide') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java index 866d5773..e1c5359f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java @@ -264,7 +264,8 @@ public class PanelMechanicBrowser extends MPanelScaledGUI { } mechanicBrowserTooltip.setScale(getScale()); Dimension prefSize = mechanicBrowserTooltip.getPreferredSize(); - mechanicBrowserTooltip.setBounds(new Rectangle(bounds.x + bounds.width, latestTooltipDY + bounds.y, prefSize.width, prefSize.height)); + mechanicBrowserTooltip.setBounds(new Rectangle(bounds.x + + (bounds.x > Minecraft.getMinecraft().displayWidth/2 ? -prefSize.width : bounds.width), latestTooltipDY + bounds.y, prefSize.width, prefSize.height)); mechanicBrowserTooltip.open(this); } @@ -299,7 +300,7 @@ public class PanelMechanicBrowser extends MPanelScaledGUI { if (mechanicBrowserTooltip != null) { Dimension prefSize = mechanicBrowserTooltip.getPreferredSize(); mechanicBrowserTooltip.setScale(getScale()); - mechanicBrowserTooltip.setBounds(new Rectangle(bounds.x + bounds.width, latestTooltipDY + bounds.y, prefSize.width, prefSize.height)); + mechanicBrowserTooltip.setBounds(new Rectangle(bounds.x + (bounds.x > Minecraft.getMinecraft().displayWidth/2 ? -prefSize.width: bounds.width), latestTooltipDY + bounds.y, prefSize.width, prefSize.height)); } } -- cgit