mr-crocs-adventures/tilorswift/js/menu/EntrancePointWidget.js

28 lines
724 B
JavaScript

import Widget from "./Widget.js";
import BrushMode from "../BrushMode.js";
export default class EntrancePointWidget extends Widget
{
constructor(widgetBar, brush) {
super('Startpunkt');
this.widgetBar = widgetBar;
this.brush = brush;
this.htmlElement = this.createElement();
this.htmlElement.addEventListener(
'click',
() => {
this.widgetBar.disableWidgets();
this.enable();
this.brush.mode = BrushMode.ENTRANCE;
}
)
}
createElement()
{
let htmlElement = document.createElement('div');
htmlElement.id = 'entrance-picker';
return htmlElement;
}
}