use of eidolons.libgdx.bf.grid.GridUnitView 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());
}
use of eidolons.libgdx.bf.grid.GridUnitView in project Eidolons by IDemiurge.
the class InitiativePanel method cleanUp.
private void cleanUp() {
Map<Integer, QueueView> views = new XLinkedMap<>();
DC_Game.game.getTurnManager().getDisplayedUnitQueue().stream().forEach(unit -> {
Object o = DungeonScreen.getInstance().getGridPanel().getViewMap().get(unit);
if (o instanceof GridUnitView) {
GridUnitView view = ((GridUnitView) o);
views.put(view.getCurId(), view.getInitiativeQueueUnitView());
}
});
/*
if unit is unknown/unseen?
>>
if unit is unable to act?
proper cleanup is not done on death(), right?
*/
for (QueueViewContainer sub : queue) {
if (sub == null)
continue;
if (!views.containsKey(sub.id)) {
QueueViewContainer view = getIfExists(sub.id);
if (view == null)
continue;
if (view.getActor() == null)
continue;
removeView((sub.id));
}
}
// to ensure proper values are displayed
previewAtbReadiness(null);
}
Aggregations