mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
feat(customize): Animal skins and ears
Implements a base-pet-themed set of avatar skins and head accessories, the latter of which has additional handling for the user to purchase them from the Avatar Customization page.
This commit is contained in:
@@ -103,26 +103,6 @@ habitrpg.controller("InventoryCtrl",
|
||||
}
|
||||
}
|
||||
|
||||
$scope.purchase = function(type, item){
|
||||
if (type == 'special') return User.user.ops.buySpecialSpell({params:{key:item.key}});
|
||||
|
||||
var gems = User.user.balance * 4;
|
||||
|
||||
var string = (type == 'weapon') ? window.env.t('weapon') : (type == 'armor') ? window.env.t('armor') : (type == 'head') ? window.env.t('headgear') : (type == 'shield') ? window.env.t('offhand') : (type == 'headAccessory') ? window.env.t('headAccessory') : (type == 'hatchingPotions') ? window.env.t('hatchingPotion') : (type == 'eggs') ? window.env.t('eggSingular') : (type == 'quests') ? window.env.t('quest') : (item.key == 'Saddle') ? window.env.t('foodSaddleText').toLowerCase() : type; // this is ugly but temporary, once the purchase modal is done this will be removed
|
||||
if (type == 'weapon' || type == 'armor' || type == 'head' || type == 'shield' || type == 'headAccessory') {
|
||||
if (gems < ((item.specialClass == "wizard") && (item.type == "weapon")) + 1) return $rootScope.openModal('buyGems');
|
||||
var message = window.env.t('buyThis', {text: string, price: ((item.specialClass == "wizard") && (item.type == "weapon")) + 1, gems: gems})
|
||||
if($window.confirm(message))
|
||||
User.user.ops.purchase({params:{type:"gear",key:item.key}});
|
||||
} else {
|
||||
if(gems < item.value) return $rootScope.openModal('buyGems');
|
||||
var message = window.env.t('buyThis', {text: string, price: item.value, gems: gems})
|
||||
if($window.confirm(message))
|
||||
User.user.ops.purchase({params:{type:type,key:item.key}});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$scope.choosePet = function(egg, potion){
|
||||
var petDisplayName = env.t('petName', {
|
||||
potion: Content.hatchingPotions[potion] ? Content.hatchingPotions[potion].text() : potion,
|
||||
|
||||
Reference in New Issue
Block a user