Merge pull request #120 from sf302/master

Heat Sink Launcher utility auto-fill
This commit is contained in:
Colin McLeod
2015-11-19 16:28:51 -08:00
2 changed files with 6 additions and 2 deletions

View File

@@ -547,8 +547,8 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
return this;
};
Ship.prototype.useUtility = function(group, rating, clobber) {
var component = Components.findHardpoint(group, 0, rating);
Ship.prototype.useUtility = function(group, rating, name, clobber) {
var component = Components.findHardpoint(group, 0, rating, name);
for (var i = this.hardpoints.length; i--; ) {
if ((clobber || !this.hardpoints[i].c) && !this.hardpoints[i].maxClass) {
this.use(this.hardpoints[i], component.id, component);

View File

@@ -296,6 +296,10 @@
<li class="c" ng-click="useUtility('sb','B')">B</li>
<li class="c" ng-click="useUtility('sb','A')">A</li>
</ul>
<div class="select-group cap" translate="Heat Sink Launcher"></div>
<ul>
<li class="lc" ng-click="useUtility('cm',null,'Heat Sink Launcher')" translate="Heat Sink Launcher"></li>
</ul>
</div>
</div>
<div class="slot" ng-repeat="h in ship.hardpoints | filter:{maxClass: '0'}" ng-click="selectSlot($event, h)" context-menu="select('h', h, $event, 'empty')" ng-class="{selected: selectedSlot==h}">