Add inventory

This commit is contained in:
asraelite 2018-03-05 15:05:55 +00:00
parent 548fb99c8b
commit 469121e18a
8 changed files with 200 additions and 22 deletions

View file

@ -2,11 +2,16 @@ import * as gui from './index.mjs';
import GuiButton from './button.mjs';
export default class GuiItemButton extends GuiButton {
constructor(tile, onclick, x, y, w = 50, h = 50) {
constructor(tile, onclick, x, y, w = 50, h = 50, { padding, selected } = {
padding: 0,
selected: false
}) {
super(null, onclick, x, y, w, h);
this.module = tile.module;
this.image = tile.image;
this.type = 'itemButton';
this.padding = padding;
this.selected = selected;
}
click() {