mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
add +2 Missed Days to debug menu in footer, adjust addMissedDay function and all calls to it
This commit is contained in:
1
common/dist/scripts/habitrpg-shared.js
vendored
1
common/dist/scripts/habitrpg-shared.js
vendored
@@ -7240,6 +7240,7 @@ process.browser = true;
|
||||
process.env = {};
|
||||
process.argv = [];
|
||||
process.version = ''; // empty string to avoid regexp issues
|
||||
process.versions = {};
|
||||
|
||||
function noop() {}
|
||||
|
||||
|
||||
@@ -71,11 +71,11 @@ function($scope, $rootScope, User, $http, Notification, ApiUrl) {
|
||||
'stats.hp': 1
|
||||
});
|
||||
}
|
||||
$scope.addMissedDay = function(){
|
||||
if (!confirm("Are you sure you want to reset the day?")) return;
|
||||
var dayBefore = moment(User.user.lastCron).subtract(1, 'days').toDate();
|
||||
$scope.addMissedDay = function(numberOfDays){
|
||||
if (!confirm("Are you sure you want to reset the day by " + numberOfDays + " day(s)?")) return;
|
||||
var dayBefore = moment(User.user.lastCron).subtract(numberOfDays, 'days').toDate();
|
||||
User.set({'lastCron': dayBefore});
|
||||
Notification.text('-1 day, remember to refresh');
|
||||
Notification.text('-' + numberOfDays + ' day(s), remember to refresh');
|
||||
}
|
||||
$scope.addTenGems = function(){
|
||||
$http.post(ApiUrl.get() + '/api/v2/user/addTenGems').success(function(){
|
||||
|
||||
@@ -77,7 +77,8 @@ footer.footer(ng-controller='FooterCtrl')
|
||||
h4 Debug
|
||||
.btn-group-vertical
|
||||
a.btn.btn-default(ng-click='setHealthLow()') Health = 1
|
||||
a.btn.btn-default(ng-click='addMissedDay()') +1 Missed Day
|
||||
a.btn.btn-default(ng-click='addMissedDay(1)') +1 Missed Day
|
||||
a.btn.btn-default(ng-click='addMissedDay(2)') +2 Missed Days
|
||||
a.btn.btn-default(ng-click='addTenGems()') +10 Gems
|
||||
a.btn.btn-default(ng-click='addGold()') +GP
|
||||
a.btn.btn-default(ng-click='addLevelsAndGold()') +Exp +GP +MP
|
||||
|
||||
@@ -46,7 +46,7 @@ script(type='text/ng-template', id='modals/restore.html')
|
||||
label.control-label=env.t('fix21Streaks')
|
||||
//- This is causing too many problems for users
|
||||
h3=env.t('other')
|
||||
a.btn.btn-sm.btn-warning(ng-controller='FooterCtrl', ng-click='addMissedDay()')=env.t('triggerDay')
|
||||
a.btn.btn-sm.btn-warning(ng-controller='FooterCtrl', ng-click='addMissedDay(1)')=env.t('triggerDay')
|
||||
.modal-footer
|
||||
button.btn.btn-default(ng-click='$close()')=env.t('discardChanges')
|
||||
button.btn.btn-primary(ng-click='restore(); $close();')=env.t('saveAndClose')
|
||||
|
||||
Reference in New Issue
Block a user