1
0
Fork 0

map: Fixed star system links display

This commit is contained in:
Michaël Lemaire 2018-06-06 20:21:27 +02:00
parent 71e7aa0406
commit 3d0ac11c91
2 changed files with 9 additions and 8 deletions

View File

@ -5,6 +5,7 @@ module TK.SpaceTac.UI {
export class StarSystemDisplay extends UIContainer {
view: UniverseMapView
builder: UIBuilder
background: UIImage
circles: UIContainer
starsystem: Star
player: Player
@ -18,8 +19,8 @@ module TK.SpaceTac.UI {
this.view = parent;
this.builder = new UIBuilder(parent, this);
let base = this.builder.image("map-starsystem-background", 0, 0, true);
this.setScale(starsystem.radius * 2 / base.width);
this.background = this.builder.image("map-starsystem-background", 0, 0, true);
this.setScale(starsystem.radius * 2 / this.background.width);
this.starsystem = starsystem;
this.player = parent.player;
@ -108,7 +109,7 @@ module TK.SpaceTac.UI {
// LOD
let detailed = focus && level == 2;
this.list.filter(child => child !== this.label).forEach(child => {
if (child !== this.label && (child instanceof UIButton || child instanceof UIImage)) {
if (child !== this.label && child !== this.background && (child instanceof UIButton || child instanceof UIImage)) {
this.view.animations.setVisible(child, detailed, 300);
}
});

View File

@ -191,7 +191,7 @@ module TK.SpaceTac.UI {
this.starlinks.forEach(linkgraphics => {
let link = linkgraphics.data.get("link");
if (link instanceof StarLink) {
linkgraphics.visible = this.player.hasVisitedSystem(link.first) || this.player.hasVisitedSystem(link.second);
linkgraphics.setVisible(this.player.hasVisitedSystem(link.first) || this.player.hasVisitedSystem(link.second));
}
})
@ -252,9 +252,9 @@ module TK.SpaceTac.UI {
*/
setLinksAlpha(alpha: number, duration = 500) {
if (duration) {
this.animations.addAnimation(this.starlinks_group, { alpha: alpha }, duration * Math.abs(this.starlinks_group.alpha - alpha));
this.animations.addAnimation(this.starlinks_group, { alpha: alpha }, duration, "Cubic.easeInOut");
} else {
this.starlinks_group.alpha = alpha;
this.starlinks_group.setAlpha(alpha);
}
}
@ -291,8 +291,8 @@ module TK.SpaceTac.UI {
let dest_location = location.jump_dest;
let dest_star = dest_location.star;
this.player_fleet.moveToLocation(dest_location, 3, duration => {
this.timer.schedule(duration / 2, () => this.updateInfo(dest_star, false));
this.setCamera(dest_star.x, dest_star.y, dest_star.radius * 2, duration, "Cubic.Out");
this.timer.schedule(duration / 3, () => this.updateInfo(dest_star, false));
this.setCamera(dest_star.x, dest_star.y, dest_star.radius * 2, duration, "Cubic.easeOut");
}, () => {
this.setInteractionEnabled(true);
this.refresh();