From a402739b976c5b15d2df06a872655d2800b14280 Mon Sep 17 00:00:00 2001 From: Gator Date: Mon, 19 Dec 2022 21:49:57 +0100 Subject: [PATCH] loop and next button for manual control --- src/components/MenuReset.vue | 30 ++++++++++++++++++++++++++++-- src/stores/index.js | 20 +++++++++++++++++++- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/src/components/MenuReset.vue b/src/components/MenuReset.vue index ad90d12..e0cef4c 100644 --- a/src/components/MenuReset.vue +++ b/src/components/MenuReset.vue @@ -1,5 +1,23 @@ diff --git a/src/stores/index.js b/src/stores/index.js index eca1648..374085c 100644 --- a/src/stores/index.js +++ b/src/stores/index.js @@ -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;