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. 13
      Assets/Fungus/Narrative/Scripts/ConversationManager.cs

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

@ -76,12 +76,6 @@ namespace Fungus
{ {
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;
@ -144,6 +138,7 @@ namespace Fungus
previousCharacter = currentCharacter; previousCharacter = currentCharacter;
if (!string.IsNullOrEmpty(item.Text)) {
exitSayWait = false; exitSayWait = false;
sayDialog.Say(item.Text, true, true, true, false, null, () => { sayDialog.Say(item.Text, true, true, true, false, null, () => {
exitSayWait = true; exitSayWait = true;
@ -156,6 +151,7 @@ namespace Fungus
exitSayWait = false; exitSayWait = false;
} }
} }
}
protected virtual List<ConversationItem> Parse(string conv) protected virtual List<ConversationItem> Parse(string conv)
{ {
@ -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