From df222e691bd4ef8cd0f96b12921eef2f98b4b5d0 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 18 Mar 2019 12:13:36 -0400 Subject: [PATCH] Make Patch::reset load the system template --- src/patch.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/patch.cpp b/src/patch.cpp index 1fdcbcd5..8abf4883 100644 --- a/src/patch.cpp +++ b/src/patch.cpp @@ -47,24 +47,22 @@ void PatchManager::init(std::string path) { return; } - this->path = ""; - if (load(asset::user("template.vcv"))) { - return; - } - - if (load(asset::system("template.vcv"))) { - return; - } + reset(); } void PatchManager::reset() { APP->history->clear(); APP->scene->rack->clear(); APP->scene->rackScroll->reset(); - // Fails silently if file does not exist - load(asset::user("template.vcv")); - legacy = 0; + path = ""; + if (load(asset::user("template.vcv"))) { + return; + } + + if (load(asset::system("template.vcv"))) { + return; + } } void PatchManager::resetDialog() { @@ -170,6 +168,7 @@ bool PatchManager::load(std::string path) { APP->history->clear(); APP->scene->rack->clear(); APP->scene->rackScroll->reset(); + legacy = 0; fromJson(rootJ); return true; }