Skip to content

Commit

Permalink
[Fix] [next] command not working on generic text objects
Browse files Browse the repository at this point in the history
  • Loading branch information
RhenaudTheLukark committed Feb 16, 2024
1 parent b7d9c07 commit f2cc3ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Assets/Scripts/Battle/UIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ public void DoNextMonsterDialogue(bool singleLineAll = false, int index = -1) {
}

// Part that autoskips text if [nextthisnow] or [finished] is introduced
if (sbTextMan.CanAutoSkipThis() || sbTextMan.CanAutoSkip() || readyToNextLine[encounter.enemies.IndexOf(monsterDialogueEnemy[i])]) {
if (sbTextMan.CanAutoSkipAny() || readyToNextLine[encounter.enemies.IndexOf(monsterDialogueEnemy[i])]) {
if (sbTextMan.HasNext()) {
sbTextMan.NextLineText();
enemy.UpdateBubble(i);
Expand Down Expand Up @@ -1400,7 +1400,7 @@ private void Update() {
mainTextManager.SetPause(false);

if (state == "DIALOGRESULT")
if (mainTextManager.CanAutoSkipAll() || (mainTextManager.CanAutoSkipThis() && mainTextManager.LineComplete()))
if (mainTextManager.CanAutoSkipAll() || mainTextManager.CanAutoSkip() || (mainTextManager.CanAutoSkipThis() && mainTextManager.LineComplete()))
if (mainTextManager.HasNext())
mainTextManager.NextLineText();
else
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Lua/CLRBindings/LuaTextManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ protected override void Update() {
break;
}
}
if ((CanAutoSkipAll() || CanAutoSkipThis()) && (!UIController.instance || !UIController.instance.monsterDialogues.Contains(this)))
if (CanAutoSkipAny() && (!UIController.instance || !UIController.instance.monsterDialogues.Contains(this)))
NextLine();
if (CanSkip() && !LineComplete() && GlobalControls.input.Cancel == ButtonState.PRESSED)
DoSkipFromPlayer();
Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/Text/TextManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ [MoonSharpHidden] public void AddToTextQueue(TextMessage[] textQueueToAdd) {
[MoonSharpHidden] public bool CanAutoSkip() { return autoSkip; }
[MoonSharpHidden] public bool CanAutoSkipThis() { return autoSkipThis; }
[MoonSharpHidden] public bool CanAutoSkipAll() { return autoSkipAll; }
[MoonSharpHidden] public bool CanAutoSkipAny() { return CanAutoSkip() || CanAutoSkipThis() || CanAutoSkipAll(); }

public int LineCount() {
return textQueue == null ? 0 : textQueue.Length;
Expand Down

0 comments on commit f2cc3ae

Please sign in to comment.