use of binnie.core.api.gui.IWidget in project Binnie by ForestryMC.
the class TopLevelWidget method getQueuedWidgets.
private Collection<IWidget> getQueuedWidgets(final IWidget widget) {
List<IWidget> widgets = new ArrayList<>();
boolean addChildren = true;
IArea croppedZone = widget.getCroppedZone();
if (croppedZone != null) {
addChildren = croppedZone.contains(widget.getCropWidget().getRelativeMousePosition());
}
if (addChildren) {
ListIterator<IWidget> iterator = widget.getChildren().listIterator(widget.getChildren().size());
while (iterator.hasPrevious()) {
final IWidget child = iterator.previous();
widgets.addAll(this.getQueuedWidgets(child));
}
}
widgets.add(widget);
return widgets;
}
use of binnie.core.api.gui.IWidget in project Binnie by ForestryMC.
the class ControlList method setOptions.
public void setOptions(final Collection<T> options) {
this.deleteAllChildren();
this.allOptions.clear();
for (final T option : options) {
final IWidget optionWidget = this.parent.createOption(option, 0);
this.allOptions.put(option, optionWidget);
}
this.filterOptions();
}
use of binnie.core.api.gui.IWidget in project Binnie by ForestryMC.
the class TextureRenderer method preRender.
public final void preRender(final IWidget widget, int guiWidth, int guiHeight) {
GlStateManager.pushMatrix();
GlStateManager.translate(widget.getPosition().xPos(), widget.getPosition().yPos(), 0.0f);
RenderUtil.setColour(widget.getColor());
if (widget.isCroppedWidet()) {
final IWidget cropRelative = (widget.getCropWidget() != null) ? widget.getCropWidget() : widget;
final IPoint pos = cropRelative.getAbsolutePosition();
final IArea cropZone = widget.getCroppedZone();
GL11.glEnable(GL11.GL_SCISSOR_TEST);
this.limitArea(new Area(pos.add(cropZone.pos()), cropZone.size()), guiWidth, guiHeight);
}
GlStateManager.disableDepth();
}
use of binnie.core.api.gui.IWidget in project Binnie by ForestryMC.
the class GuiCraftGUI method mouseClicked.
@Override
protected void mouseClicked(final int x, final int y, final int button) {
IWidget origin = this.window;
if (this.window.getMousedOverWidget() != null) {
origin = this.window.getMousedOverWidget();
}
this.window.callEvent(new EventMouse.Down(origin, x, y, button));
}
Aggregations