add debug buttons back in, including +10 gems (@sabrecat)

This commit is contained in:
Tyler Renelle
2013-10-31 15:14:19 -07:00
parent 238d796ec4
commit d8218927e5
6 changed files with 37 additions and 43 deletions

View File

@@ -1,7 +1,7 @@
"use strict";
habitrpg.controller("FooterCtrl", ['$scope', '$rootScope', 'User', '$http',
function($scope, $rootScope, User, $http) {
habitrpg.controller("FooterCtrl", ['$scope', '$rootScope', 'User', '$http', 'Notification', 'API_URL',
function($scope, $rootScope, User, $http, Notification, API_URL) {
/**
External Scripts
@@ -39,6 +39,26 @@ habitrpg.controller("FooterCtrl", ['$scope', '$rootScope', 'User', '$http',
});
});
}
}
/**
* Debug functions. Note that the server route for gems is only available if process.env.DEBUG=true
*/
$scope.addMissedDay = function(){
var dayBefore = moment(User.user.lastCron).subtract('days', 1).toDate();
User.set({lastCron: dayBefore});
Notification.text('-1 day, remember to refresh');
}
$scope.addTenGems = function(){
console.log(API_URL);
$http.post(API_URL + '/api/v1/user/addTenGems').success(function(){
User.log({});
})
}
$scope.addLevelsAndGold = function(){
User.setMultiple({
'stats.exp': User.user.stats.exp + 10000,
'stats.gp': User.user.stats.gp + 10000
});
}
}])