From a0c5d7369411f1899fdae7e14c0e8a07af5050a8 Mon Sep 17 00:00:00 2001 From: Pepper0ni <93387759+Pepper0ni@users.noreply.github.com> Date: Fri, 18 Apr 2025 17:25:01 +0100 Subject: [PATCH] WIP --- .../custom-message/CustomMessageManager.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp b/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp index a9c19f11f..fb459769f 100644 --- a/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp +++ b/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp @@ -536,11 +536,16 @@ void CustomMessage::AutoFormatString(std::string& str) const { // or move the lastNewline cursor to the next line if a '^' is encountered. } else if (carrot < lastNewline + lineLength) { lastNewline = carrot + 1; - // some lines need to be split but don't have spaces, look for periods instead + // some lines need to be split but don't have spaces, look for punctuation instead } else if (lastSpace == std::string::npos) { - const size_t lastPeriod = str.rfind('.', lastNewline + lineLength); - str.replace(lastPeriod, 1, ".^" + colorText); - lastNewline = lastPeriod + 2; + const size_t lastPunc = str.find_last_of('.,!', lastNewline + lineLength); + //if none exist, we just have to throw it down somewhere.... + if (lastPunc != std::string::npos){ + + } else { + str.insert(lastPunc+1, "^" + colorText); + lastNewline = lastPunc + 2; + } } else { str.replace(lastSpace, 1, "^" + colorText); lastNewline = lastSpace + 1;