@ -62,6 +62,10 @@ export class UserAPI {
|
|||||||
|
|
||||||
_deleteUniverseFromInterface = (universe: string) => {
|
_deleteUniverseFromInterface = (universe: string) => {
|
||||||
delete this.app.universes[universe];
|
delete this.app.universes[universe];
|
||||||
|
this.app.settings.saveApplicationToLocalStorage(
|
||||||
|
this.app.universes,
|
||||||
|
this.app.settings
|
||||||
|
);
|
||||||
this.app.openBuffersModal();
|
this.app.openBuffersModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
uniqueNamesGenerator,
|
uniqueNamesGenerator,
|
||||||
adjectives,
|
|
||||||
colors,
|
colors,
|
||||||
animals,
|
animals,
|
||||||
} from "unique-names-generator";
|
} from "unique-names-generator";
|
||||||
@ -629,7 +628,8 @@ export class Editor {
|
|||||||
if (universeParam !== null) {
|
if (universeParam !== null) {
|
||||||
new_universe = JSON.parse(atob(universeParam));
|
new_universe = JSON.parse(atob(universeParam));
|
||||||
const randomName: string = uniqueNamesGenerator({
|
const randomName: string = uniqueNamesGenerator({
|
||||||
dictionaries: [adjectives, colors, animals],
|
length: 2, separator: '',
|
||||||
|
dictionaries: [colors, animals],
|
||||||
});
|
});
|
||||||
this.loadUniverse(randomName, new_universe["universe"]);
|
this.loadUniverse(randomName, new_universe["universe"]);
|
||||||
this.emptyUrl();
|
this.emptyUrl();
|
||||||
@ -940,7 +940,6 @@ export class Editor {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
document.getElementById("buffer-search")!.value = "";
|
document.getElementById("buffer-search")!.value = "";
|
||||||
document.getElementById("editor")!.classList.remove("invisible");
|
document.getElementById("editor")!.classList.remove("invisible");
|
||||||
document.getElementById("modal")!.classList.add("invisible");
|
|
||||||
document.getElementById("modal-buffers")!.classList.add("invisible");
|
document.getElementById("modal-buffers")!.classList.add("invisible");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,22 +1,10 @@
|
|||||||
const global_text =`
|
const global_text =`
|
||||||
// Global buffer: a central buffer to command them all.
|
|
||||||
// ====================================================
|
|
||||||
// The global buffer is a special buffer used to control
|
|
||||||
// the general behavior of your universe. It is meant to
|
|
||||||
// be used as a "control room" for your universe. You can
|
|
||||||
// make use of several commands to control the execution
|
|
||||||
// flow of all the files:
|
|
||||||
// - script(universe/universes: number): run script(s)
|
|
||||||
`
|
`
|
||||||
|
|
||||||
const local_buffer =`
|
const local_buffer =`
|
||||||
// Local buffer: nine buffers to write your algorithms.
|
|
||||||
`
|
`
|
||||||
|
|
||||||
const init_buffer=`
|
const init_buffer=`
|
||||||
// Init buffer: a buffer to initialize the universe.
|
|
||||||
// This universe is runned once when the universe is
|
|
||||||
// loaded!
|
|
||||||
`
|
`
|
||||||
|
|
||||||
const note_buffer='// Notes buffer: a buffer to write your notes.'
|
const note_buffer='// Notes buffer: a buffer to write your notes.'
|
||||||
|
|||||||
Reference in New Issue
Block a user