New default background (#8597)

* feat(bgs): new default background

* feat(bgs): backfill migration

* fix(migration): extraneous imports, bad paths

* fix(bgs): address comments

* fix(test): assert equality
This commit is contained in:
Sabe Jones
2017-03-28 16:49:24 -05:00
committed by GitHub
parent 1d7b733759
commit 03088f1d9f
8 changed files with 47 additions and 15 deletions

View File

@@ -65,7 +65,9 @@ habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$
(fullSet ? 3.75 : 1.75) : // (Backgrounds) 15G per set, 7G per individual
(fullSet ? 1.25 : 0.5); // (Hair, skin, etc) 5G per set, 2G per individual
if (path.indexOf('background.blue') === -1 && path.indexOf('background.green') === -1 && path.indexOf('background.red') === -1 && path.indexOf('background.purple') === -1 && path.indexOf('background.yellow') === -1) {
if (path.indexOf('background.blue') === -1 && path.indexOf('background.green') === -1 &&
path.indexOf('background.red') === -1 && path.indexOf('background.purple') === -1 &&
path.indexOf('background.yellow') === -1 && path.indexOf('background.violet') === -1) {
if (fullSet) {
if (confirm(window.env.t('purchaseFor',{cost:cost*4})) !== true) return;
if (User.user.balance < cost) return $rootScope.openModal('buyGems');
@@ -84,6 +86,10 @@ habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$
});
};
$scope.showPlainBackgroundBlurb = function(identifier, set) {
return identifier === 'incentiveBackgrounds' && !$scope.ownsSet('background', set);
};
$scope.setKeys = function(type, _set) {
return _.map(_set, function(v,k) {
if (type === 'background') k = v.key;