loop and next button for manual control

This commit is contained in:
2022-12-19 21:49:57 +01:00
parent 2a42746e1c
commit f08dedba50
2 changed files with 47 additions and 3 deletions

View File

@ -43,7 +43,8 @@ export const globalStore = defineStore("globalStore", {
picture: null,
mainMenu: false,
activeSubMenu: "",
loop: true,
loop: false,
lastAction: "drawfromlast",
};
},
actions: {
@ -62,6 +63,7 @@ export const globalStore = defineStore("globalStore", {
},
toggleDraw2d() {
this.setActiveSubMenu("");
this.lastAction = "draw2d";
this.setMainMenu(false);
this.toggleStop();
this.canDraw = true;
@ -69,6 +71,7 @@ export const globalStore = defineStore("globalStore", {
},
toggleDraw2dLast() {
this.setActiveSubMenu("");
this.lastAction = "drawfromlast";
this.setMainMenu(false);
this.toggleStop();
this.canDraw = true;
@ -90,6 +93,21 @@ export const globalStore = defineStore("globalStore", {
this.draw2dpicture = false;
this.canDraw = false;
},
toggleLoop() {
this.loop = !this.loop;
},
toggleNext() {
switch (this.lastAction) {
case "drawfromlast":
this.toggleDraw2dLast();
break;
case "draw2d":
this.toggleDraw2d();
break;
default:
return;
}
},
setActiveSubMenu(data) {
if (this.activeSubMenu == data) this.activeSubMenu = "";
else this.activeSubMenu = data;