diff --git a/TerraForgedMod/src/main/java/com/terraforged/mod/gui/element/Toggle.java b/TerraForgedMod/src/main/java/com/terraforged/mod/gui/element/Toggle.java index 2dd2163..e32fbf1 100644 --- a/TerraForgedMod/src/main/java/com/terraforged/mod/gui/element/Toggle.java +++ b/TerraForgedMod/src/main/java/com/terraforged/mod/gui/element/Toggle.java @@ -30,11 +30,14 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.ListNBT; import net.minecraftforge.common.util.Constants; +import java.util.List; + public class Toggle extends TerraButton { private final String prefix; private final CompoundNBT value; private final ListNBT options; + private final List tooltip; private int index; private Runnable callback = () -> {}; @@ -43,6 +46,7 @@ public class Toggle extends TerraButton { super(value.getString("value")); this.value = value; this.prefix = prefix; + this.tooltip = Element.readTooltip(value); this.options = value.getList("#options", Constants.NBT.TAG_STRING); for (int i = 0; i < options.size(); i++) { String s = options.getString(i); @@ -59,6 +63,11 @@ public class Toggle extends TerraButton { return this; } + @Override + public List getTooltip() { + return tooltip; + } + @Override public boolean mouseClicked(double mx, double my, int button) { if (super.isValidClickButton(button)) {