Search in sources :

Example 1 with GuiCheckBox

use of com.wuest.prefab.Gui.Controls.GuiCheckBox 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);
}
Also used : GuiTab(com.wuest.prefab.Gui.Controls.GuiTab) GuiButtonExt(net.minecraftforge.fml.client.config.GuiButtonExt) GuiCheckBox(com.wuest.prefab.Gui.Controls.GuiCheckBox) GuiTextSlider(com.wuest.prefab.Gui.Controls.GuiTextSlider) GuiSlider(net.minecraftforge.fml.client.config.GuiSlider)

Example 2 with GuiCheckBox

use of com.wuest.prefab.Gui.Controls.GuiCheckBox in project MC-Prefab by Brian-Wuest.

the class GuiInstantBridge method Initialize.

@Override
protected void Initialize() {
    this.configuration = ClientEventHandler.playerConfig.getClientConfig("InstantBridge", InstantBridgeConfiguration.class);
    this.configuration.pos = this.pos;
    // Get the upper left hand corner of the GUI box.
    int grayBoxX = this.getCenteredXAxis() - 213;
    int grayBoxY = this.getCenteredYAxis() - 83;
    // Create the buttons.
    this.btnMaterialType = new GuiButtonExt(3, grayBoxX + 10, grayBoxY + 20, 90, 20, this.configuration.bridgeMaterial.getTranslatedName());
    this.buttonList.add(this.btnMaterialType);
    this.sldrBridgeLength = new GuiSlider(5, grayBoxX + 147, grayBoxY + 20, 90, 20, "", "", 25, 75, this.configuration.bridgeLength, false, true);
    this.buttonList.add(this.sldrBridgeLength);
    this.chckIncludeRoof = new GuiCheckBox(6, grayBoxX + 147, grayBoxY + 55, GuiLangKeys.translateString(GuiLangKeys.INCLUDE_ROOF), this.configuration.includeRoof);
    this.buttonList.add(this.chckIncludeRoof);
    this.sldrInteriorHeight = new GuiSlider(7, grayBoxX + 147, grayBoxY + 90, 90, 20, "", "", 3, 8, this.configuration.interiorHeight, false, true);
    this.buttonList.add(this.sldrInteriorHeight);
    this.sldrInteriorHeight.enabled = this.chckIncludeRoof.isChecked();
    this.btnVisualize = new GuiButtonExt(4, grayBoxX + 10, grayBoxY + 90, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_PREVIEW));
    this.buttonList.add(this.btnVisualize);
    // 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);
}
Also used : GuiButtonExt(net.minecraftforge.fml.client.config.GuiButtonExt) InstantBridgeConfiguration(com.wuest.prefab.Config.Structures.InstantBridgeConfiguration) GuiCheckBox(com.wuest.prefab.Gui.Controls.GuiCheckBox) GuiSlider(net.minecraftforge.fml.client.config.GuiSlider)

Example 3 with GuiCheckBox

use of com.wuest.prefab.Gui.Controls.GuiCheckBox in project MC-Prefab by Brian-Wuest.

the class GuiModerateHouse method Initialize.

@Override
protected void Initialize() {
    this.serverConfiguration = ((ClientProxy) Prefab.proxy).getServerConfiguration();
    this.configuration = ClientEventHandler.playerConfig.getClientConfig("Moderate Houses", ModerateHouseConfiguration.class);
    this.configuration.pos = this.pos;
    int color = Color.DARK_GRAY.getRGB();
    // Get the upper left hand corner of the GUI box.
    int grayBoxX = this.getCenteredXAxis() - 212;
    int grayBoxY = this.getCenteredYAxis() - 83;
    this.btnHouseStyle = new GuiButtonExt(4, grayBoxX + 10, grayBoxY + 20, 90, 20, this.configuration.houseStyle.getDisplayName());
    this.buttonList.add(this.btnHouseStyle);
    // Create the buttons.
    this.btnVisualize = new GuiButtonExt(4, grayBoxX + 10, grayBoxY + 60, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_PREVIEW));
    this.buttonList.add(this.btnVisualize);
    // 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);
    int x = grayBoxX + 130;
    int y = grayBoxY + 10;
    this.btnAddChest = new GuiCheckBox(6, x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_CHEST), this.configuration.addChests);
    this.btnAddChest.setStringColor(color);
    this.btnAddChest.setWithShadow(false);
    this.buttonList.add(this.btnAddChest);
    y += 15;
    this.btnAddMineShaft = new GuiCheckBox(7, x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_BUILD_MINESHAFT), this.configuration.addChestContents);
    this.btnAddMineShaft.setStringColor(color);
    this.btnAddMineShaft.setWithShadow(false);
    this.buttonList.add(this.btnAddMineShaft);
    y += 15;
    this.btnAddChestContents = new GuiCheckBox(8, x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_CHEST_CONTENTS), this.configuration.addMineshaft);
    this.btnAddChestContents.setStringColor(color);
    this.btnAddChestContents.setWithShadow(false);
    this.buttonList.add(this.btnAddChestContents);
}
Also used : ModerateHouseConfiguration(com.wuest.prefab.Config.Structures.ModerateHouseConfiguration) GuiButtonExt(net.minecraftforge.fml.client.config.GuiButtonExt) GuiCheckBox(com.wuest.prefab.Gui.Controls.GuiCheckBox)

Aggregations

GuiCheckBox (com.wuest.prefab.Gui.Controls.GuiCheckBox)3 GuiButtonExt (net.minecraftforge.fml.client.config.GuiButtonExt)3 GuiSlider (net.minecraftforge.fml.client.config.GuiSlider)2 InstantBridgeConfiguration (com.wuest.prefab.Config.Structures.InstantBridgeConfiguration)1 ModerateHouseConfiguration (com.wuest.prefab.Config.Structures.ModerateHouseConfiguration)1 GuiTab (com.wuest.prefab.Gui.Controls.GuiTab)1 GuiTextSlider (com.wuest.prefab.Gui.Controls.GuiTextSlider)1