public GuiCheckBox addCheckBox(int x, int y, String text, boolean checked) { GuiCheckBox checkBox = new GuiCheckBox(lastButtonId++, x, y, text, checked); buttonList.add(checkBox); return checkBox; }
@Override public void initGui() { super.initGui(); this.tabIcons = new ResourceLocation(CompactMachines3.MODID, "textures/gui/tabicons.png"); int offsetX = (int)((this.width - this.windowWidth) / 2.0f); int offsetY = (int)((this.height - this.windowHeight) / 2.0f); this.buttonList.clear(); this.guiWhiteListAddButton = new GuiButton(0, offsetX+5+windowWidth-30, offsetY+44, 20, 20, "+"); this.buttonList.add(this.guiWhiteListAddButton); this.guiMachineLockedButton = new GuiCheckBox(1, offsetX+7, offsetY + 7, "", GuiMachineData.locked); this.buttonList.add(this.guiMachineLockedButton); this.guiWhiteListInput = new GuiTextField(0, this.fontRenderer, offsetX+6, offsetY+45, windowWidth-33, 18); this.guiWhiteList = new GuiMachinePlayerWhitelist(this, offsetY+65, offsetY+windowHeight - 5, offsetX+5, 20, windowWidth - 10, windowHeight); this.guiEnterButton = new GuiButton(2, offsetX+5+windowWidth-30, offsetY+windowHeight-25, 20, 20, ""); this.buttonList.add(this.guiEnterButton); }
@Override public void initGui() { super.initGui(); // Restore previously selected values when reopening this gui if(parent.chunkProviderSettingsJson != null && !parent.chunkProviderSettingsJson.trim().isEmpty()) { config = new SkyWorldConfiguration(parent.chunkProviderSettingsJson); } else { config = new SkyWorldConfiguration(); } int yOffset = 8; lockedButton = new GuiCheckBox(0, 8, yOffset, I18n.format("gui.compactmachines3.compactsky.configuration.startLocked"), config.startLocked); this.buttonList.add(lockedButton); yOffset += 14; int listHeight = this.height - 52 - yOffset; guiSchemaList = new SchemaScrollingList(this, 8, yOffset, 200, listHeight, 20); closeButton = new GuiButton(100, this.width / 2 - 75, this.height-28, 150, 20, I18n.format("gui.done")); this.buttonList.add(closeButton); }