Skip to content

Commit

Permalink
Reset the Image Mapping last voice on Script Jump or Call
Browse files Browse the repository at this point in the history
  • Loading branch information
drojf committed Oct 14, 2024
1 parent d0d41d3 commit 5288607
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Assets.Scripts.Core.AssetManagement/AssetManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -748,5 +748,16 @@ public string[] GetAvailableScriptNames()
{
return scriptList.ToArray();
}

public void OnScriptJumpOrCall()
{
// Each time a jump occurs, or a script is called, reset the last voice (used for Image Mapping ),
// as the scanner for Image Mapping resets the last voice each time it enters a new script.
//
// The last voice based image mapping doesn't really take into account the script advancing non-linearly
// within the same script file - it just assumes each script file is executed from start to finish, then
// returns to "flow".
ImageMappingLastVoiceNoExt = null;
}
}
}
4 changes: 4 additions & 0 deletions Assets.Scripts.Core.Buriko/BurikoScriptSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public void JumpToBlock(string blockname)

public void JumpToScript(string scriptname, string blockname = "main")
{
AssetManager.Instance.OnScriptJumpOrCall();

Logger.Log((currentScript == null) ? $"Starting at script {scriptname} (block {blockname})" : $"Jumping from script {currentScript.Filename} to script {scriptname} (block {blockname})");
callStack.Clear();
scriptname = scriptname.ToLower();
Expand All @@ -95,6 +97,8 @@ public void JumpToScript(string scriptname, string blockname = "main")

public void CallScript(string scriptname, string blockname = "main")
{
AssetManager.Instance.OnScriptJumpOrCall();

if(scriptname == "flow")
{
FlowWasReached = true;
Expand Down

0 comments on commit 5288607

Please sign in to comment.