diff --git a/srcjs/stendhal.css b/srcjs/stendhal.css index 7099c3597cf..3f40a41a7cd 100644 --- a/srcjs/stendhal.css +++ b/srcjs/stendhal.css @@ -39,6 +39,10 @@ div.itemSlot { font-size:10px; text-shadow: -1px 0 #000, 0 1px #000, 1px 0 #000, 0 -1px #000; } +div.quickPickup div.itemSlot { + cursor: url(/data/sprites/cursor/itempickupfromslot.png) 1 3, auto; +} + .equipment {position:relative; height:160px; border: 1px solid black} #head0 {position:absolute; top:0px; left:40px} #lhand0 {position:absolute; top:50px; left:80px} diff --git a/srcjs/stendhal/entity/chest.js b/srcjs/stendhal/entity/chest.js index 47ff843da56..cc2bccfbf05 100644 --- a/srcjs/stendhal/entity/chest.js +++ b/srcjs/stendhal/entity/chest.js @@ -79,7 +79,7 @@ marauroa.rpobjectFactory["chest"] = marauroa.util.fromProto(marauroa.rpobjectFac openInventoryWindow: function() { if (!this.inventory || !this.inventory.popupdiv.parentNode) { - this.inventory = stendhal.ui.equip.createInventoryWindow("content", 5, 6, this, "Chest"); + this.inventory = stendhal.ui.equip.createInventoryWindow("content", 5, 6, this, "Chest", false); } }, diff --git a/srcjs/stendhal/entity/corpse.js b/srcjs/stendhal/entity/corpse.js index 721fa5a155d..74f66e17903 100644 --- a/srcjs/stendhal/entity/corpse.js +++ b/srcjs/stendhal/entity/corpse.js @@ -65,7 +65,7 @@ marauroa.rpobjectFactory["corpse"] = marauroa.util.fromProto(marauroa.rpobjectFa openCorpseInventory: function() { if (!this.inventory || !this.inventory.popupdiv.parentNode) { - this.inventory = stendhal.ui.equip.createInventoryWindow("content", 2, 2, this, "Corpse"); + this.inventory = stendhal.ui.equip.createInventoryWindow("content", 2, 2, this, "Corpse", true); } }, @@ -74,7 +74,7 @@ marauroa.rpobjectFactory["corpse"] = marauroa.util.fromProto(marauroa.rpobjectFa this.autoOpenedAlready = true; if (marauroa.me && (this["corpse_owner"] == marauroa.me["_name"])) { - // TODO: for unknown reason, /data/sprites/items/undefined/undefined.png is requires without this delay + // TODO: for unknown reason, /data/sprites/items/undefined/undefined.png is requested without this delay var that = this; window.setTimeout(function() { that.openCorpseInventory(); diff --git a/srcjs/stendhal/ui/itemcontainer.js b/srcjs/stendhal/ui/itemcontainer.js index ef53db46735..19c1cd87531 100644 --- a/srcjs/stendhal/ui/itemcontainer.js +++ b/srcjs/stendhal/ui/itemcontainer.js @@ -22,7 +22,7 @@ stendhal.ui = stendhal.ui || {}; * * @constructor */ -stendhal.ui.ItemContainerWindow = function(slot, size, object, suffix) { +stendhal.ui.ItemContainerWindow = function(slot, size, object, suffix, quickPickup) { this.update = function() { render(); }; @@ -115,6 +115,16 @@ stendhal.ui.ItemContainerWindow = function(slot, size, object, suffix) { function onMouseUp(e) { if (e.target.dataItem) { + if (quickPickup) { + marauroa.clientFramework.sendAction({ + type: "equip", + "source_path": e.target.dataItem.getIdPath(), + "target_path": "[" + marauroa.me["id"] + "\tbag]", + "zone": marauroa.currentZoneName + }); + return; + } + if (isRightClick(e)) { new stendhal.ui.Menu(e.target.dataItem, e.pageX - 50, e.pageY - 5); } else { @@ -150,7 +160,7 @@ stendhal.ui.equip = { for (var i in this.slotNames) { stendhal.ui.equip.inventory.push( new stendhal.ui.ItemContainerWindow( - this.slotNames[i], this.slotSizes[i], null, "")); + this.slotNames[i], this.slotSizes[i], null, "", false)); } }, @@ -160,17 +170,21 @@ stendhal.ui.equip = { } }, - createInventoryWindow: function(slot, sizeX, sizeY, object, title) { + createInventoryWindow: function(slot, sizeX, sizeY, object, title, quickPickup) { stendhal.ui.equip.counter++; var suffix = "." + stendhal.ui.equip.counter + "."; - var html = "