diff --git a/app/js/app.js b/app/js/app.js index b8e2f236..7b9441b5 100755 --- a/app/js/app.js +++ b/app/js/app.js @@ -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() { diff --git a/app/js/shipyard/module-shipyard.js b/app/js/shipyard/module-shipyard.js index 514acadc..3617732d 100755 --- a/app/js/shipyard/module-shipyard.js +++ b/app/js/shipyard/module-shipyard.js @@ -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,