use of eidolons.libgdx.anims.text.FloatingText in project Eidolons by IDemiurge.
the class AnimMaster method bindEvents.
public void bindEvents() {
DC_SoundMaster.bindEvents();
GuiEventManager.bind(GuiEventType.ADD_FLOATING_TEXT, p -> {
FloatingText floatingText = (FloatingText) p.get();
// if (!floatingText.isInitialized())
floatingText.init();
addActor(floatingText);
});
GuiEventManager.bind(GuiEventType.MOUSE_HOVER, p -> {
if (!isOn()) {
return;
}
if (!(p.get() instanceof Unit)) {
return;
}
if (showBuffAnimsOnHoverLength == null) {
return;
}
try {
mouseHover((Unit) p.get());
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
});
GuiEventManager.bind(GuiEventType.ACTION_INTERRUPTED, p -> {
if (!isOn()) {
return;
}
leadAnimation.interrupt();
});
GuiEventManager.bind(GuiEventType.ACTION_BEING_RESOLVED, p -> {
// CompositeAnim animation = constructor.getOrCreate((DC_ActiveObj) portrait.get());
});
GuiEventManager.bind(GuiEventType.ACTION_RESOLVES, p -> {
if (!isOn()) {
return;
}
ActionInput input = (ActionInput) p.get();
try {
initActionAnimation(input.getAction(), (AnimContext) input.getContext());
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
});
// GuiEventManager.bind(GuiEventType.UPDATE_BUFFS, p -> {
// updateContinuousAnims();
// });
// GuiEventManager.bind(GuiEventType.ABILITY_RESOLVES, p -> {
// if (!isOn()) {
// return;
// }
// Ability ability = (Ability) p.get();
// what about triggers?
// getParentAnim(ability.getRef().getActive()).addAbilityAnims(ability);
// });
GuiEventManager.bind(GuiEventType.INGAME_EVENT_TRIGGERED, p -> {
if (!isOn()) {
return;
}
try {
initEventAnimation((Event) p.get());
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
});
GuiEventManager.bind(GuiEventType.EFFECT_APPLIED, p -> {
if (!isOn()) {
return;
}
try {
initEffectAnimation((Effect) p.get());
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
});
}
use of eidolons.libgdx.anims.text.FloatingText in project Eidolons by IDemiurge.
the class Activator method cannotActivate.
public void cannotActivate() {
LogMaster.log(1, "Cannot Activate " + getEntity().getName() + ": " + getEntity().getCosts().getReasonsString());
if (!getEntity().getOwnerObj().isMine())
if (getEntity().getOwnerObj().isAiControlled())
return;
FloatingText f = FloatingTextMaster.getInstance().getFloatingText(getEntity(), TEXT_CASES.REQUIREMENT, getEntity().getCosts().getReasonsString());
f.setDisplacementY(100);
f.setDuration(3);
Vector2 c = GridMaster.getCenteredPos(getEntity().getOwnerObj().getCoordinates());
f.setX(c.x);
f.setY(c.y);
GuiEventManager.trigger(GuiEventType.ADD_FLOATING_TEXT, f);
}
Aggregations