Failing test case for intercut nameOnRight

This commit is contained in:
2023-03-08 10:11:11 -07:00
parent a1d5647446
commit 766caad67f
3 changed files with 22 additions and 3 deletions

View File

@@ -106,9 +106,9 @@
(var DIALOG_COLOR FlxColor.WHITE)
(var DIALOG_SIZE 24)
(var &mut :FlxSprite dialogBox)
(var &mut :FlxText dialogText)
(var &mut :FlxText speakerNameText)
(prop &mut :FlxSprite dialogBox)
(prop &mut :FlxText dialogText)
(prop &mut :FlxText speakerNameText)
(method showDialog [:String speakerName :SpeechType<ActorFlxSprite> type :String wryly :String text :Continuation cc]
// TODO handle text messages, wrylies, off-screen, from-phone, etc. via (case type)

View File

@@ -61,6 +61,8 @@
(set buttonY 0)))
(FlxG.state.add buttons)))
(defAlias &ident flxDirector (cast director FlxDirector))
(preload
// These are set here so they're defined after FlxG.width and height have been set:
(set STAGE_LEFT_X 150.0)

View File

@@ -48,4 +48,21 @@ ADDCHARACTER "black" Right FacingLeft
(withActor "white" actorLeft
(assert (> actorRight.x actorLeft.x))))
// Speaker name not being bumped to right side for stage-right actors while intercutting:
(preload
(newFlxSet "intercutSet" AssetPaths.whiteBackground1280x720__png)
(newSceneFromSet "intercutScene" "intercutSet"))
SETSCENE "intercutScene"
ADDCHARACTER "black" right FacingLeft
INTERCUT [=>"white" basicSceneKey "black" "intercutScene"]
(prop &mut speakerNameTextLeftX 0.0)
{(delay 0.01 ->:Void (set speakerNameTextLeftX flxDirector.speakerNameText.x))(cc)}
NORMALSPEECH "white" "" "Testing line one"
{(delay 0.01 ->:Void {(assert (> flxDirector.speakerNameText.x speakerNameTextLeftX))})(cc)}
NORMALSPEECH "black" "" "Testing line two"
ENDINTERCUT
(Sys.exit 0)