use of eidolons.libgdx.anims.std.BuffAnim in project Eidolons by IDemiurge.
the class AnimMaster method mouseHover.
private void mouseHover(Unit unit) {
unit.getBuffs().forEach(buff -> {
BuffAnim anim = continuousAnims.get(buff);
if (anim != null) {
anim.reset();
anim.start();
anim.setDuration(showBuffAnimsOnHoverLength);
}
});
}
use of eidolons.libgdx.anims.std.BuffAnim in project Eidolons by IDemiurge.
the class AnimMaster method updateContinuousAnims.
private void updateContinuousAnims() {
if (!continuousAnimsOn) {
return;
}
final List<BuffObj> toRemove = new ArrayList<>();
continuousAnims.keySet().forEach(buff -> {
if (buff.isDead()) {
continuousAnims.get(buff).finished();
toRemove.add(buff);
}
});
toRemove.forEach(buff -> {
continuousAnims.remove(buff);
});
DC_Game.game.getUnits().forEach(unit -> {
unit.getBuffs().forEach(buff -> {
if (// TODO or full reset always?
!continuousAnims.containsKey(buff)) {
if (buff.isVisible()) {
BuffAnim anim = constructor.getBuffAnim(buff);
// TODO cache!
if (anim != null) {
continuousAnims.put(buff, anim);
try {
anim.start();
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
}
}
}
});
});
}