Skip to content

Commit

Permalink
Merge pull request #1 from Roberto-Nessy/dev
Browse files Browse the repository at this point in the history
Disable line wrap on Tingle's textboxes
  • Loading branch information
PhlexPlexico authored Jan 21, 2024
2 parents 09c1d33 + 43732fc commit 95d3e7e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions code/source/rnd/custom_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ class MsgBuilder {
u16 delayIdx = 0, delayIdxAtLastSpace = 0;
u16 sizeAtLastSpace = 0, resolvedChar = 0, lineLen = 0;
bool inCol = false, inColAtLastSpace = false;
bool lineWrap = true;
u16 sfx = msg.sfxAndFlags & 0x3FFF;
u8 resolvedCol = 0, resolvedIcon = 0, resolvedDelay = 0;
*size = 0;
Expand All @@ -195,8 +196,11 @@ class MsgBuilder {
instant();

// Tingle Map Choices. Add 3 choices, 2 for maps and 1 for no thanks.
if (msg.id >= 0x1D11 && msg.id <= 0x1D16)
if (msg.id >= 0x1D11 && msg.id <= 0x1D16) {
addCom(0x2F, 3);
// Disable line wrap to ensure text lines up with options
lineWrap = false;
}

while (++idx < MAX_UNFORMATTED_SIZE && msg.text[idx]) {
resolvedChar = msg.text[idx];
Expand Down Expand Up @@ -337,7 +341,7 @@ class MsgBuilder {

// Replace last space with newline if necessary
// If no space available use start of last item with width
if (lineLen > LINE_WIDTH) {
if (lineWrap && lineLen > LINE_WIDTH) {
if (lastSpaceIdx) {
idx = lastSpaceIdx;
colIdx = colIdxAtLastSpace;
Expand Down

0 comments on commit 95d3e7e

Please sign in to comment.