Search in sources :

Example 6 with IGuiPanel

use of betterquesting.api2.client.gui.panels.IGuiPanel in project BetterQuesting by Funwayguy.

the class CanvasScrolling method onKeyTyped.

@Override
public boolean onKeyTyped(char c, int keycode) {
    boolean used = false;
    ListIterator<IGuiPanel> pnIter = guiPanels.listIterator(guiPanels.size());
    while (pnIter.hasPrevious()) {
        IGuiPanel entry = pnIter.previous();
        if (entry.isEnabled() && entry.onKeyTyped(c, keycode)) {
            used = true;
            break;
        }
    }
    return used;
}
Also used : IGuiPanel(betterquesting.api2.client.gui.panels.IGuiPanel)

Example 7 with IGuiPanel

use of betterquesting.api2.client.gui.panels.IGuiPanel in project BetterQuesting by Funwayguy.

the class CanvasScrolling method getTooltip.

@Override
public List<String> getTooltip(int mx, int my) {
    if (!transform.contains(mx, my)) {
        return null;
    }
    float zs = zoomScale.readValue();
    int tx = transform.getX();
    int ty = transform.getY();
    int smx = (int) ((mx - tx) / zs) + lsx;
    int smy = (int) ((my - ty) / zs) + lsy;
    ListIterator<IGuiPanel> pnIter = guiPanels.listIterator(guiPanels.size());
    List<String> tt;
    while (pnIter.hasPrevious()) {
        IGuiPanel entry = pnIter.previous();
        if (!entry.isEnabled()) {
            continue;
        }
        tt = entry.getTooltip(smx, smy);
        if (tt != null && tt.size() > 0) {
            return tt;
        }
    }
    return null;
}
Also used : IGuiPanel(betterquesting.api2.client.gui.panels.IGuiPanel)

Example 8 with IGuiPanel

use of betterquesting.api2.client.gui.panels.IGuiPanel in project BetterQuesting by Funwayguy.

the class GuiScreenCanvas method getTooltip.

@Override
public List<String> getTooltip(int mx, int my) {
    ListIterator<IGuiPanel> pnIter = guiPanels.listIterator(guiPanels.size());
    List<String> tt;
    while (pnIter.hasPrevious()) {
        IGuiPanel entry = pnIter.previous();
        if (!entry.isEnabled()) {
            continue;
        }
        tt = entry.getTooltip(mx, my);
        if (tt != null && tt.size() > 0) {
            return tt;
        }
    }
    return null;
}
Also used : IGuiPanel(betterquesting.api2.client.gui.panels.IGuiPanel)

Example 9 with IGuiPanel

use of betterquesting.api2.client.gui.panels.IGuiPanel in project BetterQuesting by Funwayguy.

the class GuiScreenCanvas method onMouseClick.

@Override
public boolean onMouseClick(int mx, int my, int click) {
    boolean used = false;
    ListIterator<IGuiPanel> pnIter = guiPanels.listIterator(guiPanels.size());
    while (pnIter.hasPrevious()) {
        IGuiPanel entry = pnIter.previous();
        if (entry.isEnabled() && entry.onMouseClick(mx, my, click)) {
            used = true;
            break;
        }
    }
    return used;
}
Also used : IGuiPanel(betterquesting.api2.client.gui.panels.IGuiPanel)

Example 10 with IGuiPanel

use of betterquesting.api2.client.gui.panels.IGuiPanel in project BetterQuesting by Funwayguy.

the class CanvasScrolling method onMouseClick.

@Override
public boolean onMouseClick(int mx, int my, int click) {
    if (!transform.contains(mx, my)) {
        return false;
    }
    float zs = zoomScale.readValue();
    int tx = transform.getX();
    int ty = transform.getY();
    int smx = (int) ((mx - tx) / zs) + lsx;
    int smy = (int) ((my - ty) / zs) + lsy;
    boolean used = false;
    ListIterator<IGuiPanel> pnIter = guiPanels.listIterator(guiPanels.size());
    while (pnIter.hasPrevious()) {
        IGuiPanel entry = pnIter.previous();
        if (entry.isEnabled() && entry.onMouseClick(smx, smy, click)) {
            used = true;
            break;
        }
    }
    if (!used && (click == 0 || click == 2)) {
        dragSX = scrollX.readValue();
        dragSY = scrollY.readValue();
        dragMX = mx;
        dragMY = my;
        isDragging = true;
    }
    return used;
}
Also used : IGuiPanel(betterquesting.api2.client.gui.panels.IGuiPanel)

Aggregations

IGuiPanel (betterquesting.api2.client.gui.panels.IGuiPanel)11 Minecraft (net.minecraft.client.Minecraft)2 GuiRectangle (betterquesting.api2.client.gui.misc.GuiRectangle)1 ArrayList (java.util.ArrayList)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1