Search in sources :

Example 1 with MouseItem

use of eidolons.system.graphics.AnimationManager.MouseItem in project Eidolons by IDemiurge.

the class BfMouseListener method checkAnimationClick.

public boolean checkAnimationClick(MouseEvent e) {
    point = e.getPoint();
    DequeImpl<PhaseAnimation> animations = new DequeImpl<>(gridComp.getGame().getAnimationManager().getAnimations());
    animations.addAll(gridComp.getGame().getAnimationManager().getTempAnims());
    if (SwingUtilities.isRightMouseButton(e)) {
        for (PhaseAnimation anim : animations) {
            if (checkToggleTooltip(anim, e)) {
                return true;
            }
            if (anim.contains(e.getPoint())) {
                if (e.getClickCount() > 1) {
                    if (anim.isPaused()) {
                        anim.resume();
                    } else {
                        anim.pause();
                    }
                    return true;
                }
                AnimPhase phase = anim.getPhase();
                if (phase != null) {
                    if (anim.subPhaseClosed()) {
                        DC_SoundMaster.playStandardSound(STD_SOUNDS.BACK);
                        return true;
                    }
                }
            }
        }
    }
    for (PhaseAnimation anim : animations) {
        if (anim.getMouseMap() != null) {
            for (Rectangle rect : anim.getMouseMap().keySet()) {
                if (rect.contains(point)) {
                    MouseItem item = anim.getMouseMap().get(rect);
                    return itemClicked(item, anim);
                }
            }
        }
    }
    return false;
}
Also used : AnimPhase(main.system.graphics.AnimPhase) PhaseAnimation(eidolons.system.graphics.PhaseAnimation) MouseItem(eidolons.system.graphics.AnimationManager.MouseItem) DequeImpl(main.system.datatypes.DequeImpl)

Aggregations

MouseItem (eidolons.system.graphics.AnimationManager.MouseItem)1 PhaseAnimation (eidolons.system.graphics.PhaseAnimation)1 DequeImpl (main.system.datatypes.DequeImpl)1 AnimPhase (main.system.graphics.AnimPhase)1