Display lock reason only when using the mode

This commit is contained in:
NotMyWing
2025-03-14 15:48:23 +11:00
parent d131e12498
commit f42a5778d2
@@ -79,6 +79,7 @@ public class GuiInterface extends GuiUpgradeable {
labelList.remove(this.lockReason);
}
this.lockReason = new GuiImgLabel(this.fontRenderer, guiLeft + 40, guiTop + 12, Settings.UNLOCK, LockCraftingMode.NONE);
this.lockReason.setVisibility(false);
labelList.add(lockReason);
}
@@ -90,16 +91,21 @@ public class GuiInterface extends GuiUpgradeable {
if (this.UnlockMode != null) {
this.UnlockMode.set(((ContainerInterface) this.cvb).getUnlockMode());
if (this.lockReason != null) {
if (this.UnlockMode.getCurrentValue() == LockCraftingMode.NONE) {
this.lockReason.setVisibility(false);
} else {
this.lockReason.setVisibility(true);
this.lockReason.set(((ContainerInterface) this.cvb).getCraftingLockedReason());
}
}
}
if (this.interfaceMode != null) {
this.interfaceMode.setState(((ContainerInterface) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
}
if (this.lockReason != null) {
this.lockReason.set(((ContainerInterface) this.cvb).getCraftingLockedReason());
}
this.fontRenderer.drawString(this.getGuiDisplayName(GuiText.Interface.getLocal()), 8, 6, 4210752);
this.fontRenderer.drawString(GuiText.Config.getLocal(), 8, 6 + 11 + 7, 4210752);