summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-08-04 10:44:07 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2020-08-04 10:44:07 -0400
commit5a110f52d215ccfa46e50d7dd24a094cde8eddaf (patch)
treec138a0af5eaada9f5681fbf458eaf3296c5103d5
parenta71dcc89a797602d9b61f15b93c8eed150011229 (diff)
msgenc: Implement support for text commands
-rw-r--r--tools/msgenc/msgenc.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/msgenc/msgenc.cpp b/tools/msgenc/msgenc.cpp
index 63a86751..24bcda8d 100644
--- a/tools/msgenc/msgenc.cpp
+++ b/tools/msgenc/msgenc.cpp
@@ -99,10 +99,16 @@ void encode_messages() {
size_t k = message.find('}', j);
string enclosed = message.substr(j + 1, k - j - 1);
j = k;
- if (enclosed.find("STRVAR ") == 0) {
- enclosed = enclosed.substr(7);
+ size_t pos = enclosed.find(' ');
+ string command = enclosed.substr(0, pos);
+ enclosed = enclosed.substr(pos + 1);
+ uint16_t command_i = charmap[command];
+ if (command_i != 0 || command == "STRVAR") {
encoded += enc_short(0xFFFE, seed);
vector<uint16_t> args;
+ if (command_i != 0) {
+ args.push_back(command_i);
+ }
do {
k = enclosed.find(',');
string num = enclosed.substr(0, k);