Add armor autofill, prevent internal fill clobber

This commit is contained in:
Kevin Chang
2015-10-08 18:06:01 -07:00
parent fb7e9136d4
commit 38b13fca27
2 changed files with 14 additions and 1 deletions

View File

@@ -255,7 +255,9 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', '
$scope.fillWithCargo = function() {
ship.internal.forEach(function(slot) {
var id = Components.findInternalId('cr', slot.maxClass, 'E');
ship.use(slot, id, Components.internal(id));
if (!slot.c) {
ship.use(slot, id, Components.internal(id));
}
});
updateState(Serializer.fromShip(ship));
};
@@ -273,6 +275,16 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', '
updateState(Serializer.fromShip(ship));
};
$scope.fillWithArmor = function() {
ship.internal.forEach(function(slot) {
var id = Components.findInternalId('hr', slot.maxClass, 'D');
if (!slot.c) {
ship.use(slot, id, Components.internal(id));
}
});
updateState(Serializer.fromShip(ship));
};
/**
* Fill all internal slots with Cargo Racks, and optmize internal components.
* Hardpoints are not altered.

View File

@@ -217,6 +217,7 @@
<li class="lc" ng-click="emptyInternal()" translate="empty all"></li>
<li class="lc" ng-click="fillWithCargo()" translate="cargo"></li>
<li class="lc" ng-click="fillWithCells()" translate="scb"></li>
<li class="lc" ng-click="fillWithArmor()" translate="hr"></li>
</ul>
</div>
</div>