use of mcjty.rftools.blocks.screens.IModuleGuiChanged in project RFTools by McJty.
the class MachineInformationClientScreenModule method createGui.
@Override
public void createGui(IModuleGuiBuilder guiBuilder) {
// @todo Hacky, solve this better
ScreenModuleGuiBuilder screenModuleGuiBuilder = (ScreenModuleGuiBuilder) guiBuilder;
Minecraft mc = Minecraft.getMinecraft();
Gui gui = screenModuleGuiBuilder.getGui();
NBTTagCompound currentData = screenModuleGuiBuilder.getCurrentData();
IModuleGuiChanged moduleGuiChanged = screenModuleGuiBuilder.getModuleGuiChanged();
Panel panel = new Panel(mc, gui).setLayout(new VerticalLayout());
TextField textField = new TextField(mc, gui).setDesiredHeight(16).setTooltips("Text to use as label").addTextEvent((parent, newText) -> {
currentData.setString("text", newText);
moduleGuiChanged.updateData();
});
panel.addChild(textField);
addColorPanel(mc, gui, currentData, moduleGuiChanged, panel);
addOptionPanel(mc, gui, currentData, moduleGuiChanged, panel);
addMonitorPanel(mc, gui, currentData, panel);
if (currentData != null) {
textField.setText(currentData.getString("text"));
}
screenModuleGuiBuilder.overridePanel(panel);
}
Aggregations