Skip to content

Commit

Permalink
noHyphens
Browse files Browse the repository at this point in the history
  • Loading branch information
RayDeeUx committed Jul 12, 2024
1 parent 6cc29f4 commit a5edceb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"dependencies": [
{
"id": "geode.node-ids",
"version": ">=1.12.0",
"version": ">=1.11.0",
"importance": "required"
}
],
Expand All @@ -124,6 +124,6 @@
],
"issues": {
"url": "https://discord.com/channels/911701438269386882/1205523212444639292",
"info": "Ping me <cl>(@erymanthus)</c> in the Geode SDK Discord server's <cl>#help</c> channel if you need help. <cr>DMs are NOT accepted.</c>"
"info": "To disable hyphen prefixes and suffixes in custom messages, edit saved.json. For other issues, ping me <cl>(@erymanthus)</c> in the Geode SDK Discord server's <cl>#help</c> channel if you need help. <cr>DMs are NOT accepted.</c>"
}
}
11 changes: 9 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>("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
}
}
Expand Down

0 comments on commit a5edceb

Please sign in to comment.