mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2026-03-18 05:12:23 +01:00
Snow fullscreen effect implemented
This commit is contained in:
45
tilorswift/js/dialog/DialogEffects.js
Normal file
45
tilorswift/js/dialog/DialogEffects.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import Dialog from "./Dialog.js";
|
||||
import TilorswiftEffectsUpdatedEvent from "../events/TilorswiftEffectsUpdatedEvent.js";
|
||||
|
||||
export default class DialogEffects extends Dialog
|
||||
{
|
||||
constructor(effects, checked, translations)
|
||||
{
|
||||
super();
|
||||
this.setMessage('Effekte');
|
||||
this.effects = [];
|
||||
|
||||
for (const effect of effects) {
|
||||
const checkbox = this.createCheckbox(
|
||||
translations[effect],
|
||||
effect,
|
||||
checked.indexOf(effect) !== -1,
|
||||
() => {
|
||||
console.log(checkbox.name, 'is', checkbox.isChecked());
|
||||
}
|
||||
);
|
||||
|
||||
this.effects.push(checkbox);
|
||||
this.inputAreaElement.appendChild(checkbox.htmlElement);
|
||||
}
|
||||
|
||||
this.createButton('Abbrechen');
|
||||
this.buttonOk = this.createButton('OK');
|
||||
this.buttonOk.addEventListener(
|
||||
'click',
|
||||
() => {
|
||||
const effectNames = [];
|
||||
|
||||
for (const effect of this.effects) {
|
||||
if (effect.isChecked()) {
|
||||
effectNames.push(effect.name);
|
||||
}
|
||||
}
|
||||
|
||||
window.dispatchEvent(
|
||||
new TilorswiftEffectsUpdatedEvent(effectNames)
|
||||
);
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user