mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
Adding in 'Strip Ship' functionality.
This commit adds a simple button next to the save/reload icons that strips the ship to maximum class, D-rated modules, and no optional modules. Still needs a custom icon! May try to add in future things like 'all cargo' or 'fill empty with...' options.
This commit is contained in:
@@ -116,6 +116,22 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', '
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Strip ship to D-class and no other components.
|
||||
*/
|
||||
$scope.stripBuild = function() {
|
||||
angular.forEach(ship.common, function(slot,i) {
|
||||
id = slot.maxClass+'D';
|
||||
ship.use(slot, id, Components.common(ship.common.indexOf(slot), id));
|
||||
});
|
||||
angular.forEach(ship.hardpoints, function(slot,i) {
|
||||
ship.use(slot, null, null);
|
||||
});
|
||||
angular.forEach(ship.internal, function(slot,i) {
|
||||
ship.use(slot, null, null);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Save the current build. Will replace the saved build if there is one
|
||||
* for this ship & with the exact name.
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
<div id="overview">
|
||||
<h1 ng-bind="ship.name"></h1>
|
||||
<div id="build">
|
||||
<button ng-click="stripBuild()">
|
||||
<svg class="icon lg"><use xlink:href="#spinner11"></use></svg><span class="button-lbl">Strip</span>
|
||||
</button>
|
||||
<input ng-model="buildName" ng-change="bnChange()" placeholder="Enter Build Name" maxsize="50" />
|
||||
<button ng-click="saveBuild()" ng-disabled="!buildName || savedCode && code == savedCode || !canSave">
|
||||
<svg class="icon lg "><use xlink:href="#floppy-disk"></use></svg><span class="button-lbl">Save</span>
|
||||
|
||||
Reference in New Issue
Block a user