mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-22 13:10:13 +00:00
Revert "#2557 only add the button tooltip to the GUI when the button had been added"
This reverts commit f7b64b8d7f.
This commit is contained in:
1 parent
b6bd6dffaf
commit
8345969bdd
2 files changed
+8
-15
No files matched your search
@@ -163,7 +163,7 @@ public class BasicItemFilterGui implements IItemFilterGui {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deactivate() {
|
||||
public void deactivate() {
|
||||
useNbtB.detach();
|
||||
useMetaB.detach();
|
||||
useOreDictB.detach();
|
||||
|
||||
@@ -23,7 +23,6 @@ public class IconButtonEIO extends GuiButton {
|
||||
private int xOrigin;
|
||||
private int yOrigin;
|
||||
|
||||
protected boolean isOnGui;
|
||||
protected IGuiScreen gui;
|
||||
protected String[] toolTipText;
|
||||
|
||||
@@ -52,11 +51,11 @@ public class IconButtonEIO extends GuiButton {
|
||||
}
|
||||
|
||||
protected void setToolTip(GuiToolTip newToolTip) {
|
||||
if (isOnGui && toolTip != null) {
|
||||
if (toolTip != null) {
|
||||
gui.removeToolTip(toolTip);
|
||||
}
|
||||
toolTip = newToolTip;
|
||||
if (isOnGui && toolTip != null) {
|
||||
if (toolTip != null) {
|
||||
gui.addToolTip(toolTip);
|
||||
}
|
||||
}
|
||||
@@ -66,23 +65,17 @@ public class IconButtonEIO extends GuiButton {
|
||||
}
|
||||
|
||||
public void onGuiInit() {
|
||||
if(!isOnGui) {
|
||||
gui.addButton(this);
|
||||
if(toolTip != null) {
|
||||
gui.addToolTip(toolTip);
|
||||
}
|
||||
isOnGui = true;
|
||||
gui.addButton(this);
|
||||
if(toolTip != null) {
|
||||
gui.addToolTip(toolTip);
|
||||
}
|
||||
xPosition = xOrigin + gui.getGuiLeft();
|
||||
yPosition = yOrigin + gui.getGuiTop();
|
||||
}
|
||||
|
||||
public void detach() {
|
||||
if(isOnGui) {
|
||||
gui.removeToolTip(toolTip);
|
||||
gui.removeButton(this);
|
||||
isOnGui = false;
|
||||
}
|
||||
gui.removeToolTip(toolTip);
|
||||
gui.removeButton(this);
|
||||
}
|
||||
|
||||
public void setSize(int width, int height) {
|
||||
|
||||
Reference in new issue
Block a user