Search in sources :

Example 1 with Widget

use of binnie.core.gui.Widget in project Binnie by ForestryMC.

the class WindowAnalyst method initialiseClient.

@Override
@SideOnly(Side.CLIENT)
public void initialiseClient() {
    setTitle(isDatabase ? (isMaster ? I18N.localise("genetics.gui.registry.master.title") : I18N.localise("genetics.gui.registry.title")) : I18N.localise("genetics.gui.analyst.title"));
    getWindowInventory().createSlot(0);
    baseWidget = new Widget(this);
    int x = 16;
    int y = 28;
    Collection<IBreedingSystem> activeSystems = Binnie.GENETICS.getActiveSystems();
    if (isDatabase) {
        for (IBreedingSystem syst : activeSystems) {
            new ControlSystemButton(x, y, this, syst);
            x += 22;
        }
    } else {
        new ControlSlot.Builder(this, x, y + 1).assign(InventoryType.WINDOW, 0);
        x += 22;
        new ControlSlot.Builder(this, x, y + 1).assign(InventoryType.WINDOW, 1);
        x += 26;
        setupValidators();
    }
    tabBar = new Control(this, x, 28, getWidth() - 16 - x, 20);
    analystPanel = new AnalystPanel(this);
    if (!isDatabase) {
        slideUpInv = new ControlSlide(this, (getSize().xPos() - 244) / 2, getSize().yPos() - 80 + 1, 244, 80, Alignment.BOTTOM);
        new ControlPlayerInventory(slideUpInv, true);
        slideUpInv.setSlide(false);
    }
    addEventHandler(EventKey.Down.class, event -> {
        if (event.getKey() == 205) {
            shiftPages(true);
        }
        if (event.getKey() == 203) {
            shiftPages(false);
        }
    });
    if (!isDatabase) {
        analystNone = new AnalystNoneControl(this);
    }
    setIndividual(null);
    IBreedingSystem first = Binnie.GENETICS.getFirstActiveSystem();
    setSystem(first);
}
Also used : IWidget(binnie.core.api.gui.IWidget) Widget(binnie.core.gui.Widget) ITitledWidget(binnie.core.api.gui.ITitledWidget) EventKey(binnie.core.gui.events.EventKey) IBreedingSystem(binnie.core.api.genetics.IBreedingSystem) Control(binnie.core.gui.controls.core.Control) ControlSlide(binnie.core.gui.minecraft.control.ControlSlide) ControlPlayerInventory(binnie.core.gui.minecraft.control.ControlPlayerInventory) ControlSlot(binnie.core.gui.minecraft.control.ControlSlot) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

IBreedingSystem (binnie.core.api.genetics.IBreedingSystem)1 ITitledWidget (binnie.core.api.gui.ITitledWidget)1 IWidget (binnie.core.api.gui.IWidget)1 Widget (binnie.core.gui.Widget)1 Control (binnie.core.gui.controls.core.Control)1 EventKey (binnie.core.gui.events.EventKey)1 ControlPlayerInventory (binnie.core.gui.minecraft.control.ControlPlayerInventory)1 ControlSlide (binnie.core.gui.minecraft.control.ControlSlide)1 ControlSlot (binnie.core.gui.minecraft.control.ControlSlot)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1