From 3d0ac11c9167e5dcc0deb33e83295e6c44b3d0e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Wed, 6 Jun 2018 20:21:27 +0200 Subject: [PATCH] map: Fixed star system links display --- src/ui/map/StarSystemDisplay.ts | 7 ++++--- src/ui/map/UniverseMapView.ts | 10 +++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/ui/map/StarSystemDisplay.ts b/src/ui/map/StarSystemDisplay.ts index f7fbe32..5fdad14 100644 --- a/src/ui/map/StarSystemDisplay.ts +++ b/src/ui/map/StarSystemDisplay.ts @@ -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); } }); diff --git a/src/ui/map/UniverseMapView.ts b/src/ui/map/UniverseMapView.ts index 9875fe8..36a8720 100644 --- a/src/ui/map/UniverseMapView.ts +++ b/src/ui/map/UniverseMapView.ts @@ -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();