MessageEditor updates

This commit is contained in:
scawful
2024-08-10 20:11:21 -04:00
parent 9cea919246
commit 2d8a658e5e
4 changed files with 35 additions and 103 deletions

View File

@@ -13,10 +13,9 @@ namespace editor {
const uint8_t MESSAGETERMINATOR = 0x7F;
std::string ReplaceAllDictionaryWords(std::string str);
std::vector<uint8_t> ParseMessageToData(std::string str);
const std::string CHEESE = "\uBEBE"; // Inserted into commands to protect
// them from dictionary replacements.
// Inserted into commands to protect them from dictionary replacements.
const std::string CHEESE = "\uBEBE";
struct MessageData {
int ID;
@@ -48,12 +47,6 @@ struct MessageData {
ContentsParsed = other.ContentsParsed;
}
void SetMessage(std::string messageString) {
ContentsParsed = messageString;
RawString = OptimizeMessageForDictionary(messageString);
RecalculateData();
}
std::string ToString() {
return absl::StrFormat("%0X - %s", ID, ContentsParsed);
}
@@ -85,11 +78,6 @@ struct MessageData {
return finalString;
}
void RecalculateData() {
Data = ParseMessageToData(RawString);
DataParsed = ParseMessageToData(ContentsParsed);
}
};
struct TextElement {