yellow warning for undoing a mistake checkbox

This commit is contained in:
Tyler Renelle 2012-09-01 17:45:20 -04:00
parent 91e4a50179
commit c434072504
2 changed files with 10 additions and 2 deletions

View file

@ -133,7 +133,11 @@ module.exports.score = score = function(spec) {
modified = expModifier(user, delta); modified = expModifier(user, delta);
exp += modified; exp += modified;
money += modified; money += modified;
if (modified > 0) {
statsNotification("<i class='icon-star'></i>Exp,GP +" + (modified.toFixed(2)), 'success'); statsNotification("<i class='icon-star'></i>Exp,GP +" + (modified.toFixed(2)), 'success');
} else {
statsNotification("<i class='icon-star'></i>Exp,GP " + (modified.toFixed(2)), 'warning');
}
} else if (type !== 'reward' && type !== 'todo') { } else if (type !== 'reward' && type !== 'todo') {
modified = hpModifier(user, delta); modified = hpModifier(user, delta);
hp += modified; hp += modified;

View file

@ -121,7 +121,11 @@ module.exports.score = score = (spec = {user:null, task:null, direction:null, cr
modified = expModifier(user, delta) modified = expModifier(user, delta)
exp += modified exp += modified
money += modified money += modified
if modified > 0
statsNotification "<i class='icon-star'></i>Exp,GP +#{modified.toFixed(2)}", 'success' statsNotification "<i class='icon-star'></i>Exp,GP +#{modified.toFixed(2)}", 'success'
else
# unchecking an accidently completed daily/todo
statsNotification "<i class='icon-star'></i>Exp,GP #{modified.toFixed(2)}", 'warning'
# Deduct from health (rewards case handled above) # Deduct from health (rewards case handled above)
else unless type in ['reward', 'todo'] else unless type in ['reward', 'todo']
modified = hpModifier(user, delta) modified = hpModifier(user, delta)