Adding universe based functions

This commit is contained in:
2023-10-05 21:45:25 +02:00
parent 0f9c33d2df
commit 90cdff7846
2 changed files with 29 additions and 1 deletions

View File

@ -265,7 +265,7 @@ export class UserAPI {
};
s = this.script;
clear_script = (script: number): void => {
delete_script = (script: number): void => {
/**
* Clears a local script
*
@ -292,6 +292,24 @@ export class UserAPI {
};
cps = this.copy_script;
copy_universe = (from: string, to: string): void => {
this.app.universes[to] = {
...this.app.universes[from],
};
};
delete_universe = (universe: string): void => {
if (this.app.selected_universe === universe) {
this.app.selected_universe = "Default";
}
delete this.app.universes[universe];
this.app.settings.saveApplicationToLocalStorage(
this.app.universes,
this.app.settings
);
this.app.updateKnownUniversesView();
};
// =============================================================
// MIDI related functions
// =============================================================