Search in sources :

Example 1 with StandardTexture

use of binnie.core.gui.resource.textures.StandardTexture in project Binnie by ForestryMC.

the class Window method initGui.

@SideOnly(Side.CLIENT)
public final void initGui() {
    if (this.hasBeenInitialised) {
        return;
    }
    this.bgText1 = new StandardTexture(0, 0, 256, 256, this.getBackgroundTextureFile(1));
    if (this.getSize().xPos() > 256) {
        this.bgText2 = new StandardTexture(0, 0, 256, 256, this.getBackgroundTextureFile(2));
    }
    if (!BinnieCore.getBinnieProxy().checkTexture(this.bgText1.getTexture())) {
        this.bgText1 = null;
        this.bgText2 = null;
    }
    this.initialiseClient();
    this.hasBeenInitialised = true;
}
Also used : StandardTexture(binnie.core.gui.resource.textures.StandardTexture) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 2 with StandardTexture

use of binnie.core.gui.resource.textures.StandardTexture in project Binnie by ForestryMC.

the class WindowFieldKit method initialiseClient.

@Override
@SideOnly(Side.CLIENT)
public void initialiseClient() {
    this.setTitle(I18N.localise("binniecore.gui.fieldkit.title"));
    CraftGUI.RENDER.setStyleSheet(StyleSheetManager.getSheet(StyleSheetManager.PUNNETT_SHEET));
    WindowInventory inventory = this.getWindowInventory();
    inventory.createSlot(INDIVIDUAL_SLOT);
    inventory.createSlot(PAPER_SLOT);
    this.setupValidators();
    new ControlPlayerInventory(this);
    final Point handGlass = new Point(16, 32);
    this.GlassControl = new ControlImage(this, handGlass.xPos(), handGlass.yPos(), new StandardTexture(0, 160, 96, 96, BinnieCoreTexture.GUI_PUNNETT));
    new ControlSlot.Builder(this, handGlass.xPos() + 54, handGlass.yPos() + 26).assign(InventoryType.WINDOW, 0);
    new ControlSlot.Builder(this, 208, 8).assign(InventoryType.WINDOW, 1);
    (this.text = new ControlText(this, new Point(232, 13), I18N.localise("binniecore.gui.fieldkit.paper"))).setColor(2236962);
    (this.text = new ControlText(this, new Area(0, 120, this.getWidth(), 24), "", TextJustification.MIDDLE_CENTER)).setColor(2236962);
    this.chromo = new ControlChromosome(this, 150, 24);
    this.addEventHandler(EventValueChanged.class, EventHandlerOrigin.DIRECT_CHILD, this.chromo, event -> {
        final IChromosomeType type = (IChromosomeType) event.getValue();
        if (type != null && WindowFieldKit.this.info.containsKey(type)) {
            final String t = WindowFieldKit.this.info.get(type);
            WindowFieldKit.this.text.setValue(t);
        } else {
            WindowFieldKit.this.text.setValue("");
        }
    });
}
Also used : StandardTexture(binnie.core.gui.resource.textures.StandardTexture) Area(binnie.core.gui.geometry.Area) WindowInventory(binnie.core.gui.minecraft.WindowInventory) ControlPlayerInventory(binnie.core.gui.minecraft.control.ControlPlayerInventory) ControlText(binnie.core.gui.controls.ControlText) ControlSlot(binnie.core.gui.minecraft.control.ControlSlot) Point(binnie.core.gui.geometry.Point) ControlImage(binnie.core.gui.minecraft.control.ControlImage) IChromosomeType(forestry.api.genetics.IChromosomeType) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

StandardTexture (binnie.core.gui.resource.textures.StandardTexture)2 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)2 ControlText (binnie.core.gui.controls.ControlText)1 Area (binnie.core.gui.geometry.Area)1 Point (binnie.core.gui.geometry.Point)1 WindowInventory (binnie.core.gui.minecraft.WindowInventory)1 ControlImage (binnie.core.gui.minecraft.control.ControlImage)1 ControlPlayerInventory (binnie.core.gui.minecraft.control.ControlPlayerInventory)1 ControlSlot (binnie.core.gui.minecraft.control.ControlSlot)1 IChromosomeType (forestry.api.genetics.IChromosomeType)1