mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-10 13:38:08 -05:00
Do not use Yes/No hardcoded options for Better Owl (#2002)
This commit is contained in:
parent
8461ea4abd
commit
0fca1019a2
@ -28,41 +28,35 @@ MessageTableEntry* OTRMessage_LoadTable(const char* filePath, bool isNES) {
|
|||||||
// Look for Owl Text
|
// Look for Owl Text
|
||||||
if (file->messages[i].id == 0x2066) {
|
if (file->messages[i].id == 0x2066) {
|
||||||
// Create a new message based on the Owl Text
|
// Create a new message based on the Owl Text
|
||||||
char* kaeporaPatch = (char*)malloc(sizeof(char) * file->messages[i].msg.size());
|
uint32_t kaeporaMsgSize = file->messages[i].msg.size();
|
||||||
file->messages[i].msg.copy(kaeporaPatch, file->messages[i].msg.size(), 0);
|
char* kaeporaOg = (char*)malloc(sizeof(char) * kaeporaMsgSize);
|
||||||
|
char* kaeporaPatch = (char*)malloc(sizeof(char) * kaeporaMsgSize);
|
||||||
|
file->messages[i].msg.copy(kaeporaOg, kaeporaMsgSize, 0);
|
||||||
|
file->messages[i].msg.copy(kaeporaPatch, kaeporaMsgSize, 0);
|
||||||
|
|
||||||
|
size_t colorPos = file->messages[i].msg.find(QM_GREEN);
|
||||||
|
size_t newLinePos = colorPos + file->messages[i].msg.substr(colorPos + 1).find(CTRL_NEWLINE) + 1;
|
||||||
|
size_t endColorPos = newLinePos + file->messages[i].msg.substr(newLinePos).find(CTRL_COLOR);
|
||||||
|
size_t NoLength = newLinePos - (colorPos + 1);
|
||||||
|
size_t YesLength = endColorPos - (newLinePos + 1);
|
||||||
// Swap the order of yes and no in this new message
|
// Swap the order of yes and no in this new message
|
||||||
if (filePath == "text/nes_message_data_static/nes_message_data_static") {
|
size_t yes = 0;
|
||||||
kaeporaPatch[26] = 'Y';
|
while (yes < YesLength) {
|
||||||
kaeporaPatch[27] = 'e';
|
kaeporaPatch[colorPos + yes + 1] = kaeporaOg[newLinePos + yes + 1];
|
||||||
kaeporaPatch[28] = 's';
|
yes++;
|
||||||
kaeporaPatch[29] = 1;
|
}
|
||||||
kaeporaPatch[30] = 'N';
|
kaeporaPatch[colorPos + yes + 1] = CTRL_NEWLINE;
|
||||||
kaeporaPatch[31] = 'o';
|
size_t no = 0;
|
||||||
} else if (filePath == "text/ger_message_data_static/ger_message_data_static") {
|
while (no < NoLength) {
|
||||||
kaeporaPatch[30] = 'J';
|
kaeporaPatch[colorPos + yes + 2 + no] = kaeporaOg[colorPos + 1 + no];
|
||||||
kaeporaPatch[31] = 'a';
|
no++;
|
||||||
kaeporaPatch[32] = '!';
|
|
||||||
kaeporaPatch[33] = 1;
|
|
||||||
kaeporaPatch[34] = 'N';
|
|
||||||
kaeporaPatch[35] = 'e';
|
|
||||||
kaeporaPatch[36] = 'i';
|
|
||||||
kaeporaPatch[37] = 'n';
|
|
||||||
} else {
|
|
||||||
kaeporaPatch[26] = 'O';
|
|
||||||
kaeporaPatch[27] = 'u';
|
|
||||||
kaeporaPatch[28] = 'i';
|
|
||||||
kaeporaPatch[29] = 1;
|
|
||||||
kaeporaPatch[30] = 'N';
|
|
||||||
kaeporaPatch[31] = 'o';
|
|
||||||
kaeporaPatch[32] = 'n';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// load data into message
|
// load data into message
|
||||||
table[file->messages.size()].textId = 0x71B3;
|
table[file->messages.size()].textId = 0x71B3;
|
||||||
table[file->messages.size()].typePos = (file->messages[i].textboxType << 4) | file->messages[i].textboxYPos;
|
table[file->messages.size()].typePos = (file->messages[i].textboxType << 4) | file->messages[i].textboxYPos;
|
||||||
table[file->messages.size()].segment = kaeporaPatch;
|
table[file->messages.size()].segment = kaeporaPatch;
|
||||||
table[file->messages.size()].msgSize = file->messages[i].msg.size();
|
table[file->messages.size()].msgSize = kaeporaMsgSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
table[i].textId = file->messages[i].id;
|
table[i].textId = file->messages[i].id;
|
||||||
|
Loading…
Reference in New Issue
Block a user