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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations