mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Add armor autofill, prevent internal fill clobber
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user