use of eidolons.libgdx.gui.tooltips.LastSeenTooltipFactory in project Eidolons by IDemiurge.
the class UnitViewFactory method create.
public static GridUnitView create(BattleFieldObject bfObj) {
UnitViewOptions options = new UnitViewOptions(bfObj);
GridUnitView view = new GridUnitView(options);
if (VisionMaster.isLastSeenOn()) {
LastSeenView lsv = new LastSeenView(options, view);
view.setLastSeenView(lsv);
new LastSeenTooltipFactory().add(lsv, bfObj);
}
view.setOutlinePathSupplier(() -> {
OUTLINE_TYPE type = null;
// if (bfObj instanceof Unit) {
// if (!VisionManager.checkVisible(bfObj)) {
// type = OUTLINE_TYPE.DARK_OUTLINE;
// }
// }
// if (type == null)
type = bfObj.getOutlineTypeForPlayer();
if (type == null)
return null;
String path = Eidolons.game.getVisionMaster().getVisibilityMaster().getImagePath(type, bfObj);
return (path);
});
view.createHpBar((new ResourceSourceImpl(bfObj)));
if (bfObj instanceof Unit) {
view.getInitiativeQueueUnitView().getHpBar().setTeamColor(options.getTeamColor());
}
view.getHpBar().setTeamColor(options.getTeamColor());
final UnitViewTooltip tooltip = new UnitViewTooltip(view);
tooltip.setUserObject(UnitViewTooltipFactory.create(bfObj));
view.setToolTip(tooltip);
ClickListener listener = createListener(bfObj);
view.addListener(listener);
view.getInitiativeQueueUnitView().addListener(listener);
return view;
}
Aggregations