diff options
author | syeyoung <cyoung06@naver.com> | 2023-01-22 19:31:50 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2023-01-22 19:31:50 +0900 |
commit | a04f05c9e686a6cb98e4a5cc758fab07ed3a1ac0 (patch) | |
tree | ab9e30007a2d025e21ecbbb6de0ac344499173ea /mod/src/main/java/kr | |
parent | a53885c974be3189c34806c85f684d450275c23a (diff) | |
download | Skyblock-Dungeons-Guide-a04f05c9e686a6cb98e4a5cc758fab07ed3a1ac0.tar.gz Skyblock-Dungeons-Guide-a04f05c9e686a6cb98e4a5cc758fab07ed3a1ac0.tar.bz2 Skyblock-Dungeons-Guide-a04f05c9e686a6cb98e4a5cc758fab07ed3a1ac0.zip |
popup close handling
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'mod/src/main/java/kr')
4 files changed, 14 insertions, 6 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/PlayerModelRenderer.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/PlayerModelRenderer.java index 123435ce..3834f966 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/PlayerModelRenderer.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/PlayerModelRenderer.java @@ -153,7 +153,9 @@ public class PlayerModelRenderer extends AnnotatedExportOnlyWidget implements La this.tooltip = null; } else if (toHover != null && this.tooltip == null) PopupMgr.getPopupMgr(getDomElement()) - .openPopup(this.tooltip = new MouseTooltip(absMouseX, absMouseY, actualTooltip), null); + .openPopup(this.tooltip = new MouseTooltip(absMouseX, absMouseY, actualTooltip),(a) -> { + this.tooltip = null; + }); return false; } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/WidgetDataRendererWrapper.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/WidgetDataRendererWrapper.java index 04d16318..636a6f26 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/WidgetDataRendererWrapper.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/WidgetDataRendererWrapper.java @@ -87,7 +87,9 @@ public class WidgetDataRendererWrapper extends Widget implements Layouter, Rende this.tooltip = null; } else if (toHover != null && this.tooltip == null) PopupMgr.getPopupMgr(getDomElement()) - .openPopup(this.tooltip = new MouseTooltip(absMouseX, absMouseY, actualTooltip), null); + .openPopup(this.tooltip = new MouseTooltip(absMouseX, absMouseY, actualTooltip), (a) -> { + this.tooltip = null; + }); return false; } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/WidgetPlayerInventory.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/WidgetPlayerInventory.java index c29be21d..04a74357 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/WidgetPlayerInventory.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/WidgetPlayerInventory.java @@ -90,7 +90,7 @@ public class WidgetPlayerInventory extends Widget implements Renderer, Layouter @Override public boolean mouseMoved(int absMouseX, int absMouseY, double relMouseX, double relMouseY) { List<String> toHover = null; - if (getDomElement().getAbsBounds().contains(absMouseX, absMouseY)) { + if (getDomElement().getAbsBounds().contains(absMouseX, absMouseY) && playerProfile.getInventory() != null) { ItemStack toHoverStack = null; for (int i = 0; i < playerProfile.getInventory().length; i++) { int x = (i % 9) * 18 + 1; @@ -120,11 +120,13 @@ public class WidgetPlayerInventory extends Widget implements Renderer, Layouter if (toHover == null && this.tooltip != null) { PopupMgr.getPopupMgr(getDomElement()) - .closePopup(this.tooltip, null); + .closePopup(this.tooltip); this.tooltip = null; } else if (toHover != null && this.tooltip == null) PopupMgr.getPopupMgr(getDomElement()) - .openPopup(this.tooltip = new MouseTooltip(absMouseX, absMouseY, actualTooltip), null); + .openPopup(this.tooltip = new MouseTooltip(absMouseX, absMouseY, actualTooltip), (a) -> { + this.tooltip = null; + }); return false; } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/WidgetProfileViewerData.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/WidgetProfileViewerData.java index d84e0c11..d984c34c 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/WidgetProfileViewerData.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/widget/WidgetProfileViewerData.java @@ -121,7 +121,9 @@ public class WidgetProfileViewerData extends AnnotatedWidget { scaler.child.setValue(new WidgetPlayerInventory( playerSkyblockData.getPlayerProfiles()[idx] )); - popupMgr.openPopup(popup = new LocationedPopup(x, y, scaler), null); + popupMgr.openPopup(popup = new LocationedPopup(x, y, scaler), (a) -> { + this.popup = null; + }); } } |