Fixed move animation being done as background when coming from an action
This commit is contained in:
parent
c3268ebdea
commit
5f0732b39b
|
@ -254,15 +254,18 @@ module TK.SpaceTac.UI {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
} else if (diff instanceof ShipMoveDiff) {
|
} else if (diff instanceof ShipMoveDiff) {
|
||||||
return {
|
let func = async (animate: boolean, timer: Timer) => {
|
||||||
background: async (animate: boolean, timer: Timer) => {
|
this.moveTo(diff.start.x, diff.start.y, diff.start.angle, false);
|
||||||
this.moveTo(diff.start.x, diff.start.y, diff.start.angle, false);
|
let duration = this.moveTo(diff.end.x, diff.end.y, diff.end.angle, animate, !!diff.engine);
|
||||||
let duration = this.moveTo(diff.end.x, diff.end.y, diff.end.angle, animate, !!diff.engine);
|
if (duration && animate) {
|
||||||
if (duration && animate) {
|
await timer.sleep(duration);
|
||||||
await timer.sleep(duration);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if (diff.engine) {
|
||||||
|
return { foreground: func };
|
||||||
|
} else {
|
||||||
|
return { background: func };
|
||||||
|
}
|
||||||
} else if (diff instanceof VigilanceAppliedDiff) {
|
} else if (diff instanceof VigilanceAppliedDiff) {
|
||||||
let action = this.ship.actions.getById(diff.action);
|
let action = this.ship.actions.getById(diff.action);
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue