Allow universe renaming

This commit is contained in:
2023-11-18 01:28:05 +01:00
parent 8278e2206f
commit 97166139c4
3 changed files with 18 additions and 3 deletions

View File

@ -116,6 +116,20 @@ export const installInterfaceLogic = (app: Editor) => {
}
});
app.interface.universe_viewer.addEventListener("input", () => {
let content = app.interface.universe_viewer.value as string;
content = content.trim();
if (content.length > 2 && content.length < 40) {
if (content !== app.selected_universe) {
Object.defineProperty(app.universes, content,
Object.getOwnPropertyDescriptor(app.universes, app.selected_universe));
delete app.universes[app.selected_universe];
}
app.selected_universe = content.trim();
loadUniverse(app, app.selected_universe)
}
})
app.interface.audio_nudge_range.addEventListener("input", () => {
app.clock.nudge = parseInt(
(app.interface.audio_nudge_range as HTMLInputElement).value