diff --git a/projects/Randomizer/text_processors/legacy.cpp b/projects/Randomizer/text_processors/legacy.cpp index a5bb901b754..d2dbc05d5c9 100644 --- a/projects/Randomizer/text_processors/legacy.cpp +++ b/projects/Randomizer/text_processors/legacy.cpp @@ -44,11 +44,21 @@ namespace randomizer::text_processors { return text; } + + std::optional text_database(std::string_view content) { + int id = 0; + if (std::from_chars(content.data(), content.data() + content.size(), id).ec != std::errc()) { + return std::nullopt; + } + + return core::text::get_concatenated_text(id, "\n"); + } } // namespace void LegacyProcessor::process(std::string& text) const { search_and_replace("$(", value, text, "(", ")"); // Interpolate seed.text(location) search_and_replace("$[(", seed_text, text, "[(", ")]"); // Interpolate seed.text(location) search_and_replace("$[", action, text, "[", "]"); // Interpolate seed action. + search_and_replace("${", text_database, text, "{", "}"); // Interpolate seed action. } } // namespace randomizer::text_processors