use of eidolons.libgdx.bf.grid.GenericGridView in project Eidolons by IDemiurge.
the class GlobalController method tab.
private void tab() {
GridUnitView hovered = DungeonScreen.getInstance().getGridPanel().getHoverObj();
GridCellContainer cell = (GridCellContainer) hovered.getParent();
List<GenericGridView> list = new ArrayList<>(cell.getUnitViewsVisible());
if (list.size() == 1)
// or do something else
return;
SortMaster.sortByExpression(list, view -> view.hashCode());
int index = list.indexOf(hovered);
index++;
if (list.size() <= index)
index = 0;
GuiEventManager.trigger(GuiEventType.GRID_OBJ_HOVER_OFF, hovered);
GenericGridView newFocus = list.get(index);
cell.popupUnitView(newFocus);
GuiEventManager.trigger(GuiEventType.GRID_OBJ_HOVER_ON, newFocus);
GuiEventManager.trigger(GuiEventType.SHOW_TOOLTIP, newFocus.getTooltip());
}
Aggregations