Search in sources :

Example 1 with GuiWiki

use of igwmod.gui.GuiWiki in project PneumaticCraft by MineMaarten.

the class GuiProgrammer method onIGWAction.

@Optional.Method(modid = ModIds.IGWMOD)
private void onIGWAction() {
    int x = lastMouseX;
    int y = lastMouseY;
    IProgWidget hoveredWidget = programmerUnit.getHoveredWidget(x, y);
    if (hoveredWidget != null) {
        GuiWiki gui = new GuiWiki();
        FMLClientHandler.instance().showGuiScreen(gui);
        gui.setCurrentFile("pneumaticcraft:progwidget/" + hoveredWidget.getWidgetString());
    }
    for (IProgWidget widget : visibleSpawnWidgets) {
        if (widget != draggingWidget && x - guiLeft >= widget.getX() && y - guiTop >= widget.getY() && x - guiLeft <= widget.getX() + widget.getWidth() / 2 && y - guiTop <= widget.getY() + widget.getHeight() / 2) {
            GuiWiki gui = new GuiWiki();
            FMLClientHandler.instance().showGuiScreen(gui);
            gui.setCurrentFile("pneumaticcraft:progwidget/" + widget.getWidgetString());
        }
    }
}
Also used : IProgWidget(pneumaticCraft.common.progwidgets.IProgWidget) GuiWiki(igwmod.gui.GuiWiki) Point(java.awt.Point)

Aggregations

GuiWiki (igwmod.gui.GuiWiki)1 Point (java.awt.Point)1 IProgWidget (pneumaticCraft.common.progwidgets.IProgWidget)1