Skip to content

Commit

Permalink
Merge branch 'chrismaltby:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
tomo666 authored Sep 7, 2024
2 parents 31b0c00 + 9fdcde6 commit 6ad4fba
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 43 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix issue causing crash when trying to preview an FX Hammer effect index that doesn't exist
- Fix issue building game when playing FX Hammer sound effect that doesn't exist (overflowed values will clamp to available range)
- Fix issue where migrate project confirmation dialog would appear behind project window on Linux
- Fix issue where "Display Dialogue" event would inconsistently pause between each dialogue in a multi dialogue sequence
- Fix issue where text scroll would not scroll first character of each line of text when using avatars

## [4.1.1] - 2024-09-04

Expand Down
40 changes: 19 additions & 21 deletions src/lib/compiler/scriptBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,8 @@ class ScriptBuilder {
width: number,
height: number,
color: ScriptBuilderUIColor,
drawFrame: boolean
drawFrame: boolean,
autoScroll = true
) => {
this._addCmd(
"VM_OVERLAY_CLEAR",
Expand All @@ -2004,7 +2005,10 @@ class ScriptBuilder {
width,
height,
color,
unionFlags([".UI_AUTO_SCROLL"].concat(drawFrame ? ".UI_DRAW_FRAME" : []))
unionFlags([
...(autoScroll ? [".UI_AUTO_SCROLL"] : []),
...(drawFrame ? [".UI_DRAW_FRAME"] : []),
])
);
};

Expand Down Expand Up @@ -3884,15 +3888,8 @@ extern void __mute_mask_${symbol};
}
}

let endDelaySequence = "";
if (closeWhen === "text") {
endDelaySequence = `\\001\\${decOct(8)}\\001\\${decOct(6)}`;
} else if (textIndex !== input.length - 1) {
endDelaySequence = `\\001\\${decOct(7)}`;
}

this._loadStructuredText(
`${textPosSequence}${text}${endDelaySequence}`,
`${textPosSequence}${text}`,
avatarIndex,
textHeight
);
Expand All @@ -3903,7 +3900,8 @@ extern void __mute_mask_${symbol};
20,
textBoxHeight,
".UI_COLOR_WHITE",
showFrame
showFrame,
false
);
}

Expand All @@ -3915,15 +3913,15 @@ extern void __mute_mask_${symbol};
".OVERLAY_SPEED_INSTANT"
);
this._overlayMoveTo(0, textBoxY, overlayInSpeed);
}

this._overlaySetScroll(
textX + (avatarId ? 3 : 0),
textY,
(showFrame ? 19 : 20) - (avatarId ? 3 : 0) - textX,
textHeight,
".UI_COLOR_WHITE"
);
this._overlaySetScroll(
textX + (avatarId ? 2 : 0),
textY,
(showFrame ? 19 : 20) - (avatarId ? 2 : 0) - textX,
textHeight,
".UI_COLOR_WHITE"
);
}

this._displayText();

Expand Down Expand Up @@ -4061,7 +4059,7 @@ extern void __mute_mask_${symbol};
}

this._loadStructuredText(choiceText);
this._overlayClear(0, 0, 20, numLines + 2, ".UI_COLOR_WHITE", true);
this._overlayClear(0, 0, 20, numLines + 2, ".UI_COLOR_WHITE", true, true);
this._overlayMoveTo(0, 18 - numLines - 2, ".OVERLAY_IN_SPEED");
this._displayText();
this._overlayWait(true, [".UI_WAIT_WINDOW", ".UI_WAIT_TEXT"]);
Expand Down Expand Up @@ -4123,7 +4121,7 @@ extern void __mute_mask_${symbol};
}

this._loadStructuredText(menuText);
this._overlayClear(0, 0, 20 - x, height + 2, ".UI_COLOR_WHITE", true);
this._overlayClear(0, 0, 20 - x, height + 2, ".UI_COLOR_WHITE", true, true);
if (layout === "menu") {
this._overlayMoveTo(10, 18, ".OVERLAY_SPEED_INSTANT");
}
Expand Down
16 changes: 8 additions & 8 deletions test/data/compiler/compileEntityEvents.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ _testname::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "HELLO WORLD"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
Expand Down Expand Up @@ -147,10 +147,10 @@ _testname::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "\\001\\001\\002\\002@A\\nBC\\001\\003\\004\\001\\377\\002\\001HELLO WORLD"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 4, 1, 15, 5, .UI_COLOR_WHITE
VM_OVERLAY_SET_SCROLL 3, 1, 16, 5, .UI_COLOR_WHITE
VM_DISPLAY_TEXT
VM_OVERLAY_WAIT .UI_MODAL, ^/(.UI_WAIT_WINDOW | .UI_WAIT_TEXT | .UI_WAIT_BTN_A)/
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_OUT_SPEED
Expand Down Expand Up @@ -217,7 +217,7 @@ _testname::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "FALSE PATH"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
Expand All @@ -231,7 +231,7 @@ _testname::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "TRUE PATH"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
Expand Down Expand Up @@ -308,7 +308,7 @@ _testname::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "FALSE PATH"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
Expand All @@ -322,7 +322,7 @@ _testname::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "TRUE PATH"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
Expand All @@ -336,7 +336,7 @@ _testname::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "AFTER"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
Expand Down
14 changes: 7 additions & 7 deletions test/data/compiler/gbvmBuildHelpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ _scene_1_init::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "hello world"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_DISPLAY_TEXT
VM_OVERLAY_WAIT .UI_MODAL, ^/(.UI_WAIT_WINDOW | .UI_WAIT_TEXT | .UI_WAIT_BTN_A)/
Expand Down Expand Up @@ -67,7 +67,7 @@ _SCRIPT::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "hello world"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_DISPLAY_TEXT
VM_OVERLAY_WAIT .UI_MODAL, ^/(.UI_WAIT_WINDOW | .UI_WAIT_TEXT | .UI_WAIT_BTN_A)/
Expand Down Expand Up @@ -108,7 +108,7 @@ _scene_1_init::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "hello world"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_DISPLAY_TEXT
VM_OVERLAY_WAIT .UI_MODAL, ^/(.UI_WAIT_WINDOW | .UI_WAIT_TEXT | .UI_WAIT_BTN_A)/
Expand Down Expand Up @@ -152,7 +152,7 @@ describe("gbvmScriptChecksum", () => {
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "hello world"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_DISPLAY_TEXT
VM_OVERLAY_WAIT .UI_MODAL, ^/(.UI_WAIT_WINDOW | .UI_WAIT_TEXT | .UI_WAIT_BTN_A)/
Expand Down Expand Up @@ -188,7 +188,7 @@ describe("gbvmScriptChecksum", () => {
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "hello world"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_DISPLAY_TEXT
VM_OVERLAY_WAIT .UI_MODAL, ^/(.UI_WAIT_WINDOW | .UI_WAIT_TEXT | .UI_WAIT_BTN_A)/
Expand Down Expand Up @@ -233,7 +233,7 @@ describe("gbvmScriptChecksum", () => {
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "hello world"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_DISPLAY_TEXT
VM_OVERLAY_WAIT .UI_MODAL, ^/(.UI_WAIT_WINDOW | .UI_WAIT_TEXT | .UI_WAIT_BTN_A)/
Expand Down Expand Up @@ -269,7 +269,7 @@ describe("gbvmScriptChecksum", () => {
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "hello world!"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_DISPLAY_TEXT
VM_OVERLAY_WAIT .UI_MODAL, ^/(.UI_WAIT_WINDOW | .UI_WAIT_TEXT | .UI_WAIT_BTN_A)/
Expand Down
14 changes: 7 additions & 7 deletions test/data/compiler/scriptBuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ _MY_SCRIPT::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "Hello World"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
Expand Down Expand Up @@ -407,7 +407,7 @@ _MY_SCRIPT::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "Goodbye World"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
Expand All @@ -421,7 +421,7 @@ _MY_SCRIPT::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "Hello World"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
Expand Down Expand Up @@ -508,7 +508,7 @@ _MY_SCRIPT::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "0=FALSE 2=FALSE"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
Expand All @@ -522,7 +522,7 @@ _MY_SCRIPT::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "0=FALSE 2=TRUE"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
Expand All @@ -540,7 +540,7 @@ _MY_SCRIPT::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "0=TRUE 1=FALSE"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
Expand All @@ -554,7 +554,7 @@ _MY_SCRIPT::
; Text Dialogue
VM_LOAD_TEXT 0
.asciz "0=TRUE 1=TRUE"
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_CLEAR 0, 0, 20, 4, .UI_COLOR_WHITE, .UI_DRAW_FRAME
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 14, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
Expand Down

0 comments on commit 6ad4fba

Please sign in to comment.