Add background information
This commit is contained in:
@@ -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}});
|
||||
}
|
||||
|
||||
@@ -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)}}')
|
||||
Reference in New Issue
Block a user