events.js: Item dropping improvements

Item drop menu no longer disappears after clicking to drop something.
This commit is contained in:
Matt Rasmus
2013-07-13 17:00:57 -07:00
parent 77cac86076
commit e80fc4d286
+9 -2
View File
@@ -526,7 +526,6 @@ var Events = {
Path.outfit[thing] -= num;
Events.getLoot(btn.closest('.button'));
World.updateSupplies();
$('#dropMenu').remove();
},
getLoot: function(btn) {
@@ -548,6 +547,7 @@ var Events = {
}
});
} else {
// #dropMenu gets removed by this.
btn.text(name + ' [' + num + ']');
}
var curNum = Path.outfit[name];
@@ -555,7 +555,14 @@ var Events = {
curNum++;
Path.outfit[name] = curNum;
World.updateSupplies();
} else {
// Update weight and free space variables so we can decide
// whether or not to bring up/update the drop menu.
weight = Path.getWeight(name);
freeSpace = Path.getFreeSpace();
}
if(weight > freeSpace && btn.data('numLeft') > 0) {
// Draw the drop menu
Engine.log('drop menu');
$('#dropMenu').remove();