mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
Merge pull request #39 from toofarapart/improved_item_dropping
events.js: Item dropping improvements
This commit is contained in:
+9
-2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user