Browse Source

Merge pull request #526 from lealeelu/hidefix

Fix portrait hide bug in Conversation Function
master
Chris Gregan 8 years ago committed by GitHub
parent
commit
52d84963df
  1. 29
      Assets/Fungus/Narrative/Scripts/ConversationManager.cs

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

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

Loading…
Cancel
Save