From 1edacf3eba8539999d4457fd222d41307eee6e35 Mon Sep 17 00:00:00 2001 From: Colin McLeod Date: Thu, 13 Aug 2015 23:21:40 -0700 Subject: [PATCH] Corrected thurster selection and warnings --- app/js/directives/directive-component-select.js | 10 +++++----- app/less/select.less | 1 + app/views/page-outfit.html | 17 +++++++++++------ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/app/js/directives/directive-component-select.js b/app/js/directives/directive-component-select.js index bd65f521..16389109 100755 --- a/app/js/directives/directive-component-select.js +++ b/app/js/directives/directive-component-select.js @@ -22,13 +22,13 @@ angular.module('app').directive('componentSelect', function() { list.push(' warning'); } - list.push((o.maxmass && mass > o.maxmass) ? ' disabled"' : '" cpid="', id, '">'); + list.push((o.maxmass && (mass + (o.mass ? o.mass : 0)) > o.maxmass) ? ' disabled"' : '" cpid="', id, '">'); if (o.mode) { - list.push(' '); + list.push(' '); } - list.push('', o.class, o.rating); + list.push('', o.class, o.rating); if (o.missile) { list.push('/' + o.missile); @@ -50,7 +50,7 @@ angular.module('app').directive('componentSelect', function() { scope: { opts: '=', // Component Options object groups: '=', // Groups of Component Options - mass: '=', // Current ship unladen mass + mass: '=', // Current ship mass s: '=', // Current Slot warning: '=' // Check warning function }, @@ -60,7 +60,7 @@ angular.module('app').directive('componentSelect', function() { var component = scope.s.c; // Slot's Current Component (may be null/undefined) var opts = scope.opts; var groups = scope.groups; - var mass = scope.mass || 0; + var mass = (scope.mass ? scope.mass : 0) - (component && component.mass ? component.mass : 0); // Mass minus the currently selected component if (groups) { // At present time slots with grouped options (Hardpoints and Internal) can be empty diff --git a/app/less/select.less b/app/less/select.less index 2c81cc94..84431173 100755 --- a/app/less/select.less +++ b/app/less/select.less @@ -101,6 +101,7 @@ select { } &.disabled { + cursor: not-allowed; border-color: @disabled; color: @disabled; stroke: @disabled; diff --git a/app/views/page-outfit.html b/app/views/page-outfit.html index 39db4735..d5d4bf40 100644 --- a/app/views/page-outfit.html +++ b/app/views/page-outfit.html @@ -34,8 +34,8 @@ Size Agility - Speed - Boost + Speed + Boost DPS Armour Shields @@ -62,10 +62,15 @@ {{ship.agility}}/10 - {{fRound(ship.speed)}} m/s - {{fRound(ship.boost)}} m/s - 0 + {{fRound(ship.speed)}} m/s + 0 + + + {{fRound(ship.boost)}} m/s + 0 + + {{fRound(ship.totalDps)}} @@ -122,7 +127,7 @@
-
+
{{::th.maxClass}}
{{th.id}} Thrusters
{{th.c.mass}} T