Add background information

This commit is contained in:
MathWhiz
2016-07-22 16:54:14 -04:00
parent bf8ec2596f
commit cefa3c3056
5 changed files with 30 additions and 3 deletions
+1
View File
@@ -1,6 +1,7 @@
{
"backgrounds": "Backgrounds",
"background": "Background",
"noBackground": "No Background Selected",
"backgrounds062014": "SET 1: Released June 2014",
"backgroundBeachText":"Beach",
@@ -22,6 +22,8 @@ habitrpg
$scope.formatAnimal = Costume.formatAnimal;
$scope.formatBackground = Costume.formatBackground;
$scope.sendPrivateMessage = function(uuid, message){
if (!message) return;
@@ -18,6 +18,8 @@ habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$
$scope.formatAnimal = Costume.formatAnimal;
$scope.formatBackground = Costume.formatBackground;
$scope.allocate = function(stat){
User.allocate({query:{stat:stat}});
}
+24 -2
View File
@@ -31,9 +31,31 @@
return type == 'pet' ? window.env.t(Content.specialPets[name]) : window.env.t(Content.specialMounts[name]);
}
}
function bgString(set, bg) {
var setString = window.env.t(set);
var setNumber = setString.match(/^[^:]+/)[0].toLowerCase();
var bgString = Content.backgrounds[set][bg].text(window.env.language.code);
return bgString + " - " + setNumber.charAt(0).toUpperCase() + setNumber.slice(1)
}
function formatBackground(background) {
var backgrounds = Content.backgrounds;
for (var set in backgrounds) {
for (var bg in backgrounds[set]) {
if (background === bg) {
return bgString(set, bg)
} else {
continue
}
}
}
return window.env.t('noBackground');
}
return {
formatAnimal: formatAnimal
formatAnimal: formatAnimal,
formatBackground: formatBackground
};
}
}());
@@ -1,4 +1,4 @@
div
h4=env.t('background')
table.table.table-striped
+basicRow('background', '{{profile.preferences.background}}')
+basicRow('background', '{{formatBackground(profile.preferences.background)}}')