mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-20 13:23:45 -07:00
Improve reading messages with choice prompts
Pause before reading the choices as well as in between chioces
This commit is contained in:
parent
fb91eeb06e
commit
9dbf5cd000
1 changed files with 7 additions and 1 deletions
|
@ -3011,6 +3011,7 @@ void Message_Draw(GlobalContext* globalCtx) {
|
||||||
|
|
||||||
void Message_TTS_Decode(u8* srcBuf, u8* dstBuf, u32 srcOffset, u32 size) {
|
void Message_TTS_Decode(u8* srcBuf, u8* dstBuf, u32 srcOffset, u32 size) {
|
||||||
u32 dstIdx = 0;
|
u32 dstIdx = 0;
|
||||||
|
bool isListingChoices = false;
|
||||||
|
|
||||||
for (u32 i = 0; i < size; i++) {
|
for (u32 i = 0; i < size; i++) {
|
||||||
u8 currChar = srcBuf[i + srcOffset];
|
u8 currChar = srcBuf[i + srcOffset];
|
||||||
|
@ -3018,7 +3019,12 @@ void Message_TTS_Decode(u8* srcBuf, u8* dstBuf, u32 srcOffset, u32 size) {
|
||||||
if (currChar < ' ') {
|
if (currChar < ' ') {
|
||||||
switch (currChar) {
|
switch (currChar) {
|
||||||
case MESSAGE_NEWLINE:
|
case MESSAGE_NEWLINE:
|
||||||
dstBuf[dstIdx++] = ' ';
|
dstBuf[dstIdx++] = (isListingChoices) ? '\n' : ' ';
|
||||||
|
break;
|
||||||
|
case MESSAGE_THREE_CHOICE:
|
||||||
|
case MESSAGE_TWO_CHOICE:
|
||||||
|
dstBuf[dstIdx++] = '\n';
|
||||||
|
isListingChoices = true;
|
||||||
break;
|
break;
|
||||||
case MESSAGE_COLOR:
|
case MESSAGE_COLOR:
|
||||||
case MESSAGE_SHIFT:
|
case MESSAGE_SHIFT:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue