use of eidolons.libgdx.gui.tooltips.UnitViewTooltip 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;
}
use of eidolons.libgdx.gui.tooltips.UnitViewTooltip in project Eidolons by IDemiurge.
the class UnitViewFactory method createGraveyardView.
public static BaseView createGraveyardView(BattleFieldObject bfObj) {
BaseView view = new BaseView(getOrCreateR(bfObj.getImagePath()), bfObj.getImagePath());
final UnitViewTooltip tooltip = new UnitViewTooltip(view);
tooltip.setUserObject(UnitViewTooltipFactory.create(bfObj));
view.addListener(tooltip.getController());
view.addListener(createListener(bfObj));
return view;
}
Aggregations