Browse Source

Fix portrait hide bug in Conversation Function

master
lealeelu 8 years ago committed by lealeelu
parent
commit
26e33808ec
  1. 33
      Assets/Fungus/Narrative/Scripts/ConversationManager.cs

33
Assets/Fungus/Narrative/Scripts/ConversationManager.cs

@ -75,13 +75,7 @@ namespace Fungus
for (int i = 0; i < conversationItems.Count; ++i) for (int i = 0; i < conversationItems.Count; ++i)
{ {
ConversationItem item = conversationItems[i]; ConversationItem item = conversationItems[i];
// Ignore Lua style comments and blank lines
if (item.Text.StartsWith("--") || item.Text.Trim() == "")
{
continue;
}
if (item.Character != null) if (item.Character != null)
{ {
currentCharacter = item.Character; currentCharacter = item.Character;
@ -143,17 +137,19 @@ namespace Fungus
} }
previousCharacter = currentCharacter; previousCharacter = currentCharacter;
exitSayWait = false; if (!string.IsNullOrEmpty(item.Text)) {
sayDialog.Say(item.Text, true, true, true, false, null, () => { exitSayWait = false;
exitSayWait = true; sayDialog.Say(item.Text, true, true, true, false, null, () => {
}); exitSayWait = true;
});
while (!exitSayWait) while (!exitSayWait)
{ {
yield return null; yield return null;
}
exitSayWait = false;
} }
exitSayWait = false;
} }
} }
@ -173,8 +169,9 @@ namespace Fungus
string sayParams = sayMatches[i].Groups["sayParams"].Value; string sayParams = sayMatches[i].Groups["sayParams"].Value;
// As text and SayParams are both optional, an empty string will match the regex. // As text and SayParams are both optional, an empty string will match the regex.
// We can ignore any matches were both are empty. // We can ignore any matches where both are empty
if (text.Length == 0 && sayParams.Length == 0) // or if they're Lua style comments
if ((text.Length == 0 && sayParams.Length == 0) || text.StartsWith("--"))
{ {
continue; continue;
} }

Loading…
Cancel
Save