Search in sources :

Example 6 with GuiPriceBar

use of kingdoms.api.gui.GuiPriceBar in project Tale-of-Kingdoms by Ivasik78.

the class GuiToKLoading method initGui.

@Override
public void initGui() {
    this.bar = new GuiPriceBar(1, this.width / 2 - 100, this.height / 2 - 10, 200, 20, 1.0F, "red");
    this.buttonList.clear();
    this.buttonList.add(new GuiButton(0, this.width / 2 - 60, this.height / 2 + 25, 120, 20, I18n.format("gui.exit")));
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiPriceBar(kingdoms.api.gui.GuiPriceBar)

Example 7 with GuiPriceBar

use of kingdoms.api.gui.GuiPriceBar in project Tale-of-Kingdoms by Ivasik78.

the class GuiBuildScreen method initGui.

@Override
public void initGui() {
    this.buttonList.clear();
    this.woodBar = new GuiPriceBar(0, this.width / 2 - 100, 40, 90, 12, 1.0F, "red");
    this.woodBar.setBar((float) ResourcesHandler.INSTANCE.getwoodResource() / 320.0F);
    this.cobblestoneBar = new GuiPriceBar(1, this.width / 2 - 100, 60, 90, 12, 1.0F, "red");
    this.cobblestoneBar.setBar((float) ResourcesHandler.INSTANCE.getcobbleResource() / 320.0F);
    this.buttonList.add(new GuiButton(1, this.width / 2 - 25, 220, 50, 20, I18n.format("gui.exit")));
    this.buttonList.add(new GuiButton(2, this.width / 2 - 110, 80, 110, 20, I18n.format("gui.build.give.logs")));
    this.buttonList.add(new GuiButton(3, this.width / 2 + 5, 80, 110, 20, I18n.format("gui.build.give.cobble")));
    if (!Buildings.INSTANCE.getBuilding(1)) {
        this.addButton(4, this.width / 2 - 55, 130, I18n.format("gui.build.buildings.stage_1"));
    } else if (!Buildings.INSTANCE.getBuilding(8) && Buildings.INSTANCE.getBuilding(1)) {
        if (!Buildings.INSTANCE.getBuilding(2)) {
            this.addButton(5, this.width / 2 - 120, 120, I18n.format("gui.build.buildings.smallHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(3)) {
            this.addButton(6, this.width / 2 + 5, 120, I18n.format("gui.build.buildings.smallHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(4)) {
            this.addButton(7, this.width / 2 - 120, 180, I18n.format("gui.build.buildings.largeHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(6)) {
            this.addButton(8, this.width / 2 - 120, 140, I18n.format("gui.build.buildings.itemsShop"));
        }
        if (!Buildings.INSTANCE.getBuilding(7)) {
            this.addButton(9, this.width / 2 - 120, 160, I18n.format("gui.build.buildings.stockMarket"));
        }
        if (!Buildings.INSTANCE.getBuilding(8) && this.buttonList.size() == 3) {
            this.addButton(10, this.width / 2 - 55, 130, I18n.format("gui.build.buildings.stage_2"));
        }
    } else if (Buildings.INSTANCE.getBuilding(8) && !Buildings.INSTANCE.getBuilding(16)) {
        if (!Buildings.INSTANCE.getBuilding(9)) {
            this.addButton(11, this.width / 2 - 120, 120, I18n.format("gui.build.buildings.smallHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(10)) {
            this.addButton(12, this.width / 2 - 120, 180, I18n.format("gui.build.buildings.smallHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(11)) {
            this.addButton(13, this.width / 2 - 120, 140, I18n.format("gui.build.buildings.largeHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(12)) {
            this.addButton(14, this.width / 2 - 120, 160, I18n.format("gui.build.buildings.builderHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(13)) {
            this.addButton(15, this.width / 2 + 5, 120, I18n.format("gui.build.buildings.barracks"));
        }
        if (!Buildings.INSTANCE.getBuilding(14)) {
            this.addButton(16, this.width / 2 + 5, 140, I18n.format("gui.build.buildings.foodShop"));
        }
        if (!Buildings.INSTANCE.getBuilding(15)) {
            this.addButton(17, this.width / 2 + 5, 160, I18n.format("gui.build.buildings.blocksShop"));
        }
        if (!Buildings.INSTANCE.getBuilding(16) && this.buttonList.size() == 3) {
            this.addButton(18, this.width / 2 - 55, 130, I18n.format("gui.build.buildings.stage_3"));
        }
    } else if (Buildings.INSTANCE.getBuilding(16) && !Buildings.INSTANCE.getBuilding(25)) {
        if (!Buildings.INSTANCE.getBuilding(17)) {
            this.addButton(19, this.width / 2 - 120, 140, I18n.format("gui.build.buildings.smallHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(18)) {
            this.addButton(20, this.width / 2 - 120, 160, I18n.format("gui.build.buildings.smallHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(19)) {
            this.addButton(21, this.width / 2 - 120, 180, I18n.format("gui.build.buildings.smallHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(20)) {
            this.addButton(22, this.width / 2 + 5, 160, I18n.format("gui.build.buildings.largeHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(21)) {
            this.addButton(23, this.width / 2 - 120, 120, I18n.format("gui.build.buildings.tavern"));
        }
        if (!Buildings.INSTANCE.getBuilding(22)) {
            this.addButton(24, this.width / 2 + 5, 140, I18n.format("gui.build.buildings.chapel"));
        }
        if (!Buildings.INSTANCE.getBuilding(23)) {
            this.addButton(25, this.width / 2 + 5, 180, I18n.format("gui.build.buildings.library"));
        }
        if (!Buildings.INSTANCE.getBuilding(24)) {
            this.addButton(26, this.width / 2 + 5, 120, I18n.format("gui.build.buildings.mageHall"));
        }
        if (!Buildings.INSTANCE.getBuilding(25) && this.buttonList.size() == 3) {
            this.addButton(27, this.width / 2 - 55, 130, I18n.format("gui.build.buildings.stage_4"));
        }
    } else if (Buildings.INSTANCE.getBuilding(25) && !Buildings.INSTANCE.getBuilding(26)) {
        if (!Buildings.INSTANCE.getBuilding(31)) {
            this.addButton(28, this.width / 2 - 120, 120, I18n.format("gui.build.buildings.lightHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(29)) {
            this.addButton(29, this.width / 2 - 120, 140, I18n.format("gui.build.buildings.easternTower"));
        }
        if (!Buildings.INSTANCE.getBuilding(30)) {
            this.addButton(30, this.width / 2 - 120, 160, I18n.format("gui.build.buildings.fishermanHut"));
        }
        if (!Buildings.INSTANCE.getBuilding(32)) {
            this.addButton(31, this.width / 2 + 5, 140, I18n.format("gui.build.buildings.windmill"));
        }
        if (!Buildings.INSTANCE.getBuilding(33)) {
            this.addButton(32, this.width / 2 + 5, 120, I18n.format("gui.build.buildings.observerPost"));
        }
        if (!Buildings.INSTANCE.getBuilding(26) && this.buttonList.size() == 3) {
            this.buttonList.add(new GuiButton(33, this.width / 2 - 65, 130, 140, 20, I18n.format("gui.build.buildings.stage_5")));
        }
    } else if (Buildings.INSTANCE.getBuilding(26) && !Buildings.INSTANCE.getBuilding(27)) {
        if (!Buildings.INSTANCE.getBuilding(34)) {
            this.addButton(34, this.width / 2 - 120, 120, I18n.format("gui.build.buildings.smallHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(35)) {
            this.addButton(35, this.width / 2 - 120, 140, I18n.format("gui.build.buildings.smallHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(36)) {
            this.addButton(36, this.width / 2 - 120, 160, I18n.format("gui.build.buildings.smallHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(37)) {
            this.addButton(37, this.width / 2 - 120, 180, I18n.format("gui.build.buildings.smallHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(38)) {
            this.addButton(38, this.width / 2 - 120, 200, I18n.format("gui.build.buildings.largeHouse"));
        }
        if (!Buildings.INSTANCE.getBuilding(39)) {
            this.addButton(39, this.width / 2 + 5, 120, I18n.format("gui.build.buildings.centerTower"));
        }
        if (!Buildings.INSTANCE.getBuilding(40)) {
            this.addButton(40, this.width / 2 + 5, 140, I18n.format("gui.build.buildings.northernTower"));
        }
        if (!Buildings.INSTANCE.getBuilding(28)) {
            this.addButton(41, this.width / 2 + 5, 160, I18n.format("gui.build.buildings.coliseum"));
        }
        if (!Buildings.INSTANCE.getBuilding(41)) {
            this.addButton(42, this.width / 2 + 5, 180, I18n.format("gui.build.buildings.stables"));
        }
        if (!Buildings.INSTANCE.getBuilding(42)) {
            this.addButton(43, this.width / 2 + 5, 200, I18n.format("gui.build.buildings.zeppelin"));
        }
        if (!Buildings.INSTANCE.getBuilding(27) && this.buttonList.size() == 3) {
            this.addButton(44, this.width / 2 - 65, 130, I18n.format("gui.build.buildings.castle"));
        }
    }
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiPriceBar(kingdoms.api.gui.GuiPriceBar)

Aggregations

GuiPriceBar (kingdoms.api.gui.GuiPriceBar)7 GuiButton (net.minecraft.client.gui.GuiButton)6