mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 15:15:34 +00:00
Less hacks to get the same thing done
This commit is contained in:
@@ -232,8 +232,8 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', '
|
|||||||
updateState(Serializer.fromShip(ship.useCommon(rating)));
|
updateState(Serializer.fromShip(ship.useCommon(rating)));
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.useHardpoint = function(group, mount) {
|
$scope.useHardpoint = function(group, mount, missile) {
|
||||||
updateState(Serializer.fromShip(ship.useWeapon(group, mount)));
|
updateState(Serializer.fromShip(ship.useWeapon(group, mount, missile)));
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.useUtility = function(group, rating) {
|
$scope.useUtility = function(group, rating) {
|
||||||
|
|||||||
@@ -557,17 +557,13 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
|
|||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
Ship.prototype.useWeapon = function(group, mount) {
|
Ship.prototype.useWeapon = function(group, mount, missile) {
|
||||||
var hps = this.hardpoints;
|
var hps = this.hardpoints;
|
||||||
for (var i = hps.length; i--; ) {
|
for (var i = hps.length; i--; ) {
|
||||||
if (hps[i].maxClass) {
|
if (hps[i].maxClass) {
|
||||||
var size = hps[i].maxClass, component;
|
var size = hps[i].maxClass, component;
|
||||||
do {
|
do {
|
||||||
if (group == 'mr') {
|
component = Components.findHardpoint(group, size, null, null, mount, missile);
|
||||||
component = Components.findHardpoint(group, size, null, null, 'F', mount);
|
|
||||||
} else {
|
|
||||||
component = Components.findHardpoint(group, size, null, null, mount);
|
|
||||||
}
|
|
||||||
if (component) {
|
if (component) {
|
||||||
this.use(hps[i], component.id, component);
|
this.use(hps[i], component.id, component);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -284,8 +284,8 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<div class="select-group cap" translate="mr"></div>
|
<div class="select-group cap" translate="mr"></div>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="c" ng-click="useHardpoint('mr','D')"><svg class="icon lg"><use xlink:href="#mount-F"></use></svg> <span>D</span></li>
|
<li class="c" ng-click="useHardpoint('mr','F','D')"><svg class="icon lg"><use xlink:href="#mount-F"></use></svg> <span>D</span></li>
|
||||||
<li class="c" ng-click="useHardpoint('mr','S')"><svg class="icon lg"><use xlink:href="#mount-F"></use></svg> <span>S</span></li>
|
<li class="c" ng-click="useHardpoint('mr','F','S')"><svg class="icon lg"><use xlink:href="#mount-F"></use></svg> <span>S</span></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="select-group cap" translate="tp"></div>
|
<div class="select-group cap" translate="tp"></div>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user