Browse Source

Don't pause at end of sentence or if next glyph is a pause

master
chrisgregan 10 years ago
parent
commit
c061bc05bd
  1. 20
      Assets/Fungus/Dialog/Scripts/Dialog.cs

20
Assets/Fungus/Dialog/Scripts/Dialog.cs

@ -223,8 +223,24 @@ namespace Fungus.Script
}
// Add a wait glyph on punctuation marks
if (punctuationPause > 0 &&
IsPunctuation(glyph.param))
bool doPause = punctuationPause > 0 && IsPunctuation(glyph.param);
if (i == glyphs.Count - 1)
{
doPause = false; // No pause on last character
}
else
{
// No pause if next glyph is a pause
GlyphType nextType = glyphs[i + 1].type;
if (nextType == GlyphType.Wait ||
nextType == GlyphType.WaitForInputAndClear ||
nextType == GlyphType.WaitForInputNoClear)
{
doPause = false;
}
}
if (doPause)
{
// Ignore if next glyph is also punctuation, or if punctuation is the last character.
bool skipCharacter = (i < glyphs.Count - 1 &&

Loading…
Cancel
Save