diff options
author | Martin Robertz <dream-master@gmx.net> | 2021-12-02 16:53:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-02 16:53:40 +0100 |
commit | c0a6800447fdb87e266acfb47f35b5f765c74fe3 (patch) | |
tree | 2066554d22848e6818689d41cd4ca7f683ebebb7 /src/main/java/gregtech/api/gui/widgets/GT_GuiTooltipManager.java | |
parent | 03b6fb248b1a20b9ccce7ac4da4c1a76875fa966 (diff) | |
download | GT5-Unofficial-c0a6800447fdb87e266acfb47f35b5f765c74fe3.tar.gz GT5-Unofficial-c0a6800447fdb87e266acfb47f35b5f765c74fe3.tar.bz2 GT5-Unofficial-c0a6800447fdb87e266acfb47f35b5f765c74fe3.zip |
add select circuit gui for machine and circuits itself (#773)
also fixed some issue with basic machine gui introduced in 9d42b299def1c41bbc7a1f01efe445be28f54399
also retrofitted volumetric flask to use the new INetworkUpdatableItem and GT_Packet_UpdateItem, deprecating MessageSetFlaskCapacity in the meanwhile.
To open the gui for machine, shift-left-click the circuit slot
To open the gui for circuit, click any block (need to be sneaking if it's chest, furnace, etc) with the circuit held in hand.
Signed-off-by: Glease <4586901+Glease@users.noreply.github.com>
Co-authored-by: Glease <4586901+Glease@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/api/gui/widgets/GT_GuiTooltipManager.java')
-rw-r--r-- | src/main/java/gregtech/api/gui/widgets/GT_GuiTooltipManager.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltipManager.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltipManager.java index d0e6964abc..c098e4e2a7 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltipManager.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltipManager.java @@ -21,7 +21,7 @@ public class GT_GuiTooltipManager { private final List<GT_GuiTooltip> tips = new ArrayList<>(); public void addToolTip(GT_GuiTooltip tip) { - if (!tips.contains(tip)) tips.add(tip); + if (tip != null && !tips.contains(tip)) tips.add(tip); } public boolean removeToolTip(GT_GuiTooltip tip) { @@ -37,15 +37,14 @@ public class GT_GuiTooltipManager { lastMouseX = mouseX; lastMouseY = mouseY; - if (mouseStopped > DELAY) - mouseX -= render.getGuiLeft(); - mouseY -= render.getGuiTop(); - for (GT_GuiTooltip tip : tips) { - if(tip.enabled && tip.bounds.contains(mouseX, mouseY)){ - tip.updateText(); - drawTooltip(tip, mouseX, mouseY, render); - break; - } + mouseX -= render.getGuiLeft(); + mouseY -= render.getGuiTop(); + for (GT_GuiTooltip tip : tips) { + if (tip.enabled && (!tip.isDelayed() || mouseStopped > DELAY) && tip.getBounds().contains(mouseX, mouseY)) { + tip.updateText(); + drawTooltip(tip, mouseX, mouseY, render); + break; + } } } |