@Override public ITexture getTypeTexture() { return new StandardTexture(96, 96, 96, 96, BinnieCoreTexture.GUI_BREEDING); } }
public ControlProgress(final IWidget parent, final int x, final int y, final Texture progressBlank, final Texture progressBar, final Alignment dir) { super(parent, x, y, (progressBlank == null) ? 0 : progressBlank.width(), (progressBlank == null) ? 0 : progressBlank.height()); this.progressBlank = progressBlank; this.progressBar = progressBar; this.progress = 0.0f; this.direction = dir; }
@SideOnly(Side.CLIENT) public ResourceLocation getTexture() { return this.getResourceLocation(); } }
@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; }
@Override public int height() { return this.getArea().height(); }
padding = parseBorder(array); Texture texture = new Texture(uv, padding, border, textureSheet); textures.put(name, texture); } catch (Exception e) {
@Override public ITexture crop(final Alignment anchor, final int dist) { return this.crop(new Border(anchor.opposite(), dist)); }
@Override public ITexture getTypeTexture() { return new StandardTexture(0, 0, 96, 96, BinnieCoreTexture.GUI_BREEDING); } }
@Override public int width() { return this.getArea().width(); }
@Override public ITexture crop(final IBorder crop) { final Texture copy = new Texture(this.area, this.padding, this.border, this.binnieTexture); if (crop.getBottom() > 0) { copy.border.setBottom(0); copy.padding.setBottom(copy.padding.getBottom() - Math.min(crop.getBottom(), copy.padding.getBottom())); copy.area.setHeight(copy.area.height() - crop.getBottom()); } if (crop.getTop() > 0) { copy.border.setTop(0); copy.padding.setTop(copy.padding.getTop() - Math.min(crop.getTop(), copy.padding.getTop())); copy.area.setHeight(copy.area.height() - crop.getTop()); copy.area.setYPos(copy.area.yPos() + crop.getTop()); } if (crop.getRight() > 0) { copy.border.setRight(0); copy.padding.setRight(copy.padding.getRight() - Math.min(crop.getRight(), copy.padding.getRight())); copy.area.setWidth(copy.area.width() - crop.getRight()); } if (crop.getLeft() > 0) { copy.border.setLeft(0); copy.padding.setLeft(copy.padding.getLeft() - Math.min(crop.getLeft(), copy.padding.getLeft())); copy.area.setWidth(copy.area.width() - crop.getLeft()); copy.area.setXPos(copy.area.xPos() + crop.getLeft()); } return copy; }
@Override public ITexture getTypeTexture() { return new StandardTexture(0, 96, 96, 96, BinnieCoreTexture.GUI_BREEDING); } }
@Override public ITexture getTypeTexture() { return new StandardTexture(96, 0, 96, 96, BinnieCoreTexture.GUI_BREEDING); } }
public ControlChromoPicker(ControlChromosome parent, int x, int y, IChromosomeType chromo) { super(parent, x, y, 16, 16); selected = new StandardTexture(160, 18, 16, 16, BinnieCoreTexture.GUI_PUNNETT); texture = new StandardTexture(160, 34, 16, 16, BinnieCoreTexture.GUI_PUNNETT); type = chromo; addAttribute(Attribute.MOUSE_OVER); this.parent = parent; addSelfEventHandler(EventWidget.StartMouseOver.class, event -> { callEvent(new EventValueChanged<Object>(getWidget(), type)); }); addSelfEventHandler(EventWidget.EndMouseOver.class, event -> { callEvent(new EventValueChanged<>(getWidget(), null)); }); }
@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(""); } }); }