More comprehensive changes, UI tweaking

This commit is contained in:
Colin McLeod
2015-05-03 13:23:30 -07:00
parent 71405e6cb7
commit 022836bde1
29 changed files with 339 additions and 374 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

View File

@@ -20,9 +20,9 @@
<meta name="msapplication-TileImage" content="images/logo/mstile-144x144.png"> <meta name="msapplication-TileImage" content="images/logo/mstile-144x144.png">
<meta name="msapplication-config" content="images/logo/browserconfig.xml"> <meta name="msapplication-config" content="images/logo/browserconfig.xml">
<meta name="theme-color" content="#000000"> <meta name="theme-color" content="#000000">
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
</head> </head>
<body> <body ng-class="bodyClass">
<div id="bg"></div>
<shipyard-header></shipyard-header> <shipyard-header></shipyard-header>
<div id="main" ui-view ng-click="bgClicked($event)"></div> <div id="main" ui-view ng-click="bgClicked($event)"></div>
@@ -30,7 +30,7 @@
<div class="right"> <div class="right">
<a href="https://github.com/cmmcleod/ed-shipyard" target="_blank" title="Shipyard Github Project">Version <%= version %> - <%= date %></a> <a href="https://github.com/cmmcleod/ed-shipyard" target="_blank" title="Shipyard Github Project">Version <%= version %> - <%= date %></a>
</div> </div>
<div class="left"> <div class="l">
Coriolis Shipyard was created using assets and imagery from Elite: Dangerous, with the permission of Frontier Developments plc, for non-commercial purposes.<br> Coriolis Shipyard was created using assets and imagery from Elite: Dangerous, with the permission of Frontier Developments plc, for non-commercial purposes.<br>
It is not endorsed by nor reflects the views or opinions of Frontier Developments and no employee of Frontier Developments was involved in the making of it. It is not endorsed by nor reflects the views or opinions of Frontier Developments and no employee of Frontier Developments was involved in the making of it.
</div> </div>

View File

@@ -13,7 +13,7 @@ angular.module('app').config(['$provide','$stateProvider', '$urlRouterProvider',
params: { params: {
// TODO: Squash:false not working due to UI-router issue // TODO: Squash:false not working due to UI-router issue
shipId: { value: 'sidewinder', squash: false}, // Allow 'shipId' parameter to default to shipId: { value: 'sidewinder', squash: false}, // Allow 'shipId' parameter to default to
code: { value: undefined, squash: true } // Allow 'code' parameter to be empty/optional code: { value: null, squash: true } // Allow 'code' parameter to be empty/optional
}, },
templateUrl: 'views/page-outfit.html', templateUrl: 'views/page-outfit.html',
controller: 'OutfitController', controller: 'OutfitController',

View File

@@ -1,29 +1,32 @@
angular.module('app') angular.module('app')
.controller('ErrorController', ['$rootScope','$scope','$stateParams', '$location', function ($rootScope, $scope, $p, $location) { .controller('ErrorController', ['$window','$rootScope','$scope','$stateParams', '$location', function ($window, $rootScope, $scope, $p, $location) {
$rootScope.title = 'Error'; $rootScope.title = 'Error';
$scope.path = $location.path(); $scope.path = $location.path();
$scope.type = $p.type || 'unknown'; $scope.type = $p.type || 'unknown';
$scope.browser = $window.navigator.appVersion;
switch ($scope.type) { switch ($scope.type) {
case 404: case 404:
$scope.msgPre = 'Page'; $scope.msgPre = 'Page';
$scope.msgHighlight = $scope.path; $scope.msgHighlight = $scope.path;
$scope.msgPost = 'Not Found'; $scope.msgPost = 'Not Found';
$scope.image = 'deep-space'; $rootScope.bodyClass = 'deep-space';
break; break;
case 'no-ship': case 'no-ship':
$scope.msgPre = 'Ship'; $scope.msgPre = 'Ship';
$scope.msgHighlight = $p.message; $scope.msgHighlight = $p.message;
$scope.msgPost = 'does not exist'; $scope.msgPost = 'does not exist';
$scope.image = 'thargoid'; $rootScope.bodyClass = 'docking-bay';
break; break;
case 'build-fail': case 'build-fail':
$scope.msgPre = 'Build Failure!'; $scope.msgPre = 'Build Failure!';
$scope.image = 'ship-explode'; $scope.image = 'ship-explode';
$rootScope.bodyClass = 'docking-bay';
break; break;
default: default:
$scope.msgPre = "Uh, this is bad.."; $scope.msgPre = "Uh, this is bad..";
$scope.image = 'thargoid'; $scope.image = 'thargoid';
$rootScope.bodyClass = null;
} }
}]); }]);

View File

@@ -11,7 +11,6 @@ angular.module('app').controller('OutfitController', ['$rootScope','$scope', '$s
} }
$scope.buildName = $p.bn; $scope.buildName = $p.bn;
$rootScope.title = ship.name + ($scope.buildName? ' - ' + $scope.buildName: '');
$scope.ship = ship; $scope.ship = ship;
$scope.pp = ship.common[0]; // Power Plant $scope.pp = ship.common[0]; // Power Plant
$scope.th = ship.common[1]; // Thruster $scope.th = ship.common[1]; // Thruster
@@ -25,6 +24,8 @@ angular.module('app').controller('OutfitController', ['$rootScope','$scope', '$s
$scope.availCS = Components.forShip(ship.id); $scope.availCS = Components.forShip(ship.id);
$scope.selectedSlot = null; $scope.selectedSlot = null;
$scope.savedCode = Persist.getBuild(ship.id, $scope.buildName); $scope.savedCode = Persist.getBuild(ship.id, $scope.buildName);
$rootScope.title = ship.name + ($scope.buildName? ' - ' + $scope.buildName: '');
$rootScope.bodyClass = 'docking-bay';
// for debugging // for debugging
window.myScope = $scope; window.myScope = $scope;
@@ -62,7 +63,7 @@ angular.module('app').controller('OutfitController', ['$rootScope','$scope', '$s
} else if (type == 'i') { } else if (type == 'i') {
ship.use(slot, e.srcElement.id, Components.internal(e.srcElement.id)); ship.use(slot, e.srcElement.id, Components.internal(e.srcElement.id));
} else if (type == 'b') { } else if (type == 'b') {
ship.useBulkhead(slot, e.srcElement.id); ship.useBulkhead(e.srcElement.id);
} else { } else {
ship.use(slot, null, null); ship.use(slot, null, null);
} }
@@ -88,9 +89,11 @@ angular.module('app').controller('OutfitController', ['$rootScope','$scope', '$s
* for this ship & with the exact name. * for this ship & with the exact name.
*/ */
$scope.saveBuild = function() { $scope.saveBuild = function() {
if($scope.code != $scope.savedCode) { if($scope.buildName && $scope.code != $scope.savedCode) {
Persist.saveBuild(ship.id, $scope.buildName, $scope.code); Persist.saveBuild(ship.id, $scope.buildName, $scope.code);
$scope.savedCode = $scope.code; $scope.savedCode = $scope.code;
// Edge case TODO: comment more
$state.go('outfit', {shipId: ship.id, code: $scope.savedCode, bn: $scope.buildName}, {location:'replace', notify:false});
} }
} }
@@ -104,6 +107,10 @@ angular.module('app').controller('OutfitController', ['$rootScope','$scope', '$s
$state.go('outfit', {shipId: ship.id, code: null, bn: null}, {location:'replace', reload:true}); $state.go('outfit', {shipId: ship.id, code: null, bn: null}, {location:'replace', reload:true});
} }
$scope.bnChange = function(){
$scope.savedCode = Persist.getBuild(ship.id, $scope.buildName);
}
$rootScope.$on('keyup', function (e, keyEvent) { $rootScope.$on('keyup', function (e, keyEvent) {
// CTRL + S or CMD + S will override the default and save the build is possible // CTRL + S or CMD + S will override the default and save the build is possible
if (keyEvent.keycode == 83 && keyEvent.ctrlKey) { if (keyEvent.keycode == 83 && keyEvent.ctrlKey) {

View File

@@ -1,3 +1,4 @@
angular.module('app').controller('ShipyardController', ['$rootScope', function ($rootScope) { angular.module('app').controller('ShipyardController', ['$rootScope', function ($rootScope) {
$rootScope.title = 'Coriolis - Shipyard'; $rootScope.title = 'Coriolis - Shipyard';
$rootScope.bodyClass = 'docking-bay';
}]); }]);

View File

@@ -1,77 +0,0 @@
angular.module('app').directive('meter', function () {
return {
restrict: 'A',
scope: {
labels: '=',
keys: '=',
obj: '=',
max: '='
},
link: function (scope, element) {
var max = scope.max,
w = 90,
pLeft = 1,
pBottom = 2,
labelWidth = 45,
bHeight = 16,
bWidth = ((w - labelWidth) / max) - pLeft,
h = bHeight * scope.keys.length;
var data = [];
for(var i = 0; i < scope.keys.length; i++) {
data.push({name:scope.labels[i], val: scope.obj[scope.keys[i]]});
}
var svg = d3.select(element[0])
.append('svg')
.attr('width', w)
.attr('height', h)
.attr('viewBox', '0 0 ' + w + ' ' + h)
.attr('class', 'meter')
.attr('preserveAspectRatio', 'xMinYMin');
svg.selectAll("g").data(data)
.enter()
.append("g")
.attr('transform', function(d, i) {
return 'translate(' + labelWidth + ' ' + (i * bHeight) + ')';
})
.each(function(d, k) {
var g = d3.select(this);
for (var i = 0; i < max; i++) {
g.append('rect')
.attr("x", i * (bWidth + pLeft))
.attr("y", 0)
.attr("width", bWidth)
.attr("height", bHeight - pBottom);
}
});
svg.selectAll("text").data(data)
.enter()
.append('text')
.text(function(d) {
return d.name;
})
.attr("text-anchor", "end")
.attr("x", labelWidth - 3)
.attr("y", function(d, i) {
return (i * bHeight) + (bHeight) / 2;
});
function update() {
for(var i = 0; i < data.length; i++) {
data[i].val = scope.obj[scope.keys[i]];
}
svg.selectAll("g").data(data)
.selectAll('rect').attr('class', function(d, i) {
return (i + 1 <= d.val) ? 'active' : '';
});
}
scope.$watch('obj',update);
}
};
});

View File

@@ -9,7 +9,6 @@
@import 'outfit'; @import 'outfit';
@import 'select'; @import 'select';
@import 'charts'; @import 'charts';
@import 'meters';
@import 'error'; @import 'error';
@@ -24,24 +23,26 @@ body {
padding: 0; padding: 0;
font-family: @fStandard; font-family: @fStandard;
overflow-x: hidden; overflow-x: hidden;
} background-image: none;
#bg {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
opacity: 0.3;
background-image: url(images/docking-bay.jpg);
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover; background-size: cover;
&.deep-space {
background-image: url(images/deep-space.jpg);
}
&.docking-bay {
background-image: url(images/bay-1920x1080.jpg);
}
} }
#main { #main {
margin: 10px; margin: 0;
padding: 0.5em 0.25em;
min-height: 800px; min-height: 800px;
clear: both; clear: both;
} }
@@ -71,22 +72,14 @@ a, a:visited {
} }
footer { footer {
clear: both;
font-size: 0.6em; font-size: 0.6em;
color: #999; color: #999;
padding: 10px 0; padding: 1em;
width: 100%;
overflow: hidden; overflow: hidden;
}
footer {
.right { .right {
float: right; float: right;
text-align: right; text-align: right;
margin-right: 10px;
}
.left {
float: left;
text-align: left;
margin-left: 10px;
} }
} }

View File

@@ -1,20 +1,21 @@
@fg: #fff; // Constants for calculations
@bg: #333;
@primary: #FF8C0D; // Light Orange
@secondary: #32DBDB; // Light blue
@warning: #FF3B00; // Dark Orange
@bgDarken: 40%; @bgDarken: 40%;
@disabledDarken: 15%; @disabledDarken: 15%;
@bgTransparency: 10%; @bgTransparency: 10%;
@disabled: #888; // Foreground colors
@fg: #fff;
@primary: #FF8C0D; // Light Orange
@secondary: #1FB0FF; // Light blue
@warning: #FF3B00; // Dark Orange
@disabled: #888; // Light grey
@primary-disabled: darken(@primary, @disabledDarken); @primary-disabled: darken(@primary, @disabledDarken);
@secondary-disabled: darken(@secondary, @disabledDarken); @secondary-disabled: darken(@secondary, @disabledDarken);
@warning-disabled: darken(@warning, @disabledDarken); @warning-disabled: darken(@warning, @disabledDarken);
// Background colors
@bg: rgba(70,70,70,0.95);
@bgBlack: rgba(0,0,0,0.9); @bgBlack: rgba(0,0,0,0.9);
@primary-bg: fadeout(darken(@primary, 45%), 20%);
@primary-bg: fadeout(darken(@primary, 45%), 30%);
@secondary-bg: fadeout(darken(@secondary, @bgDarken), @bgTransparency); // Brown background @secondary-bg: fadeout(darken(@secondary, @bgDarken), @bgTransparency); // Brown background
@warning-bg: fadeout(darken(@warning, @bgDarken), @bgTransparency); // Dark Red @warning-bg: fadeout(darken(@warning, @bgDarken), @bgTransparency); // Dark Red

View File

@@ -37,19 +37,19 @@ header {
} }
.menu-list { .menu-list {
width: 200%; width: 250%;
font-family: @fStandard; font-family: @fStandard;
position: absolute; position: absolute;
padding: 0 1em 1em 0; margin-right: 1em;
padding: 0 0 1em 1em;
overflow: hidden; overflow: hidden;
background-color: @bgBlack; background-color: @bgBlack;
font-size: 0.8em; font-size: 0.8em;
} }
ul { ul {
margin: 0; margin: 0.5em 1em 0 0;
padding: 0; padding: 0;
margin-top: 0.5em;
line-height: 2em; line-height: 2em;
} }
@@ -76,6 +76,11 @@ header {
} }
} }
.block {
display: block;
line-height: 1.5em;
}
.title { .title {
font-size: 1.3em; font-size: 1.3em;
display: inline-block; display: inline-block;

View File

@@ -1,18 +0,0 @@
svg.meter {
text {
fill: @warning;
font-size: 15px;
font-family: @fStandard;
text-transform:uppercase;
alignment-baseline: middle;
}
rect {
fill: @disabled;
&.active {
fill: @warning;
}
}
}

View File

@@ -1,8 +1,13 @@
#outfit {
//width: 62em;
//margin: 0 auto;
}
#overview { #overview {
h1 { h1 {
font-family: @fTitle; font-family: @fTitle;
margin: 5px 0; margin: 0.2em 0;
color: @primary; color: @primary;
float: left; float: left;
} }
@@ -14,18 +19,22 @@
input { input {
background: @primary-bg; background: @primary-bg;
color: @fg; color: @secondary;
outline: none;
border: none; border: none;
font-size: 0.8em; font-size: 0.8em;
line-height: 2em; line-height: 2em;
text-transform: uppercase; text-align: right;
&:hover, &:focus {
background-color: @secondary-bg;
}
} }
} }
#hardpoints { #hardpoints {
.slot:nth-child(2n) { .slot:nth-child(2n) {
clear: left; clear: left;
margin-right: 10px; margin-right: 0.5em;
} }
} }
@@ -41,34 +50,21 @@
} }
} }
u { // Unit (Mj, Km, etc)
font-size: 0.8em;
text-decoration: none;
}
#summary { #summary {
.user-select-none(); .user-select-none();
float: right; float: right;
width: 40%; min-width: 40em;
margin: 0.25em;
border-top: 2px solid @primary; border-top: 2px solid @primary;
border-bottom: 2px solid @primary; border-bottom: 2px solid @primary;
background-color: @primary-bg; background-color: @primary-bg;
} }
legend {
text-transform: uppercase;
padding: 0 5px;
color: @warning;
font-family: @fTitle;
}
fieldset {
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
cursor: default;
border: 2px solid @warning-bg;
.border-radius(5px);
margin: 5px;
padding: 1px 5px 5px;
}
.toggle { .toggle {
cursor: pointer; cursor: pointer;
} }

View File

@@ -1,10 +1,12 @@
#shipyard {
vertical-align: top;
}
a.ship { a.ship {
display: block; display: inline-block;
float: left;
width: 22%; width: 22%;
height: 30%; margin: 1%;
margin: 1% 1%;
background-color: @bg; background-color: @bg;
padding: 0.5%; padding: 0.5%;
text-decoration: none; text-decoration: none;

View File

@@ -1,7 +1,7 @@
.slot-group { .slot-group {
float: left; float: left;
margin: 0 5px; margin: 0.25em;
.user-select-none(); .user-select-none();
cursor: default; cursor: default;
@@ -10,7 +10,7 @@
color: @bgBlack; color: @bgBlack;
background-color: @primary-disabled; background-color: @primary-disabled;
text-transform: uppercase; text-transform: uppercase;
margin: 2px 0; margin: 0.1em 0;
font-size: 0.8em; font-size: 0.8em;
padding-left: 0.5em; padding-left: 0.5em;
} }
@@ -18,9 +18,9 @@
.slot { .slot {
float: left; float: left;
width: 230px; width: 20.5em;
font-size: 0.75em; font-size: 0.75em;
margin-top: 3px; margin-top: 0.5em;
position: relative; position: relative;
z-index: 0; z-index: 0;
padding-right: 0.4em; padding-right: 0.4em;
@@ -34,6 +34,7 @@
overflow: hidden; overflow: hidden;
height: 100%; height: 100%;
cursor: pointer; cursor: pointer;
text-transform: none;
} }
.cb { .cb {

View File

@@ -22,7 +22,7 @@
} }
.user-select-none (){ .user-select-none (){
-webkit-touch-callout: none; -webkit-touch-callout: none;
-webkit-user-select: none; -webkit-user-select: none;
-khtml-user-select: none; -khtml-user-select: none;
-moz-user-select: none; -moz-user-select: none;

View File

@@ -1,10 +1,17 @@
<header> <header>
<div class="l" style="margin-right: 2em;"><a ui-sref="shipyard" class="logo shipyard"></a></div> <div class="l" style="margin-right: 2em;"><a ui-sref="shipyard" class="logo shipyard"></a></div>
<div class="l menu">
<div class="menu-header" ng-class="{selected: openedMenu=='s'}" ng-click="openMenu('s')">Ships</div>
<div class="menu-list" ng-if="openedMenu=='s'">
<a class="block" ng-repeat="(shipId,ship) in ships" ui-sref-active="active" ui-sref="outfit({shipId:shipId, code:null, bn:null})">{{::ship.properties.name}}</a>
</div>
</div>
<div class="l menu"> <div class="l menu">
<div class="menu-header" ng-class="{selected: openedMenu=='b', disabled: !bs.hasBuilds}" ng-click="openMenu('b')">Builds</div> <div class="menu-header" ng-class="{selected: openedMenu=='b', disabled: !bs.hasBuilds}" ng-click="openMenu('b')">Builds</div>
<div class="menu-list" ng-if="openedMenu=='b'"> <div class="menu-list" ng-if="openedMenu=='b'">
<ul class="left" ng-repeat="(shipId,builds) in allBuilds"> <ul class="l" ng-repeat="(shipId,builds) in allBuilds">
{{ships[shipId].properties.name}} {{ships[shipId].properties.name}}
<li ng-repeat="(name, build) in builds"> <li ng-repeat="(name, build) in builds">
<a ui-sref-active="active" ui-sref="outfit({shipId:shipId, code:build, bn:name})" ng-bind="name"></a> <a ui-sref-active="active" ui-sref="outfit({shipId:shipId, code:build, bn:name})" ng-bind="name"></a>
@@ -13,9 +20,8 @@
</div> </div>
</div> </div>
<div class="r"> <div class="r">
<a class="logo github" href="https://github.com/cmmcleod/ed-shipyard" target="_blank" title="Shipyard Github Project"></a> <a class="logo reddit" href="#" target="_blank" title="Reddit Thread"></a>
<a class="logo reddit" href="#" target="_blank" title="Reddit Thread"></a> </div>
</div>
</header> </header>

View File

@@ -10,7 +10,7 @@
<div class="lbl">{{c.c.class}}{{c.c.rating}} {{$r.CArr[$index]}}</div><div class="val">{{$r.fCrd(c.c.cost)}}</div> <div class="lbl">{{c.c.class}}{{c.c.rating}} {{$r.CArr[$index]}}</div><div class="val">{{$r.fCrd(c.c.cost)}}</div>
</div> </div>
<div ng-repeat="c in ship.hardpoints" ng-if="c.c.cost" class="item hardpoints" ng-class="{enabled:c.incCost}" ng-click="toggle(c)"> <div ng-repeat="c in ship.hardpoints" ng-if="c.c.cost" class="item hardpoints" ng-class="{enabled:c.incCost}" ng-click="toggle(c)">
<div class="lbl">{{c.c.class}}{{c.c.rating}} {{c.c.name}}</div><div class="val">{{$r.fCrd(c.c.cost)}}</div> <div class="lbl">{{c.c.class}}{{c.c.rating}} {{c.c.name || $r.hgMap[c.c.grp]}}</div><div class="val">{{$r.fCrd(c.c.cost)}}</div>
</div> </div>
<div ng-repeat="c in ship.internal" ng-if="c.c.cost" class="item internal" ng-class="{enabled:c.incCost}" ng-click="toggle(c)"> <div ng-repeat="c in ship.internal" ng-if="c.c.cost" class="item internal" ng-class="{enabled:c.incCost}" ng-click="toggle(c)">
<div class="lbl">{{c.c.class}}{{c.c.rating}} {{c.c.name || $r.igMap[c.c.group]}}</div><div class="val">{{$r.fCrd(c.c.cost)}}</div> <div class="lbl">{{c.c.class}}{{c.c.rating}} {{c.c.name || $r.igMap[c.c.group]}}</div><div class="val">{{$r.fCrd(c.c.cost)}}</div>
@@ -20,10 +20,10 @@
<div class="summary toggle" ng-click="toggleExpand()"> <div class="summary toggle" ng-click="toggleExpand()">
<div class="item"> <div class="item">
<div class="lbl">Total</div> <div class="lbl">Total</div>
<div class="val">{{$r.fCrd(ship.totalCost)}} CR</div> <div class="val">{{$r.fCrd(ship.totalCost)}} <u>CR</u></div>
</div> </div>
<div class="item"> <div class="item">
<div class="lbl">Insurance</div> <div class="lbl">Insurance</div>
<div class="val">{{$r.fCrd(ship.totalCost * (1-insurance))}} CR</div> <div class="val">{{$r.fCrd(ship.totalCost * (1-insurance))}} <u>CR</u></div>
</div> </div>
</div> </div>

View File

@@ -7,8 +7,10 @@
<!-- TODO: add awesome relevant SVG based on code /--> <!-- TODO: add awesome relevant SVG based on code /-->
<p ng-if="path" ng-bind="path"></p> <p ng-if="path" >Path: {{path}}</p>
<p ng-if="type" ng-bind="type"></p> <p ng-if="type">Error: {{type}}</p>
<p ng-if="details">Details: {{details | json}}</p>
<p>Browser: {{browser}}</p>
</div> </div>
<!-- TODO: Add github issue link /--> <!-- TODO: Add github issue link /-->

View File

@@ -1,179 +1,186 @@
<div id="outfit">
<div id="hardpoints" class="slot-group"> <div id="hardpoints" class="slot-group">
<h1>HardPoints</h1> <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" 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 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 class="select" ng-class="{hardpoint: h.maxClass > 0}" ng-if="selectedSlot==h" ng-click="select('h',h,$event)">
<div class="empty-c" id="empty" ng-click="select(null, h, $event)">EMPTY</div> <div class="empty-c" id="empty" ng-click="select(null, h, $event)">EMPTY</div>
<div ng-repeat="(grp, data) in availCS.getHps(h.maxClass)"> <div ng-repeat="(grp, data) in availCS.getHps(h.maxClass)">
<div class="select-group">{{grp}}</div> <div class="select-group">{{grp}}</div>
<div component-select opts="data"></div> <div component-select opts="data"></div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<div id="standard" class="slot-group"> <div id="standard" class="slot-group">
<h1>Standard</h1> <h1>Standard</h1>
<div class="slot" ng-click="selectSlot($event, ship.bulkheads)" ng-class="{selected: selectedSlot==ship.bulkheads}"> <div class="slot" ng-click="selectSlot($event, ship.bulkheads)" ng-class="{selected: selectedSlot==ship.bulkheads}">
<div class="details"> <div class="details">
<div class="sz"><span>8</span></div> <div class="sz"><span>8</span></div>
<div class="l">Bulkheads</div><div class="r">{{ship.bulkheads.c.class}}{{ship.bulkheads.c.rating}}</div> <div class="l">Bulkheads</div><div class="r">{{ship.bulkheads.c.class}}{{ship.bulkheads.c.rating}}</div>
<div class="cl l">{{ship.bulkheads.c.name}}</div> <div class="cl l">{{ship.bulkheads.c.name}}</div>
<div class="r cr">{{ship.bulkheads.c.mass}} T</div> <div class="r cr">{{ship.bulkheads.c.mass}} <u>T</u></div>
</div>
<div class="select" ng-if="selectedSlot==ship.bulkheads" ng-click="select('b',ship.bulkheads,$event)"><ul>
<li class="lc" id="0">Lightweight Alloy</li>
<li class="lc" id="1">Reinforced Alloy</li>
<li class="lc" id="2">Military Grade Composite</li>
<li class="lc" id="3">Mirrored Surface Composite</li>
<li class="lc" id="4">Reactive Surface Composite</li>
</ul></div>
</div> </div>
<div class="select" ng-if="selectedSlot==ship.bulkheads" ng-click="select('b',ship.bulkheads,$event)"><ul> <div class="slot" ng-click="selectSlot($event, pp)" ng-class="{selected: selectedSlot==pp}">
<li class="lc" id="0">Lightweight Alloy</li> <div class="details">
<li class="lc" id="1">Reinforced Alloy</li> <div class="sz">{{::pp.maxClass}}</div>
<li class="lc" id="2">Military Grade Composite</li> <div class="l">Power Plant</div>
<li class="lc" id="3">Mirrored Surface Composite</li> <div class="r">{{pp.id}}</div>
<li class="lc" id="4">Reactive Surface Composite</li> <div class="cb"></div>
</ul></div> <div class="l">Eff: {{pp.c.eff}}</div>
</div> <div class="l">Power: {{pp.c.pGen}} <u>MW</span></div>
<div class="slot" ng-click="selectSlot($event, pp)" ng-class="{selected: selectedSlot==pp}"> <div class="r">{{pp.c.mass}} <u><u>T</u></span></div>
<div class="details"> </div>
<div class="sz">{{::pp.maxClass}}</div> <div component-select class="select" opts="availCS.common[0]" ng-if="selectedSlot==pp" ng-click="select('c',pp,$event)"></div>
<div class="l">Power Plant</div>
<div class="r">{{pp.id}}</div>
<div class="cb"></div>
<div class="l">Eff: {{pp.c.eff}}</div>
<div class="l">Power: {{pp.c.pGen}} MW</div>
<div class="r">{{pp.c.mass}} T</div>
</div> </div>
<div component-select class="select" opts="availCS.common[0]" ng-if="selectedSlot==pp" ng-click="select('c',pp,$event)"></div> <div class="slot" ng-click="selectSlot($event, th)" ng-class="{selected: selectedSlot==th}">
</div> <div class="details">
<div class="slot" ng-click="selectSlot($event, th)" ng-class="{selected: selectedSlot==th}"> <div class="sz">{{::th.maxClass}}</div>
<div class="details"> <div class="l">Thrusters</div>
<div class="sz">{{::th.maxClass}}</div> <div class="r">{{th.id}}</div>
<div class="l">Thrusters</div> <div class="cb"></div>
<div class="r">{{th.id}}</div> <div class="l">Opt: {{th.c.optmass}} <u>T</u></div>
<div class="cb"></div> <div class="l">Max: {{th.c.maxmass}} <u>T</u></div>
<div class="l">Opt: {{th.c.optmass}} T</div> <div class="r">{{th.c.mass}} <u>T</u></div>
<div class="l">Max: {{th.c.optmass}} T</div> </div>
<div class="r">{{th.c.mass}} T</div> <div component-select class="select" opts="availCS.common[1]" ng-if="selectedSlot==th" ng-click="select('c',th,$event)"></div>
</div> </div>
<div component-select class="select" opts="availCS.common[1]" ng-if="selectedSlot==th" ng-click="select('c',th,$event)"></div> <div class="slot" ng-click="selectSlot($event, fsd)" ng-class="{selected: selectedSlot==fsd}">
</div> <div class="details">
<div class="slot" ng-click="selectSlot($event, fsd)" ng-class="{selected: selectedSlot==fsd}"> <div class="sz">{{::fsd.maxClass}}</div>
<div class="details"> <div class="l">Frame Shift Drive</div>
<div class="sz">{{::fsd.maxClass}}</div> <div class="r">{{fsd.id}}</div>
<div class="l">Frame Shift Drive</div> <div class="cb"></div>
<div class="r">{{fsd.id}}</div> <div class="l">Opt: {{fsd.c.optmass}} <u>T</u></div>
<div class="cb"></div> <div class="l">Max Fuel: {{fsd.c.maxfuel}} <u>T</u></div>
<div class="l">Opt: {{fsd.c.optmass}} T</div> <div class="r cr">{{fsd.c.mass}} <u>T</u></div>
<div class="l">Max Fuel: {{fsd.c.maxfuel}} T</div> </div>
<div class="r cr">{{fsd.c.mass}} T</div> <div component-select class="select" opts="availCS.common[2]" ng-if="selectedSlot==fsd" ng-click="select('c',fsd,$event)"></div>
</div> </div>
<div component-select class="select" opts="availCS.common[2]" ng-if="selectedSlot==fsd" ng-click="select('c',fsd,$event)"></div> <div class="slot" ng-click="selectSlot($event, ls)" ng-class="{selected: selectedSlot==ls}">
</div> <div class="details">
<div class="slot" ng-click="selectSlot($event, ls)" ng-class="{selected: selectedSlot==ls}"> <div class="sz">{{::ls.maxClass}}</div>
<div class="details"> <div class="l">Life Support</div>
<div class="sz">{{::ls.maxClass}}</div> <div class="r">{{ls.id}}</div>
<div class="l">Life Support</div> <div class="cb"></div>
<div class="r">{{ls.id}}</div> <div class="l">Time: {{fTime(ls.c.time)}}</div>
<div class="cb"></div> <div class="r cr">{{ls.c.mass}} <u>T</u></div>
<div class="l">Time: {{fTime(ls.c.time)}}</div> </div>
<div class="r cr">{{ls.c.mass}} T</div> <div component-select class="select" opts="availCS.common[3]" ng-if="selectedSlot==ls" ng-click="select('c',ls,$event)"></div>
</div> </div>
<div component-select class="select" opts="availCS.common[3]" ng-if="selectedSlot==ls" ng-click="select('c',ls,$event)"></div> <div class="slot" ng-click="selectSlot($event, pd)" ng-class="{selected: selectedSlot==pd}">
</div> <div class="details">
<div class="slot" ng-click="selectSlot($event, pd)" ng-class="{selected: selectedSlot==pd}"> <div class="sz">{{::pd.maxClass}}</div>
<div class="details"> <div class="l">Power Distributor</div>
<div class="sz">{{::pd.maxClass}}</div> <div class="r">{{pd.id}}</div>
<div class="l">Power Distributor</div> <div class="cb"></div>
<div class="r">{{pd.id}}</div> <div class="l">Sys: {{pd.c.weaponcapacity}} <u>Mj</u> {{pd.c.weaponrecharge}} <u>Mj/s</u></div>
<div class="cb"></div> <div class="l">Wep: {{pd.c.systemcapacity}} <u>Mj</u> {{pd.c.systemrecharge}} <u>Mj/s</u></div>
<!-- TODO: add power distributor stuff /--> <div class="l">Eng: {{pd.c.enginecapacity}} <u>Mj</u> {{pd.c.enginerecharge}}<u>Mj/s</u></div>
<div class="r cr">{{pd.c.mass}} T</div> <div class="r cr">{{pd.c.mass}} <u>T</u></div>
</div>
<div component-select class="select" opts="availCS.common[4]" ng-if="selectedSlot==pd" ng-click="select('c',pd,$event)"></div>
</div> </div>
<div component-select class="select" opts="availCS.common[4]" ng-if="selectedSlot==pd" ng-click="select('c',pd,$event)"></div> <div class="slot" ng-click="selectSlot($event, ss)" ng-class="{selected: selectedSlot==ss}">
</div> <div class="details">
<div class="slot" ng-click="selectSlot($event, ss)" ng-class="{selected: selectedSlot==ss}"> <div class="sz">{{::ss.maxClass}}</div>
<div class="details"> <div class="l">Sensors</div>
<div class="sz">{{::ss.maxClass}}</div> <div class="r">{{ss.id}}</div>
<div class="l">Sensors</div> <div class="cb"></div>
<div class="r">{{ss.id}}</div> <div class="l">{{ss.c.range}} <u>KM</u></div>
<div class="cb"></div> <div class="r cr">{{ss.c.mass}} <u>T</u></div>
<div class="l">{{ss.c.range}} KM</div> </div>
<div class="r cr">{{ss.c.mass}} T</div> <div component-select class="select" opts="availCS.common[5]" ng-if="selectedSlot==ss" ng-click="select('c',ss,$event)"></div>
</div> </div>
<div component-select class="select" opts="availCS.common[5]" ng-if="selectedSlot==ss" ng-click="select('c',ss,$event)"></div> <div class="slot" ng-click="selectSlot($event, ft)" ng-class="{selected: selectedSlot==ft}">
</div> <div class="details">
<div class="slot" ng-click="selectSlot($event, ft)" ng-class="{selected: selectedSlot==ft}"> <div class="sz">{{::ft.maxClass}}</div>
<div class="details"> <div class="l">Fuel Tank</div>
<div class="sz">{{::ft.maxClass}}</div> <div class="r">{{ft.id}}</div>
<div class="l">Fuel Tank</div> <div class="r cr">{{ft.c.capacity}} <u>T</u></div>
<div class="r">{{ft.id}}</div> </div>
<div class="r cr">{{ft.c.capacity}} T</div> <div component-select class="select" opts="availCS.common[6]" ng-if="selectedSlot==ft" ng-click="select('c',ft,$event)"></div>
</div> </div>
<div component-select class="select" opts="availCS.common[6]" ng-if="selectedSlot==ft" ng-click="select('c',ft,$event)"></div>
</div> </div>
</div>
<div id="internal" class="slot-group"> <div id="internal" class="slot-group">
<h1>Internal Compartments</h1> <h1>Internal Compartments</h1>
<div class="slot" ng-repeat="i in ship.internal" ng-click="selectSlot($event, i)" ng-class="{selected: selectedSlot==i}"> <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.group]"></div> <div slot-internal class="details" slot="i" lbl="igMap[i.c.group]"></div>
<div class="select" ng-if="selectedSlot==i" ng-click="select('i',i,$event)"> <div class="select" ng-if="selectedSlot==i" ng-click="select('i',i,$event)">
<div class="empty-c" id="empty" ng-click="select(null, i, $event)">EMPTY</div> <div class="empty-c" id="empty" ng-click="select(null, i, $event)">EMPTY</div>
<div ng-repeat="(grp, data) in availCS.getInts(i.maxClass)"> <div ng-repeat="(grp, data) in availCS.getInts(i.maxClass)">
<div class="select-group">{{grp}}</div> <div class="select-group">{{grp}}</div>
<div component-select opts="data"></div> <div component-select opts="data"></div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<div id="summary"> <div id="summary">
<div id="overview" class="list"> <div id="overview" class="list">
<h1 ng-bind="ship.name"></h1> <h1 ng-bind="ship.name"></h1>
<div id="build"> <div id="build">
<input ng-model="buildName" placeholder="Enter Build Name" /> <input ng-model="buildName" ng-change="bnChange()" placeholder="Enter Build Name" />
<button ng-click="saveBuild()" ng-disabled="code == savedCode">Save</button> <button ng-click="saveBuild()" ng-disabled="!buildName && code == savedCode">Save</button>
<button ng-click="reloadBuild()" ng-disabled="!savedCode || code == savedCode">Reload</button> <button ng-click="reloadBuild()" ng-disabled="!savedCode && code == savedCode">Reload</button>
<button ui-sref="outfit({shipId: ship.id,code:null})" ng-disabled="!code">Clear</button> <button ng-click="deleteBuild()" ng-disabled="!savedCode">Delete</button>
<button ui-sref="outfit({shipId: ship.id,code:null})" ng-disabled="!code">Reset</button>
</div>
</div> </div>
</div>
<div class="list">
<div class="header">Maneuverability</div>
<div class="summary">
<div class="item"><div class="lbl">Boost</div><div class="val">{{fRound(ship.boost)}} m/s</div></div>
<div class="item"><div class="lbl">Speed</div><div class="val">{{fRound(ship.speed)}} m/s</div></div>
<div class="item"><div class="lbl">Agility</div><div class="val">{{ship.agility}} / 10</div></div>
</div>
</div>
<div class="list">
<div class="header">Shields</div>
<div class="summary">
<div class="item"><div class="lbl">Recharge Rate</div><div class="val">{{fRound(0)}} Mj/s</div></div>
<div class="item"><div class="lbl">Strength</div><div class="val">{{fRound(ship.shieldStrength)}} Mj</div></div>
<div class="item"><div class="lbl">Multiplier</div><div class="val">{{fRPct(ship.shieldMultiplier)}}</div></div>
</div>
</div>
<div class="list">
<div class="header">Armor</div>
<div class="summary">
<div class="item"><div class="lbl">Total</div><div class="val">{{ship.armourTotal}}</div></div>
<div class="item"><div class="lbl">Added</div><div class="val">{{ship.armourAdded}}</div></div>
<div class="item"><div class="lbl">Base</div><div class="val">{{ship.armour}}</div></div>
</div>
</div>
<div class="list">
<div class="header">Mass</div>
<div class="summary">
<div class="item"><div class="lbl">Max</div><div class="val">{{fRound(ship.maxMass)}} T</div></div>
<div class="item"><div class="lbl">Laden</div><div class="val">{{fRound(ship.ladenMass)}} T</div></div>
<div class="item"><div class="lbl">Unladen</div><div class="val">{{fRound(ship.unladenMass)}} T</div></div>
</div>
</div>
<div class="list" power-list ship="ship"></div>
<div class="list"> <div class="list">
<div class="header">Capacity</div> <div class="header">Maneuverability</div>
<div class="summary"> <div class="summary">
<div class="item"><div class="lbl">Cargo</div><div class="val">{{fRound(ship.cargoCapacity)}} T</div></div> <div class="item"><div class="lbl">Boost</div><div class="val">{{fRound(ship.boost)}} <u>m/s</u></div></div>
<div class="item"><div class="lbl">Fuel</div><div class="val">{{fRound(ship.fuelCapacity)}} T</div></div> <div class="item"><div class="lbl">Speed</div><div class="val">{{fRound(ship.speed)}} <u>m/s</u></div></div>
<div class="item"><div class="lbl">Agility</div><div class="val">{{ship.agility}} / 10</div></div>
</div> </div>
</div>
<div class="list">
<div class="header">Shields</div>
<div class="summary">
<!-- TODO: Implement Shield Recharge rate
<div class="item"><div class="lbl">Recharge Rate</div><div class="val">{{fRound(0)}} <u>Mj/s</u></div></div>
/-->
<div class="item"><div class="lbl">Strength</div><div class="val">{{fRound(ship.shieldStrength)}} <u>Mj</u></div></div>
<div class="item"><div class="lbl">Multiplier</div><div class="val">{{fRPct(ship.shieldMultiplier)}}</div></div>
</div>
</div>
<div class="list">
<div class="header">Armor</div>
<div class="summary">
<div class="item"><div class="lbl">Total</div><div class="val">{{ship.armourTotal}}</div></div>
<div class="item"><div class="lbl">Added</div><div class="val">{{ship.armourAdded}}</div></div>
<div class="item"><div class="lbl">Base</div><div class="val">{{ship.armour}}</div></div>
</div>
</div>
<div class="list">
<div class="header">Mass</div>
<div class="summary">
<div class="item"><div class="lbl">Max</div><div class="val">{{fRound(ship.maxMass)}} <u>T</u></div></div>
<div class="item"><div class="lbl">Laden</div><div class="val">{{fRound(ship.ladenMass)}} <u>T</u></div></div>
<div class="item"><div class="lbl">Unladen</div><div class="val">{{fRound(ship.unladenMass)}} <u>T</u></div></div>
</div>
</div>
<div class="list" power-list ship="ship"></div>
<div class="list">
<div class="header">Capacity</div>
<div class="summary">
<div class="item"><div class="lbl">Cargo</div><div class="val">{{fRound(ship.cargoCapacity)}} <u>T</u></div></div>
<div class="item"><div class="lbl">Fuel</div><div class="val">{{fRound(ship.fuelCapacity)}} <u>T</u></div></div>
</div>
</div>
<div class="list" ship-range ship="ship"></div>
<div class="list" cost-list ship="ship"></div>
</div> </div>
<div class="list" ship-range ship="ship"></div>
<div class="list" cost-list ship="ship"></div>
</div> </div>

View File

@@ -1,4 +1,4 @@
<div id="shipyard">
<a ui-sref="outfit({shipId:id})" class="ship" ng-repeat="(id,s) in ships"> <a ui-sref="outfit({shipId:id})" class="ship" ng-repeat="(id,s) in ships">
<h2 ng-bind="s.properties.name"></h2> <h2 ng-bind="s.properties.name"></h2>
<small ng-bind="s.properties.manufacturer"></small> <small ng-bind="s.properties.manufacturer"></small>
@@ -6,4 +6,5 @@
<div class="purpose" ng-bind="SP[s.properties.group]"></div> <div class="purpose" ng-bind="SP[s.properties.group]"></div>
</div> </div>
{{fCrd(s.properties.cost)}} CR {{fCrd(s.properties.cost)}} CR
</a> </a>
</div>

View File

@@ -14,7 +14,7 @@
</div> </div>
<div ng-repeat="c in ship.hardpoints" ng-if="c.c.power" class="item hardpoints" ng-class="{enabled:c.enabled, consumer:c.c.power}" ng-click="toggle(c)"> <div ng-repeat="c in ship.hardpoints" ng-if="c.c.power" class="item hardpoints" ng-class="{enabled:c.enabled, consumer:c.c.power}" ng-click="toggle(c)">
<div class="lbl">{{c.c.class}}{{c.c.rating}} {{c.c.name}}</div><div class="val">{{$r.fPwr(c.c.power)}}</div> <div class="lbl">{{c.c.class}}{{c.c.rating}} {{c.c.name || $r.hgMap[c.c.grp]}}</div><div class="val">{{$r.fPwr(c.c.power)}}</div>
</div> </div>
<div ng-repeat="c in ship.internal" ng-if="c.c.power" class="item internal" ng-class="{enabled:c.enabled, consumer:c.c.power}" ng-click="toggle(c)"> <div ng-repeat="c in ship.internal" ng-if="c.c.power" class="item internal" ng-class="{enabled:c.enabled, consumer:c.c.power}" ng-click="toggle(c)">
@@ -24,14 +24,14 @@
<div class="summary toggle" ng-click="toggleExpand()"> <div class="summary toggle" ng-click="toggleExpand()">
<div class="item"> <div class="item">
<div class="lbl">Available</div> <div class="lbl">Available</div>
<div class="val">{{$r.fPwr(ship.powerAvailable)}} MW</div> <div class="val">{{$r.fPwr(ship.powerAvailable)}} <u>MW</u></div>
</div> </div>
<div class="item"> <div class="item">
<div class="lbl">Deployed</div> <div class="lbl">Deployed</div>
<div class="val">{{$r.fPwr(ship.powerDeployed)}} MW ({{$r.fPct(ship.powerDeployed/ship.powerAvailable)}})</div> <div class="val">{{$r.fPwr(ship.powerDeployed)}} <u>MW</u> ({{$r.fPct(ship.powerDeployed/ship.powerAvailable)}})</div>
</div> </div>
<div class="item"> <div class="item">
<div class="lbl">Retracted</div> <div class="lbl">Retracted</div>
<div class="val">{{$r.fPwr(ship.powerRetracted)}} MW ({{$r.fPct(ship.powerRetracted/ship.powerAvailable)}})</div> <div class="val">{{$r.fPwr(ship.powerRetracted)}} <u>MW</u> ({{$r.fPct(ship.powerRetracted/ship.powerAvailable)}})</div>
</div> </div>
</div> </div>

View File

@@ -6,10 +6,10 @@
<div class="summary toggle" ng-click="toggleExpand()"> <div class="summary toggle" ng-click="toggleExpand()">
<div class="item"> <div class="item">
<div class="lbl">Laden</div> <div class="lbl">Laden</div>
<div class="val">{{$r.fRound(ship.ladenJumpRange)}} Ly</div> <div class="val">{{$r.fRound(ship.ladenJumpRange)}} <u>LY</u></div>
</div> </div>
<div class="item"> <div class="item">
<div class="lbl">Unladen</div> <div class="lbl">Unladen</div>
<div class="val">{{$r.fRound(ship.unladenJumpRange)}} Ly</div> <div class="val">{{$r.fRound(ship.unladenJumpRange)}} <u>LY</u></div>
</div> </div>
</div> </div>

View File

@@ -3,14 +3,17 @@
<div ng-if="hp.c"> <div ng-if="hp.c">
<div class="l">{{hp.c.name || lbl}}</div><div class="r">{{hp.c.class}}{{hp.c.rating}}<span ng-if="hp.c.mode">/{{hp.c.mode}}{{hp.c.missile}}</span></div> <div class="l">{{hp.c.name || lbl}}</div><div class="r">{{hp.c.class}}{{hp.c.rating}}<span ng-if="hp.c.mode">/{{hp.c.mode}}{{hp.c.missile}}</span></div>
<div class="cb"> <div class="cb">
<div class="cb" ng-if="hp.c.damage" > <div class="cb meters" ng-if="hp.c.damage" >
<div class="l" meter max="10" obj="hp.c" labels="['dps','dmg']" keys="['dps','damage']" style="width: 75px;height: 30px;"></div> <div class="l">Damage: {{hp.c.damage}}</div>
<div class="l" meter max="10" obj="hp.c" labels="['pen','load']" keys="['armourpen','thermload']" style="width: 75px;height: 30px;"></div> <div class="l">DPS: {{hp.c.dps}}</div>
<div class="l">T-Load: {{hp.c.thermload}}</div>
</div> </div>
<div class="l" ng-if="hp.c.ammo">Ammo: {{$r.fCrd(hp.c.clip)}}/{{$r.fCrd(hp.c.ammo)}}</div> <div class="l" ng-if="hp.c.ammo">Ammo: {{$r.fCrd(hp.c.clip)}}/{{$r.fCrd(hp.c.ammo)}}</div>
<div class="l" ng-if="h.c.rof != null">ROF: {{hp.c.rof}}/s</div> <div class="l" ng-if="hp.c.rof">ROF: {{hp.c.rof}}<u>/s</u></div>
<div class="l" ng-if="hp.c.armourpen">Pen: {{hp.c.armourpen}}</div>
<div class="l" ng-if="hp.c.type">Type: {{hp.c.type}}</div>
<div class="l" ng-if="hp.c.shieldmul">+{{$r.fRPct(hp.c.shieldmul)}}</div> <div class="l" ng-if="hp.c.shieldmul">+{{$r.fRPct(hp.c.shieldmul)}}</div>
<div class="l" ng-if="hp.c.range">{{hp.c.range}} KM</div> <div class="l" ng-if="hp.c.range">{{hp.c.range}} <u>KM</u></div>
<div class="r">{{hp.c.mass}} T</div> <div class="r">{{hp.c.mass}} <u>T</u></div>
</div> </div>
</div> </div>

View File

@@ -4,12 +4,14 @@
<div class="l">{{c.c.name || lbl}}</div> <div class="l">{{c.c.name || lbl}}</div>
<div class="r">{{c.c.class}}{{c.c.rating}}</div> <div class="r">{{c.c.class}}{{c.c.rating}}</div>
<div class="cb"></div> <div class="cb"></div>
<div class="l" ng-if="c.c.optmass">Opt: {{c.c.optmass}} T</div> <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.optmass}} T</div> <div class="l" ng-if="c.c.maxmass">Max: {{c.c.optmass}} <u>T</u></div>
<div class="l" ng-if="c.c.bins">{{c.c.bins}} Bins</div> <div class="l" ng-if="c.c.bins">{{c.c.bins}} <u>Bins</u></div>
<div class="l" ng-if="c.c.range">{{c.c.range}} KM</div> <div class="l" ng-if="c.c.ammo">Ammo: {{c.c.ammo}}</div>
<div class="l" ng-if="c.c.armouradd">+{{c.c.armouradd}} Armour</div> <div class="l" ng-if="c.c.repair">Repair: {{c.c.repair}}</div>
<div class="r cr">{{c.c.mass || c.c.capacity || '0'}} T</div> <div class="l" ng-if="c.c.range">{{c.c.range}} <u>KM</u></div>
<div class="l" ng-if="c.c.armouradd">+{{c.c.armouradd}} <u>Armour</u></div>
<div class="r cr">{{c.c.mass || c.c.capacity || '0'}} <u>T</u></div>
<!-- Rate add /--> <!-- Rate add /-->
</div> </div>

View File

@@ -164,6 +164,17 @@
"fuelmul": 0.011, "fuelmul": 0.011,
"fuelpower": 2.3 "fuelpower": 2.3
}, },
"5A": {
"class": 5,
"rating": "A",
"cost": 5103953,
"mass": 20,
"power": 0.6,
"optmass": 1050,
"maxfuel": 5,
"fuelmul": 0.012,
"fuelpower": 2.45
},
"5B": { "5B": {
"class": 5, "class": 5,
"rating": "B", "rating": "B",
@@ -262,16 +273,5 @@
"maxfuel": 5.3, "maxfuel": 5.3,
"fuelmul": 0.011, "fuelmul": 0.011,
"fuelpower": 2.6 "fuelpower": 2.6
},
"5A": {
"class": 5,
"rating": "A",
"cost": 5103953,
"mass": 20,
"power": 0.6,
"optmass": 1050,
"maxfuel": 5,
"fuelmul": 0.012,
"fuelpower": 2.45
} }
} }

View File

@@ -2,7 +2,7 @@
"Scanners": { "Scanners": {
"2f": { "2f": {
"group": "sc", "group": "sc",
"name": "Advanced Discovery Scanner", "name": "Adv. Discovery Scanner",
"class": 1, "class": 1,
"rating": "C", "rating": "C",
"cost": 1545000, "cost": 1545000,
@@ -12,7 +12,7 @@
}, },
"2g": { "2g": {
"group": "sc", "group": "sc",
"name": "Intermediate Discovery Scanner", "name": "Inter. Discovery Scanner",
"class": 1, "class": 1,
"rating": "D", "rating": "D",
"cost": 505000, "cost": 505000,

View File

@@ -11,7 +11,8 @@ var gulp = require('gulp'),
mainBowerFiles = require('main-bower-files'), mainBowerFiles = require('main-bower-files'),
del = require('del'), del = require('del'),
runSequence = require('run-sequence'), runSequence = require('run-sequence'),
exec = require('child_process').exec exec = require('child_process').exec,
RevAll = require('gulp-rev-all'),
pkg = require('./package.json'); pkg = require('./package.json');
gulp.task('less', function() { gulp.task('less', function() {
@@ -148,8 +149,36 @@ gulp.task('watch', function() {
gulp.watch('data/**/*.json', ['jsonToDB']); gulp.watch('data/**/*.json', ['jsonToDB']);
}); });
gulp.task('cache-bust', function(done) {
var revAll = new RevAll({ dontRenameFile: ['.html','db.json'] });
var stream = gulp.src('build/**')
.pipe(revAll.revision())
.pipe(gulp.dest('build'))
.pipe(revAll.manifestFile())
.pipe(gulp.dest('build'));
stream.on('end', function() {
var manifest = require('./build/rev-manifest.json');
var arr = [];
for(var origFileName in manifest) {
if(origFileName != manifest[origFileName]) { // For all files busted/renamed
arr.push('./build/' + origFileName); // Add the original filename to the list
}
}
del(arr, done); // Delete all originals files the were not busted/renamed
});
stream.on('error', done);
});
gulp.task('upload', function(done) {
// Does nothing yet :P
done();
});
gulp.task('clean', function (done) { del(['build'], done); }); gulp.task('clean', function (done) { del(['build'], done); });
gulp.task('build', function (done) { runSequence('clean', ['html2js','jsonToDB'], ['generateIndexHTML','bower','js','less','copy'], done); }); gulp.task('build', function (done) { runSequence('clean', ['html2js','jsonToDB'], ['generateIndexHTML','bower','js','less','copy'], done); });
gulp.task('deploy', function (done) { runSequence('build','cache-bust', 'upload', done); });
gulp.task('dev', function (done) { runSequence('build', 'serve','watch', done); }); gulp.task('dev', function (done) { runSequence('build', 'serve','watch', done); });
gulp.task('default', ['dev']); gulp.task('default', ['dev']);

View File

@@ -17,6 +17,7 @@
"gulp-jshint": "^1.10.0", "gulp-jshint": "^1.10.0",
"gulp-less": "^3.0.2", "gulp-less": "^3.0.2",
"gulp-minify-css": "^1.0.0", "gulp-minify-css": "^1.0.0",
"gulp-rev-all": "^0.8.18",
"gulp-sourcemaps": "^1.5.1", "gulp-sourcemaps": "^1.5.1",
"gulp-template": "^3.0.0", "gulp-template": "^3.0.0",
"gulp-uglify": "^1.2.0", "gulp-uglify": "^1.2.0",