Add interaction between edit grid and inventory
This commit is contained in:
parent
469121e18a
commit
986c0479f1
9 changed files with 51 additions and 14 deletions
|
@ -2,16 +2,18 @@ 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, { padding, selected } = {
|
||||
padding: 0,
|
||||
selected: false
|
||||
}) {
|
||||
constructor(tile, onclick, x, y, w = 50, h = 50, {
|
||||
padding = 0,
|
||||
selected = false,
|
||||
quantity = 1,
|
||||
} = {}) {
|
||||
super(null, onclick, x, y, w, h);
|
||||
this.module = tile.module;
|
||||
this.image = tile.image;
|
||||
this.type = 'itemButton';
|
||||
this.padding = padding;
|
||||
this.selected = selected;
|
||||
this.quantity = quantity
|
||||
}
|
||||
|
||||
click() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue