%NDS% -> %ROMS%

This commit is contained in:
Dark98
2022-08-06 15:09:23 +01:00
parent c191abb2e4
commit 475962810e
5 changed files with 23 additions and 23 deletions
+6 -6
View File
@@ -83,7 +83,7 @@ static const Structs::ButtonPos Theme = { 40, 196, 280, 24 }; // Themes.
static const std::vector<std::string> mainStrings = { "LANGUAGE", "SELECT_STORE", "AUTO_UPDATE_SETTINGS_BTN", "GUI_SETTINGS_BTN", "DIRECTORY_SETTINGS_BTN", "CREDITS", "EXIT_APP" };
static const std::vector<std::string> dirStrings = { "CHANGE_3DSX_PATH", "3DSX_IN_FOLDER", "CHANGE_NDS_PATH", "CHANGE_ARCHIVE_PATH", "CHANGE_SHORTCUT_PATH", "CHANGE_FIRM_PATH" };
static const std::vector<std::string> dirStrings = { "CHANGE_3DSX_PATH", "3DSX_IN_FOLDER", "CHANGE_ROMS_PATH", "CHANGE_ARCHIVE_PATH", "CHANGE_SHORTCUT_PATH", "CHANGE_FIRM_PATH" };
extern std::vector<std::pair<std::string, std::string>> Themes;
/* Note: Украïнська is spelled using a latin i with dieresis to work in the system font */
@@ -333,7 +333,7 @@ static void SettingsHandleMain(int &page, bool &dspSettings, int &storeMode, int
Here you can..
- Change the Directory of...
- 3DSX, NDS & Archives.
- 3DSX, ROMS & Archives.
int &page: Reference to the page.
int &selection: Reference to the Selection.
@@ -377,8 +377,8 @@ static void SettingsHandleDir(int &page, int &selection) {
config->_3dsxInFolder(!config->_3dsxInFolder());
} else if (touching(touch, dirButtons[2])) {
const std::string path = Overlays::SelectDir(config->ndsPath(), Lang::get("SELECT_DIR"));
if (path != "") config->ndsPath(path);
const std::string path = Overlays::SelectDir(config->romsPath(), Lang::get("SELECT_DIR"));
if (path != "") config->romsPath(path);
} else if (touching(touch, dirButtons[3])) {
const std::string path = Overlays::SelectDir(config->archPath(), Lang::get("SELECT_DIR"));
@@ -408,8 +408,8 @@ static void SettingsHandleDir(int &page, int &selection) {
break;
case 2:
path = Overlays::SelectDir(config->ndsPath(), Lang::get("SELECT_DIR"));
if (path != "") config->ndsPath(path);
path = Overlays::SelectDir(config->romsPath(), Lang::get("SELECT_DIR"));
if (path != "") config->romsPath(path);
break;
case 3:
+2 -2
View File
@@ -129,7 +129,7 @@ Config::Config() {
if (this->json.contains("AutoUpdate")) this->autoupdate(this->getBool("AutoUpdate"));
if (this->json.contains("_3DSX_Path")) this->_3dsxPath(this->getString("_3DSX_Path"));
if (this->json.contains("_3DSX_InFolder")) this->_3dsxInFolder(this->getBool("_3DSX_InFolder"));
if (this->json.contains("NDS_Path")) this->ndsPath(this->getString("NDS_Path"));
if (this->json.contains("ROMS_Path")) this->romsPath(this->getString("ROMS_Path"));
if (this->json.contains("Archive_Path")) this->archPath(this->getString("Archive_Path"));
if (this->json.contains("Firm_Path")) this->firmPath(this->getString("Firm_Path"));
if (this->json.contains("MetaData")) this->metadata(this->getBool("MetaData"));
@@ -169,7 +169,7 @@ void Config::save() {
this->setBool("AutoUpdate", this->autoupdate());
this->setString("_3DSX_Path", this->_3dsxPath());
this->setBool("_3DSX_InFolder", this->_3dsxInFolder());
this->setString("NDS_Path", this->ndsPath());
this->setString("ROMS_Path", this->romsPath());
this->setString("Archive_Path", this->archPath());
this->setString("Firm_Path", this->firmPath());
this->setBool("MetaData", this->metadata());
+10 -10
View File
@@ -53,7 +53,7 @@ Result ScriptUtils::removeFile(const std::string &file, bool isARG) {
out = std::regex_replace(file, std::regex("%ARCHIVE_DEFAULT%"), config->archPath());
out = std::regex_replace(out, std::regex("%3DSX%/(.*)\\.(.*)"), config->_3dsxPath() + (config->_3dsxInFolder() ? "/$1/$1.$2" : "/$1.$2"));
out = std::regex_replace(out, std::regex("%3DSX%"), config->_3dsxPath());
out = std::regex_replace(out, std::regex("%NDS%"), config->ndsPath());
out = std::regex_replace(out, std::regex("%ROMS%"), config->romsPath());
out = std::regex_replace(out, std::regex("%FIRM%"), config->firmPath());
Result ret = NONE;
@@ -97,13 +97,13 @@ Result ScriptUtils::copyFile(const std::string &source, const std::string &desti
_source = std::regex_replace(source, std::regex("%ARCHIVE_DEFAULT%"), config->archPath());
_source = std::regex_replace(_source, std::regex("%3DSX%/(.*)\\.(.*)"), config->_3dsxPath() + (config->_3dsxInFolder() ? "/$1/$1.$2" : "/$1.$2"));
_source = std::regex_replace(_source, std::regex("%3DSX%"), config->_3dsxPath());
_source = std::regex_replace(_source, std::regex("%NDS%"), config->ndsPath());
_source = std::regex_replace(_source, std::regex("%ROMS%"), config->romsPath());
_source = std::regex_replace(_source, std::regex("%FIRM%"), config->firmPath());
_dest = std::regex_replace(destination, std::regex("%ARCHIVE_DEFAULT%"), config->archPath());
_dest = std::regex_replace(_dest, std::regex("%3DSX%/(.*)\\.(.*)"), config->_3dsxPath() + (config->_3dsxInFolder() ? "/$1/$1.$2" : "/$1.$2"));
_dest = std::regex_replace(_dest, std::regex("%3DSX%"), config->_3dsxPath());
_dest = std::regex_replace(_dest, std::regex("%NDS%"), config->ndsPath());
_dest = std::regex_replace(_dest, std::regex("%ROMS%"), config->romsPath());
_dest = std::regex_replace(_dest, std::regex("%FIRM%"), config->firmPath());
if (isARG) {
@@ -141,13 +141,13 @@ Result ScriptUtils::renameFile(const std::string &oldName, const std::string &ne
old = std::regex_replace(oldName, std::regex("%ARCHIVE_DEFAULT%"), config->archPath());
old = std::regex_replace(old, std::regex("%3DSX%/(.*)\\.(.*)"), config->_3dsxPath() + (config->_3dsxInFolder() ? "/$1/$1.$2" : "/$1.$2"));
old = std::regex_replace(old, std::regex("%3DSX%"), config->_3dsxPath());
old = std::regex_replace(old, std::regex("%NDS%"), config->ndsPath());
old = std::regex_replace(old, std::regex("%ROMS%"), config->romsPath());
old = std::regex_replace(old, std::regex("%FIRM%"), config->firmPath());
_new = std::regex_replace(newName, std::regex("%ARCHIVE_DEFAULT%"), config->archPath());
_new = std::regex_replace(_new, std::regex("%3DSX%/(.*)\\.(.*)"), config->_3dsxPath() + (config->_3dsxInFolder() ? "/$1/$1.$2" : "/$1.$2"));
_new = std::regex_replace(_new, std::regex("%3DSX%"), config->_3dsxPath());
_new = std::regex_replace(_new, std::regex("%NDS%"), config->ndsPath());
_new = std::regex_replace(_new, std::regex("%ROMS%"), config->romsPath());
_new = std::regex_replace(_new, std::regex("%FIRM%"), config->firmPath());
/* TODO: Kinda avoid that? */
@@ -161,7 +161,7 @@ Result ScriptUtils::downloadRelease(const std::string &repo, const std::string &
std::string out;
out = std::regex_replace(output, std::regex("%3DSX%/(.*)\\.(.*)"), config->_3dsxPath() + (config->_3dsxInFolder() ? "/$1/$1.$2" : "/$1.$2"));
out = std::regex_replace(out, std::regex("%3DSX%"), config->_3dsxPath());
out = std::regex_replace(out, std::regex("%NDS%"), config->ndsPath());
out = std::regex_replace(out, std::regex("%ROMS%"), config->romsPath());
out = std::regex_replace(out, std::regex("%ARCHIVE_DEFAULT%"), config->archPath());
out = std::regex_replace(out, std::regex("%FIRM%"), config->firmPath());
@@ -205,7 +205,7 @@ Result ScriptUtils::downloadFile(const std::string &file, const std::string &out
std::string out;
out = std::regex_replace(output, std::regex("%3DSX%/(.*)\\.(.*)"), config->_3dsxPath() + (config->_3dsxInFolder() ? "/$1/$1.$2" : "/$1.$2"));
out = std::regex_replace(out, std::regex("%3DSX%"), config->_3dsxPath());
out = std::regex_replace(out, std::regex("%NDS%"), config->ndsPath());
out = std::regex_replace(out, std::regex("%ROMS%"), config->romsPath());
out = std::regex_replace(out, std::regex("%ARCHIVE_DEFAULT%"), config->archPath());
out = std::regex_replace(out, std::regex("%FIRM%"), config->firmPath());
@@ -251,7 +251,7 @@ void ScriptUtils::installFile(const std::string &file, bool updatingSelf, const
in = std::regex_replace(file, std::regex("%ARCHIVE_DEFAULT%"), config->archPath());
in = std::regex_replace(in, std::regex("%3DSX%/(.*)\\.(.*)"), config->_3dsxPath() + (config->_3dsxInFolder() ? "/$1/$1.$2" : "/$1.$2"));
in = std::regex_replace(in, std::regex("%3DSX%"), config->_3dsxPath());
in = std::regex_replace(in, std::regex("%NDS%"), config->ndsPath());
in = std::regex_replace(in, std::regex("%ROMS%"), config->romsPath());
in = std::regex_replace(in, std::regex("%FIRM%"), config->firmPath());
if (isARG) {
@@ -282,13 +282,13 @@ Result ScriptUtils::extractFile(const std::string &file, const std::string &inpu
in = std::regex_replace(file, std::regex("%ARCHIVE_DEFAULT%"), config->archPath());
in = std::regex_replace(in, std::regex("%3DSX%/(.*)\\.(.*)"), config->_3dsxPath() + (config->_3dsxInFolder() ? "/$1/$1.$2" : "/$1.$2"));
in = std::regex_replace(in, std::regex("%3DSX%"), config->_3dsxPath());
in = std::regex_replace(in, std::regex("%NDS%"), config->ndsPath());
in = std::regex_replace(in, std::regex("%ROMS%"), config->romsPath());
in = std::regex_replace(in, std::regex("%FIRM%"), config->firmPath());
out = std::regex_replace(output, std::regex("%ARCHIVE_DEFAULT%"), config->archPath());
out = std::regex_replace(out, std::regex("%3DSX%/(.*)\\.(.*)"), config->_3dsxPath() + (config->_3dsxInFolder() ? "/$1/$1.$2" : "/$1.$2"));
out = std::regex_replace(out, std::regex("%3DSX%"), config->_3dsxPath());
out = std::regex_replace(out, std::regex("%NDS%"), config->ndsPath());
out = std::regex_replace(out, std::regex("%ROMS%"), config->romsPath());
out = std::regex_replace(out, std::regex("%FIRM%"), config->firmPath());
if (isARG) {