[#1693] make revive available to /options too

This commit is contained in:
Tyler Renelle 2013-10-31 09:34:12 -07:00
parent 9e8cdac06f
commit 931e8125b4
3 changed files with 8 additions and 9 deletions

View file

@ -38,12 +38,6 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User', '
/* TODO this should be somewhere else, but fits the html location better here
*/
// uhoh! our first name conflict with habitrpg-shared/helpers, we gotta resovle that soon.
$rootScope.clickRevive = function() {
window.habitrpgShared.algos.revive(User.user);
User.log({ op: "revive" });
};
$scope.removeTask = function(list, $index) {
if (!confirm("Are you sure you want to delete this task?")) return;
User.log({ op: "delTask", data: list[$index] });

View file

@ -21,7 +21,7 @@ angular.module('userServices', []).
user = {}; // this is stored as a reference accessible to all controllers, that way updates propagate
//first we populate user with schema
_.extend(user, window.habitrpgShared.helpers.newUser());
_.extend(user, $window.habitrpgShared.helpers.newUser());
user.apiToken = user._id = ''; // we use id / apitoken to determine if registered
//than we try to load localStorage
@ -168,6 +168,11 @@ angular.module('userServices', []).
userServices.log(log);
},
revive: function(){
$window.habitrpgShared.algos.revive(user);
userServices.log({ op: "revive" });
},
/**
* For gem-unlockable preferences, (a) if owned, select preference (b) else, purchase
* @param path: User.preferences <-> User.purchased maps like User.preferences.skin=abc <-> User.purchased.skin.abc.
@ -181,7 +186,7 @@ angular.module('userServices', []).
if (user.balance < 1.25) return $rootScope.modals.buyGems = true;
path = path.join(',');
} else {
if (window.habitrpgShared.helpers.dotGet('purchased.' + path, user)) {
if ($window.habitrpgShared.helpers.dotGet('purchased.' + path, user)) {
var pref = path.split('.')[0],
val = path.split('.')[1];
return self.set('preferences.' + pref, val);

View file

@ -9,7 +9,7 @@ div(modal='user.stats.hp <= 0', options='{backdrop:true, keyboard:false, backdro
.row-fluid
.span4
p
a.btn.btn-danger.btn-large.notification-action(ng-click='clickRevive()') Continue
a.btn.btn-danger.btn-large.notification-action(ng-click='User.revive()') Continue
.span8
p
| You've lost a level, all your gold, and a random piece of equipment. Arise, Habiteer, and try again! Curb those negative Habits, be vigilant in completion of Dailies, and hold death at arm's length with a Potion if you falter!