add universe destroy button

This commit is contained in:
2023-10-06 10:48:09 +02:00
parent 583b5ec079
commit b3fb51bf2d
2 changed files with 14 additions and 1 deletions

View File

@ -148,6 +148,10 @@ export class Editor {
"upload-universes"
) as HTMLButtonElement;
destroy_universes_button: HTMLButtonElement = document.getElementById(
"destroy-universes"
) as HTMLButtonElement;
documentation_button: HTMLButtonElement = document.getElementById(
"doc-button-1"
) as HTMLButtonElement;
@ -565,6 +569,15 @@ export class Editor {
this.showDocumentation();
});
this.destroy_universes_button.addEventListener("click", () => {
if (confirm("Do you want to destroy all universes?")) {
this.universes = {
...template_universes,
};
this.updateKnownUniversesView();
}
});
this.upload_universe_button.addEventListener("click", () => {
const fileInput = document.createElement("input");
fileInput.type = "file";