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;
}
Aggregations