diff options
author | Martin Robertz <dream-master@gmx.net> | 2021-11-17 09:16:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-17 09:16:49 +0100 |
commit | ccca72109fb092bd88defa47cd04f5b499417877 (patch) | |
tree | 6977db439fe06508a3af088eb462ca75f07f1373 /src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java | |
parent | 4bf4b410eaba6a27e0a72c55d276bc071cb00fc0 (diff) | |
parent | c24a55451caa7097266eaf66efb8ca3616007305 (diff) | |
download | GT5-Unofficial-ccca72109fb092bd88defa47cd04f5b499417877.tar.gz GT5-Unofficial-ccca72109fb092bd88defa47cd04f5b499417877.tar.bz2 GT5-Unofficial-ccca72109fb092bd88defa47cd04f5b499417877.zip |
Merge pull request #734 from GTNewHorizons/patch-cover-nbt
convert cover data storage to a full nbt tag
Diffstat (limited to 'src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java')
-rw-r--r-- | src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java index 010ac78654..e7b6b9971d 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java @@ -3,13 +3,22 @@ package gregtech.api.gui.widgets; import gregtech.api.interfaces.IGuiScreen; public class GT_GuiIconCheckButton extends GT_GuiIconButton { - private GT_GuiIcon checkedIcon, normalIcon; + private final GT_GuiIcon checkedIcon; + private final GT_GuiIcon normalIcon; + private final String checkedTooltip; + private final String normalTooltip; private boolean checked = false; public GT_GuiIconCheckButton(IGuiScreen gui, int id, int x, int y, GT_GuiIcon checkedIcon, GT_GuiIcon normalIcon) { + this(gui, id, x, y, checkedIcon, normalIcon, null, null); + } + + public GT_GuiIconCheckButton(IGuiScreen gui, int id, int x, int y, GT_GuiIcon checkedIcon, GT_GuiIcon normalIcon, String checkedTooltip, String normalTooltip) { super(gui, id, x, y, normalIcon); this.checkedIcon = checkedIcon; this.normalIcon = normalIcon; + this.checkedTooltip = checkedTooltip; + this.normalTooltip = normalTooltip; } @Override @@ -27,6 +36,7 @@ public class GT_GuiIconCheckButton extends GT_GuiIconButton { public void setChecked(boolean checked) { super.setIcon(checked ? checkedIcon : normalIcon); + super.setTooltipText(checked ? checkedTooltip : normalTooltip); this.checked = checked; } } |