diff --git a/Source/Client/ModeScreenshot.cpp b/Source/Client/ModeScreenshot.cpp new file mode 100644 index 0000000..85eb644 --- /dev/null +++ b/Source/Client/ModeScreenshot.cpp @@ -0,0 +1,12 @@ +#include "Client/ModeScreenshot.h" + +// OFFSET: 0x00AD63F0 +// FUNCTION: fn_17830 +void SanitizeScreenshotName(std::string& name) { + for (std::size_t i = 0; i < name.size(); ++i) { + const char c = name[i]; + if (c == '\\' || c == '/' || c == ':' || c == '*' || c == '?' || c == '"' || c == '<' || c == '>' || c == '|') { + name[i] = '_'; + } + } +} diff --git a/Source/Client/ModeScreenshot.h b/Source/Client/ModeScreenshot.h new file mode 100644 index 0000000..71a1250 --- /dev/null +++ b/Source/Client/ModeScreenshot.h @@ -0,0 +1,8 @@ +#ifndef RAGNAROK_SOURCE_CLIENT_MODESCREENSHOT_H +#define RAGNAROK_SOURCE_CLIENT_MODESCREENSHOT_H + +#include + +void SanitizeScreenshotName(std::string& name); + +#endif diff --git a/data/compile.json b/data/compile.json index 3e6b785..37a9adf 100644 --- a/data/compile.json +++ b/data/compile.json @@ -260,6 +260,7 @@ "Source/Client/ModeBaseEvents.cpp": 0, "Source/Client/ModeFade.cpp": 0, "Source/Client/ModeFadeOut.cpp": 0, + "Source/Client/ModeScreenshot.cpp": 0, "Source/Client/ModeTransitions.cpp": 0, "Source/Client/Registry.cpp": 0, "Source/Client/Replay.cpp": 0,