Skip to content
This repository has been archived by the owner on Apr 7, 2023. It is now read-only.

Commit

Permalink
Split utility mounts and hard points, add refuel time
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin McLeod committed May 27, 2015
1 parent a8ec29d commit 484e2ca
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ angular.module('app', ['ngTouch', 'ui.router', 'ct.ui.router.extras.sticky', 'ui
$rootScope.fRound4 = function(d) { return d3.round(d, 4); };
$rootScope.fPct = d3.format('.2%');
$rootScope.fRPct = d3.format('%');
$rootScope.fTime = function(d) { return Math.floor(d/60) + ":" + ("00" + (d%60)).substr(-2,2); };
$rootScope.fTime = function(d) { return Math.floor(d/60) + ":" + ("00" + Math.floor(d%60)).substr(-2,2); };

// Global Event Listeners
$doc.bind('keyup', function (e) {
Expand Down
3 changes: 2 additions & 1 deletion app/js/directives/directive-slot-internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ angular.module('app').directive('slotInternal', ['$rootScope', function ($r) {
scope:{
c: '=slot',
lbl: '=',
opts: '='
ft: '=',

},
templateUrl: 'views/_slot-internal.html',
link: function(scope) {
Expand Down
8 changes: 1 addition & 7 deletions app/less/outfit.less
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,8 @@
}
}

#hardpoints {
.slot:nth-child(2n) {
clear: left;
margin-right: 0.5em;
}
}

#standard {
#hardpoints, #utility, #standard {
margin-right: 0.3em;
.slot {
clear: left;
Expand Down
2 changes: 1 addition & 1 deletion app/views/_slot-internal.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="l" ng-if="c.c.optmass">Opt: {{c.c.optmass}} <u>T</u></div>
<div class="l" ng-if="c.c.maxmass">Max: {{c.c.maxmass}} <u>T</u></div>
<div class="l" ng-if="c.c.bins">{{c.c.bins}} <u>Bins</u></div>
<div class="l" ng-if="c.c.rate">Rate: {{$r.fRound4(c.c.rate/1000)}} <u>T/s</u></div>
<div class="l" ng-if="c.c.rate">Rate: {{c.c.rate}} <u>Kg/s</u>&nbsp;&nbsp;&nbsp;Refuel Time: {{$r.fTime(ft.c.capacity * 1000 / c.c.rate)}}</div>
<div class="l" ng-if="c.c.ammo">Ammo: {{c.c.ammo}}</div>
<div class="l" ng-if="c.c.cells">Cells: {{c.c.cells}}</div>
<div class="l" ng-if="c.c.recharge">Recharge: {{c.c.recharge}} <u>Mj</u></div>
Expand Down
14 changes: 12 additions & 2 deletions app/views/page-outfit.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,17 @@ <h1>Standard</h1>

<div id="hardpoints" class="slot-group l">
<h1>HardPoints</h1>
<div class="slot" ng-repeat="h in ship.hardpoints" ng-click="selectSlot($event, h)" ng-class="{selected: selectedSlot==h}">
<div class="slot" ng-repeat="h in ship.hardpoints | filter:{maxClass: '!0'}" ng-click="selectSlot($event, h)" ng-class="{selected: selectedSlot==h}">
<div slot-hardpoint class="details" hp="h" size="HPC[h.maxClass]" lbl="hgMap[h.c.grp]"></div>
<div class="select" ng-class="{hardpoint: h.maxClass > 0}" ng-if="selectedSlot==h" ng-click="select('h',h,$event)">
<div component-select s="h" groups="availCS.getHps(h.maxClass)"></div>
</div>
</div>
</div>

<div id="utility" class="slot-group l">
<h1>Utility Mounts</h1>
<div class="slot" ng-repeat="h in ship.hardpoints | filter:{maxClass: '0'}" ng-click="selectSlot($event, h)" ng-class="{selected: selectedSlot==h}">
<div slot-hardpoint class="details" hp="h" size="HPC[h.maxClass]" lbl="hgMap[h.c.grp]"></div>
<div class="select" ng-class="{hardpoint: h.maxClass > 0}" ng-if="selectedSlot==h" ng-click="select('h',h,$event)">
<div component-select s="h" groups="availCS.getHps(h.maxClass)"></div>
Expand All @@ -157,7 +167,7 @@ <h1>HardPoints</h1>
<div id="internal" class="slot-group r">
<h1>Internal Compartments</h1>
<div class="slot" ng-repeat="i in ship.internal" ng-click="selectSlot($event, i)" ng-class="{selected: selectedSlot==i}">
<div slot-internal class="details" slot="i" lbl="igMap[i.c.grp]"></div>
<div slot-internal class="details" slot="i" lbl="igMap[i.c.grp]" ft="ft"></div>
<div class="select" ng-if="selectedSlot==i" ng-click="select('i',i,$event)">
<div component-select s="i" groups="availCS.getInts(i.maxClass)"></div>
</div>
Expand Down

0 comments on commit 484e2ca

Please sign in to comment.