From 13d09e4aa08b674d42f982481a22b887cc5097fe Mon Sep 17 00:00:00 2001 From: William JCM Date: Sat, 15 Jan 2022 11:31:33 +0100 Subject: [PATCH] SaveTool: prepare for the better import/export system. --- src/SaveTool/SaveTool.cpp | 20 ++++++++++++++++++++ src/SaveTool/SaveTool.h | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/src/SaveTool/SaveTool.cpp b/src/SaveTool/SaveTool.cpp index beea4e0..1864630 100644 --- a/src/SaveTool/SaveTool.cpp +++ b/src/SaveTool/SaveTool.cpp @@ -95,6 +95,10 @@ SaveTool::SaveTool(const Arguments& arguments): _backupsDir = Utility::Directory::join(Utility::Directory::path(Utility::Directory::executableLocation()), "backups"); _stagingDir = Utility::Directory::join(Utility::Directory::path(Utility::Directory::executableLocation()), "staging"); + _armouryDir = Utility::Directory::join(Utility::Directory::path(Utility::Directory::executableLocation()), "armoury"); + _armoursDir = Utility::Directory::join(_armouryDir, "armours"); + _weaponsDir = Utility::Directory::join(_armouryDir, "weapons"); + _stylesDir = Utility::Directory::join(_armouryDir, "styles"); if(!Utility::Directory::exists(_backupsDir)) { Utility::Directory::mkpath(_backupsDir); @@ -104,6 +108,22 @@ SaveTool::SaveTool(const Arguments& arguments): Utility::Directory::mkpath(_stagingDir); } + if(!Utility::Directory::exists(_armouryDir)) { + Utility::Directory::mkpath(_armouryDir); + } + + if(!Utility::Directory::exists(_armoursDir)) { + Utility::Directory::mkpath(_armoursDir); + } + + if(!Utility::Directory::exists(_weaponsDir)) { + Utility::Directory::mkpath(_weaponsDir); + } + + if(!Utility::Directory::exists(_stylesDir)) { + Utility::Directory::mkpath(_stylesDir); + } + if(!findGameDataDirectory()) { SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error initialising the app", _lastError.c_str(), window()); exit(EXIT_FAILURE); diff --git a/src/SaveTool/SaveTool.h b/src/SaveTool/SaveTool.h index 7338049..ed76717 100644 --- a/src/SaveTool/SaveTool.h +++ b/src/SaveTool/SaveTool.h @@ -212,6 +212,10 @@ class SaveTool: public Platform::Sdl2Application, public efsw::FileWatchListener std::string _backupsDir; std::string _stagingDir; + std::string _armouryDir; + std::string _armoursDir; + std::string _weaponsDir; + std::string _stylesDir; enum class GameState : UnsignedByte { Unknown, NotRunning, Running