use of forestry.core.gui.widgets.Widget in project ForestryMC by ForestryMC.
the class GuiEscritoire method addTokenWidget.
private void addTokenWidget(EscritoireGame game, int x, int y, int index) {
Widget gameTokenWidget = new GameTokenWidget(game, widgetManager, x, y, index);
widgetManager.add(gameTokenWidget);
}
use of forestry.core.gui.widgets.Widget in project ForestryMC by ForestryMC.
the class WidgetManager method drawWidgets.
public void drawWidgets() {
gui.setZLevel(100.0F);
GuiForestry.getItemRenderer().zLevel = 100.0F;
for (Widget slot : widgets) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
slot.draw(0, 0);
}
gui.setZLevel(0.0F);
GuiForestry.getItemRenderer().zLevel = 0.0F;
}
use of forestry.core.gui.widgets.Widget in project ForestryMC by ForestryMC.
the class GuiForestry method getFluidStackAtPosition.
@Nullable
public FluidStack getFluidStackAtPosition(int mouseX, int mouseY) {
for (Widget widget : widgetManager.getWidgets()) {
if (widget instanceof TankWidget && widget.isMouseOver(mouseX - guiLeft, mouseY - guiTop)) {
TankWidget tankWidget = (TankWidget) widget;
IFluidTank tank = tankWidget.getTank();
if (tank != null) {
return tank.getFluid();
}
}
}
return null;
}
use of forestry.core.gui.widgets.Widget in project ForestryMC by ForestryMC.
the class GuiGeneticFilter method mouseClicked.
@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
super.mouseClicked(mouseX, mouseY, mouseButton);
if (searchField != null) {
searchField.mouseClicked(mouseX, mouseY, mouseButton);
}
Widget widget = widgetManager.getAtPosition(mouseX - guiLeft, mouseY - guiTop);
if (widget == null) {
deselectFilter();
}
}
Aggregations