Search in sources :

Example 1 with FloatingText

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);
        }
    });
}
Also used : FloatingText(eidolons.libgdx.anims.text.FloatingText) ActionInput(eidolons.game.core.ActionInput) Unit(eidolons.entity.obj.unit.Unit)

Example 2 with FloatingText

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);
}
Also used : FloatingText(eidolons.libgdx.anims.text.FloatingText) Vector2(com.badlogic.gdx.math.Vector2)

Aggregations

FloatingText (eidolons.libgdx.anims.text.FloatingText)2 Vector2 (com.badlogic.gdx.math.Vector2)1 Unit (eidolons.entity.obj.unit.Unit)1 ActionInput (eidolons.game.core.ActionInput)1