From a5edceb5940bbe6924cd35f45515d3a1cba3277c Mon Sep 17 00:00:00 2001 From: "Erymanthus[#5074] | (u/)RayDeeUx" <51521765+RayDeeUx@users.noreply.github.com> Date: Thu, 11 Jul 2024 21:23:26 -0400 Subject: [PATCH] noHyphens --- mod.json | 4 ++-- src/main.cpp | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/mod.json b/mod.json index 2e2bc8f..4c68b8f 100644 --- a/mod.json +++ b/mod.json @@ -101,7 +101,7 @@ "dependencies": [ { "id": "geode.node-ids", - "version": ">=1.12.0", + "version": ">=1.11.0", "importance": "required" } ], @@ -124,6 +124,6 @@ ], "issues": { "url": "https://discord.com/channels/911701438269386882/1205523212444639292", - "info": "Ping me (@erymanthus) in the Geode SDK Discord server's #help channel if you need help. DMs are NOT accepted." + "info": "To disable hyphen prefixes and suffixes in custom messages, edit saved.json. For other issues, ping me (@erymanthus) in the Geode SDK Discord server's #help channel if you need help. DMs are NOT accepted." } } diff --git a/src/main.cpp b/src/main.cpp index a22909a..dce7d7f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -97,8 +97,15 @@ migration failed, womp womp)"; std::ifstream file(pathCustom); std::string str; while (std::getline(file, str)) { - std::string customStr = "- " + str + " -"; - quotes.push_back(customStr); + if (str.starts_with("\"") && str.ends_with("\"")) { + str = str.replace(0, 1, "\'\'"); + } else if (str.starts_with("\'") && str.ends_with("\'")) { + str = str.replace(0, 2, "\""); + } + if (!Mod::get()->getSavedValue("noHyphens")) { + str = fmt::format("- {} -", str); + } + quotes.push_back(str); } // technically i can write two one-time use boolean variables to allow people to toggle these things on and off as they please without the quotes adding themselves multiple times into the vector, but i'd rather add the "restart required" barrier just to be extra safe } }