Add interaction between edit grid and inventory

This commit is contained in:
asraelite 2018-03-05 16:11:58 +00:00
parent 469121e18a
commit 986c0479f1
9 changed files with 51 additions and 14 deletions

View file

@ -28,6 +28,10 @@ export function removeItem(type, id) {
if (!items.has(mapId)) return;
let tile = items.get(mapId);
tile.decrease();
if (tile.quantity == 0) {
items.delete(mapId);
currentItem = null;
}
}
export function selectItem(type, id) {