use of com.wuest.prefab.Gui.Controls.GuiTextSlider in project MC-Prefab by Brian-Wuest.
the class GuiStartHouseChooser method Initialize.
private void Initialize() {
// Get the upper left hand corner of the GUI box.
int grayBoxX = (this.width / 2) - 188;
int grayBoxY = (this.height / 2) - 83;
int color = Color.DARK_GRAY.getRGB();
this.serverConfiguration = ((ClientProxy) Prefab.proxy).getServerConfiguration();
// Create the Controls.
// Column 1:
this.btnHouseStyle = new GuiButtonExt(4, grayBoxX + 10, grayBoxY + 20, 90, 20, this.houseConfiguration.houseStyle.getDisplayName());
this.buttonList.add(this.btnHouseStyle);
this.btnVisualize = new GuiButtonExt(4, grayBoxX + 10, grayBoxY + 60, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_PREVIEW));
this.buttonList.add(this.btnVisualize);
int x = grayBoxX + 10;
int y = grayBoxY + 10;
int secondColumnY = y;
int secondColumnX = x + 137;
this.btnAddFurnace = new GuiCheckBox(5, secondColumnX, secondColumnY, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_FURNACE), this.houseConfiguration.addFurnace);
this.btnAddFurnace.setStringColor(color);
this.btnAddFurnace.setWithShadow(false);
this.btnAddFurnace.visible = false;
this.buttonList.add(this.btnAddFurnace);
if (this.serverConfiguration.addFurnace) {
secondColumnY += 15;
}
this.btnAddBed = new GuiCheckBox(2, secondColumnX, secondColumnY, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_BED), this.houseConfiguration.addBed);
this.btnAddBed.setStringColor(color);
this.btnAddBed.setWithShadow(false);
this.btnAddBed.visible = false;
this.buttonList.add(this.btnAddBed);
if (this.serverConfiguration.addBed) {
secondColumnY += 15;
}
this.btnAddFarm = new GuiCheckBox(6, secondColumnX, secondColumnY, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_FARM), this.houseConfiguration.addFarm);
this.btnAddFarm.setStringColor(color);
this.btnAddFarm.setWithShadow(false);
this.btnAddFarm.visible = false;
this.buttonList.add(this.btnAddFarm);
if (this.serverConfiguration.addFarm) {
secondColumnY += 15;
}
this.btnAddCraftingTable = new GuiCheckBox(5, x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_CRAFTING_TABLE), this.houseConfiguration.addCraftingTable);
this.btnAddCraftingTable.setStringColor(color);
this.btnAddCraftingTable.setWithShadow(false);
this.btnAddCraftingTable.visible = false;
this.buttonList.add(this.btnAddCraftingTable);
if (this.serverConfiguration.addCraftingTable) {
y += 15;
}
this.btnAddTorches = new GuiCheckBox(1, x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_TORCHES), this.houseConfiguration.addTorches);
this.btnAddTorches.setStringColor(color);
this.btnAddTorches.setWithShadow(false);
this.btnAddTorches.visible = false;
this.buttonList.add(this.btnAddTorches);
if (this.serverConfiguration.addTorches) {
y += 15;
}
this.btnAddChest = new GuiCheckBox(3, x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_CHEST), this.houseConfiguration.addChest);
this.btnAddChest.setStringColor(color);
this.btnAddChest.setWithShadow(false);
this.btnAddChest.visible = false;
this.buttonList.add(this.btnAddChest);
if (this.serverConfiguration.addChests) {
y += 15;
}
this.btnAddMineShaft = new GuiCheckBox(7, x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_BUILD_MINESHAFT), this.houseConfiguration.addMineShaft);
this.btnAddMineShaft.setStringColor(color);
this.btnAddMineShaft.setWithShadow(false);
this.btnAddMineShaft.visible = false;
this.buttonList.add(this.btnAddMineShaft);
if (this.serverConfiguration.addMineshaft) {
y += 15;
}
this.btnAddChestContents = new GuiCheckBox(4, x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_CHEST_CONTENTS), this.houseConfiguration.addChestContents);
this.btnAddChestContents.setStringColor(color);
this.btnAddChestContents.setWithShadow(false);
this.btnAddChestContents.visible = false;
this.buttonList.add(this.btnAddChestContents);
if (this.allowItemsInChestAndFurnace) {
y += 15;
}
this.btnIsCeilingFlat = new GuiCheckBox(8, x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_CEILING_FLAT), this.houseConfiguration.isCeilingFlat);
this.btnIsCeilingFlat.setStringColor(color);
this.btnIsCeilingFlat.setWithShadow(false);
this.btnIsCeilingFlat.visible = false;
this.buttonList.add(this.btnIsCeilingFlat);
this.btnFloorBlock = new GuiTextSlider(11, grayBoxX + 10, grayBoxY + 20, 90, 20, 0, 2, this.houseConfiguration.floorBlock.getValue(), GuiLangKeys.STARTER_HOUSE_FLOOR_STONE);
this.buttonList.add(this.btnFloorBlock);
this.btnCeilingBlock = new GuiTextSlider(12, grayBoxX + 10, grayBoxY + 60, 90, 20, 0, 2, this.houseConfiguration.ceilingBlock.getValue(), GuiLangKeys.STARTER_HOUSE_CEILING_TYPE);
this.buttonList.add(this.btnCeilingBlock);
this.btnWallWoodType = new GuiTextSlider(13, grayBoxX + 10, grayBoxY + 100, 90, 20, 0, 5, this.houseConfiguration.wallWoodType.getValue(), GuiLangKeys.STARTER_HOUSE_WALL_TYPE);
this.buttonList.add(this.btnWallWoodType);
this.btnGlassColor = new GuiButtonExt(17, grayBoxX + 10, grayBoxY + 20, 90, 20, GuiLangKeys.translateDye(this.houseConfiguration.glassColor));
this.buttonList.add(this.btnGlassColor);
// Column 2:
// Column 3:
this.btnHouseDepth = new GuiSlider(15, grayBoxX + 147, grayBoxY + 20, 90, 20, "", "", 5, serverConfiguration.maximumStartingHouseSize, this.houseConfiguration.houseDepth, false, true);
this.buttonList.add(this.btnHouseDepth);
this.btnHouseWidth = new GuiSlider(16, grayBoxX + 147, grayBoxY + 60, 90, 20, "", "", 5, serverConfiguration.maximumStartingHouseSize, this.houseConfiguration.houseWidth, false, true);
this.buttonList.add(this.btnHouseWidth);
// Tabs:
this.tabGeneral = new GuiTab(this.Tabs, GuiLangKeys.translateString(GuiLangKeys.STARTER_TAB_GENERAL), grayBoxX + 3, grayBoxY - 20);
this.Tabs.AddTab(this.tabGeneral);
this.tabConfig = new GuiTab(this.Tabs, GuiLangKeys.translateString(GuiLangKeys.STARTER_TAB_CONFIG), grayBoxX + 54, grayBoxY - 20);
this.Tabs.AddTab(this.tabConfig);
this.tabBlockTypes = new GuiTab(this.Tabs, GuiLangKeys.translateString(GuiLangKeys.STARTER_TAB_BLOCK), grayBoxX + 105, grayBoxY - 20);
this.tabBlockTypes.width = 70;
this.Tabs.AddTab(this.tabBlockTypes);
// Create the done and cancel buttons.
this.btnBuild = new GuiButtonExt(1, grayBoxX + 10, grayBoxY + 136, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_BUILD));
this.buttonList.add(this.btnBuild);
this.btnCancel = new GuiButtonExt(2, grayBoxX + 147, grayBoxY + 136, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_CANCEL));
this.buttonList.add(this.btnCancel);
}
Aggregations