Add size map

This commit is contained in:
Colin McLeod
2015-10-06 19:59:17 -07:00
parent ee99d33275
commit 08b6ec9e31
2 changed files with 9 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
angular.module('app', ['ui.router', 'ct.ui.router.extras.sticky', 'ui.sortable', 'shipyard', 'ngLodash', 'app.templates', 'pascalprecht.translate'])
.run(['$rootScope', '$location', '$window', '$document', '$state', '$translate', 'localeFormat', 'Persist', 'Discounts', 'Languages',
function($rootScope, $location, $window, $doc, $state, $translate, localeFormat, Persist, Discounts, Languages) {
.run(['$rootScope', '$location', '$window', '$document', '$state', '$translate', 'localeFormat', 'Persist', 'Discounts', 'Languages', 'SizeMap',
function($rootScope, $location, $window, $doc, $state, $translate, localeFormat, Persist, Discounts, Languages, SizeMap) {
// App is running as a standalone web app on tablet/mobile
var isStandAlone;
// This was causing issues on Windows phones ($window.external was causing Angular js to throw an exception). Backup is to try this and set isStandAlone to false if this fails.
@@ -43,6 +43,7 @@ function($rootScope, $location, $window, $doc, $state, $translate, localeFormat,
$rootScope.insurance = { opts: [{ name: 'standard', pct: 0.05 }, { name: 'alpha', pct: 0.025 }, { name: 'beta', pct: 0.0375 }] };
$rootScope.discounts = { opts: Discounts };
$rootScope.sizeRatio = Persist.getSizeRatio();
$rootScope.SZM = SizeMap;
$rootScope.title = 'Coriolis';
$rootScope.changeLanguage = function() {

View File

@@ -10,15 +10,16 @@ angular.module('shipyard', ['ngLodash'])
// Create 'angularized' references to DB. This will aid testing
.constant('ShipsDB', DB.ships)
.constant('ComponentsDB', DB.components)
.value('ArmourMultiplier', [
.constant('ArmourMultiplier', [
1, // Lightweight
1.4, // Reinforced
1.945, // Military
1.945, // Mirrored
1.945 // Reactive
])
.constant('SizeMap', ['', 'small', 'medium', 'large', 'capital'])
// Map to lookup group labels/names for component grp, used for JSON Serialization
.value('GroupMap', {
.constant('GroupMap', {
// Common
pp: 'Power Plant',
t: 'Thrusters',
@@ -64,7 +65,7 @@ angular.module('shipyard', ['ngLodash'])
sb: 'Shield Booster',
tp: 'Torpedo Pylon'
})
.value('MountMap', {
.constant('MountMap', {
'F': 'Fixed',
'G': 'Gimballed',
'T': 'Turret',
@@ -78,7 +79,7 @@ angular.module('shipyard', ['ngLodash'])
*
* @type {Array}
*/
.value('ShipFacets', [
.constant('ShipFacets', [
{ // 0
title: 'agility',
props: ['agility'],
@@ -161,7 +162,7 @@ angular.module('shipyard', ['ngLodash'])
/**
* Set of all available / theoretical discounts
*/
.value('Discounts', {
.constant('Discounts', {
'0%': 1,
'5%': 0.95,
'10%': 0.90,