mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
Corrected thurster selection and warnings
This commit is contained in:
@@ -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('<svg cpid="', id, '" class="icon lg"><use cpid="', id, '" xlink:href="#mount-', o.mode, '"></use></svg> ');
|
||||
list.push('<svg class="icon lg"><use xlink:href="#mount-', o.mode, '"></use></svg> ');
|
||||
}
|
||||
|
||||
list.push('<span cpid="', id, '">', o.class, o.rating);
|
||||
list.push('<span>', 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
|
||||
|
||||
@@ -101,6 +101,7 @@ select {
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
cursor: not-allowed;
|
||||
border-color: @disabled;
|
||||
color: @disabled;
|
||||
stroke: @disabled;
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
<tr class="main">
|
||||
<th rowspan="2">Size</th>
|
||||
<th rowspan="2">Agility</th>
|
||||
<th rowspan="2">Speed</th>
|
||||
<th rowspan="2" ng-class="{'bg-warning-disabled': pd.c.enginecapacity < ship.boostEnergy}">Boost</th>
|
||||
<th rowspan="2" ng-class="{'bg-warning-disabled': th.c.maxmass < ship.ladenMass}">Speed</th>
|
||||
<th rowspan="2" ng-class="{'bg-warning-disabled': (pd.c.enginecapacity < ship.boostEnergy || th.c.maxmass < ship.ladenMass)}">Boost</th>
|
||||
<th rowspan="2">DPS</th>
|
||||
<th rowspan="2">Armour</th>
|
||||
<th rowspan="2">Shields</th>
|
||||
@@ -62,10 +62,15 @@
|
||||
<tr>
|
||||
<td ng-bind="SZ[ship.class]"></td>
|
||||
<td>{{ship.agility}}/10</td>
|
||||
<td>{{fRound(ship.speed)}} <u>m/s</u></td>
|
||||
<td>
|
||||
<span ng-if="pd.c.enginecapacity >= ship.boostEnergy">{{fRound(ship.boost)}} <u>m/s</u></span>
|
||||
<span class="warning" ng-if="pd.c.enginecapacity < ship.boostEnergy">0 <svg class="icon"><use xlink:href="#warning"></use></svg></span>
|
||||
<span ng-if="th.c.maxmass >= ship.ladenMass">{{fRound(ship.speed)}} <u>m/s</u></span>
|
||||
<span class="warning" ng-if="th.c.maxmass < ship.ladenMass">0 <svg class="icon"><use xlink:href="#warning"></use></svg></span>
|
||||
</td>
|
||||
<td>
|
||||
<span ng-if="pd.c.enginecapacity >= ship.boostEnergy && th.c.maxmass >= ship.ladenMass">{{fRound(ship.boost)}} <u>m/s</u></span>
|
||||
<span class="warning" ng-if="pd.c.enginecapacity < ship.boostEnergy || th.c.maxmass < ship.ladenMass">0
|
||||
<svg class="icon"><use xlink:href="#warning"></use></svg>
|
||||
</span>
|
||||
</td>
|
||||
<td>{{fRound(ship.totalDps)}}</td>
|
||||
<td>
|
||||
@@ -122,7 +127,7 @@
|
||||
<div component-select class="select" s="pp" opts="availCS.common[0]" ng-if="selectedSlot==pp" ng-click="select('c',pp,$event)"></div>
|
||||
</div>
|
||||
<div class="slot" ng-click="selectSlot($event, th)" ng-class="{selected: selectedSlot==th}">
|
||||
<div class="details">
|
||||
<div class="details" ng-class="{'warning': th.c.maxmass < ship.ladenMass}">
|
||||
<div class="sz">{{::th.maxClass}}</div>
|
||||
<div class="l">{{th.id}} Thrusters</div>
|
||||
<div class="r">{{th.c.mass}} <u>T</u></div>
|
||||
|
||||
Reference in New Issue
Block a user