mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
feat(Armoire): Improved counter
The popover counter of remaining Equipment in the Armoire now counts down immediately instead of requiring a browser refresh. A modal announces when the last item has been found. Also includes several fixes to the Ultimate Gear migration.
This commit is contained in:
@@ -106,6 +106,11 @@ habitrpg.controller('NotificationCtrl',
|
||||
$rootScope.openModal('achievements/ultimateGear');
|
||||
}, true);
|
||||
|
||||
$rootScope.$watch('user.flags.armoireEmpty', function(after,before){
|
||||
if (before == undefined || after == before || after == false) return;
|
||||
$rootScope.openModal('armoireEmpty');
|
||||
});
|
||||
|
||||
$rootScope.$watch('user.achievements.rebirths', function(after, before){
|
||||
if(after === before) return;
|
||||
$rootScope.openModal('achievements/rebirth');
|
||||
|
||||
@@ -34,7 +34,6 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
||||
$rootScope.Groups = Groups;
|
||||
$rootScope.toJson = angular.toJson;
|
||||
$rootScope.Payments = Payments;
|
||||
$rootScope.armoireCount = Shared.countArmoire(User.user.items.gear.owned);
|
||||
|
||||
// Angular UI Router
|
||||
$rootScope.$state = $state;
|
||||
|
||||
@@ -4,6 +4,9 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
|
||||
function($scope, $rootScope, $location, User, Notification, $http, ApiUrl, $timeout, Shared, Guide) {
|
||||
$scope.obj = User.user; // used for task-lists
|
||||
$scope.user = User.user;
|
||||
$scope.armoireCount = function(gear) {
|
||||
return Shared.countArmoire(gear);
|
||||
};
|
||||
|
||||
$scope.score = function(task, direction) {
|
||||
switch (task.type) {
|
||||
|
||||
Reference in New Issue
Block a user