|
|
@ -30,13 +30,19 @@ namespace Fungus.Script |
|
|
|
protected enum GlyphType |
|
|
|
protected enum GlyphType |
|
|
|
{ |
|
|
|
{ |
|
|
|
Character, // Text character |
|
|
|
Character, // Text character |
|
|
|
|
|
|
|
BoldStart, // b |
|
|
|
|
|
|
|
BoldEnd, // /b |
|
|
|
|
|
|
|
ItalicStart, // i |
|
|
|
|
|
|
|
ItalicEnd, // /i |
|
|
|
|
|
|
|
ColorStart, // color=red |
|
|
|
|
|
|
|
ColorEnd, // /color |
|
|
|
Wait, // w, w=0.5 |
|
|
|
Wait, // w, w=0.5 |
|
|
|
WaitForInput, // i |
|
|
|
WaitForInputNoClear, // wi |
|
|
|
WaitForInputAndClear, // ic |
|
|
|
WaitForInputAndClear, // wc |
|
|
|
|
|
|
|
WaitOnPunctuation, // wp, wp=0.5 |
|
|
|
Clear, // c |
|
|
|
Clear, // c |
|
|
|
Speed, // s, s=60 |
|
|
|
Speed, // s, s=60 |
|
|
|
Exit, // x |
|
|
|
Exit // x |
|
|
|
Punctuation // p, p=0.5 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected class Glyph |
|
|
|
protected class Glyph |
|
|
@ -196,7 +202,7 @@ namespace Fungus.Script |
|
|
|
timeAccumulator = 0f; |
|
|
|
timeAccumulator = 0f; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case GlyphType.WaitForInput: |
|
|
|
case GlyphType.WaitForInputNoClear: |
|
|
|
OnWaitForInputTag(true); |
|
|
|
OnWaitForInputTag(true); |
|
|
|
yield return StartCoroutine(WaitForInput(null)); |
|
|
|
yield return StartCoroutine(WaitForInput(null)); |
|
|
|
OnWaitForInputTag(false); |
|
|
|
OnWaitForInputTag(false); |
|
|
@ -239,7 +245,7 @@ namespace Fungus.Script |
|
|
|
|
|
|
|
|
|
|
|
yield break; |
|
|
|
yield break; |
|
|
|
|
|
|
|
|
|
|
|
case GlyphType.Punctuation: |
|
|
|
case GlyphType.WaitOnPunctuation: |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -343,14 +349,23 @@ namespace Fungus.Script |
|
|
|
GlyphType type = GlyphType.Character; |
|
|
|
GlyphType type = GlyphType.Character; |
|
|
|
string paramText = ""; |
|
|
|
string paramText = ""; |
|
|
|
|
|
|
|
|
|
|
|
if (tag == "i") |
|
|
|
if (tag == "wi") |
|
|
|
{ |
|
|
|
{ |
|
|
|
type = GlyphType.WaitForInput; |
|
|
|
type = GlyphType.WaitForInputNoClear; |
|
|
|
} |
|
|
|
} |
|
|
|
if (tag == "ic") |
|
|
|
if (tag == "wc") |
|
|
|
{ |
|
|
|
{ |
|
|
|
type = GlyphType.WaitForInputAndClear; |
|
|
|
type = GlyphType.WaitForInputAndClear; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else if (tag.StartsWith("wp=")) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type = GlyphType.WaitOnPunctuation; |
|
|
|
|
|
|
|
paramText = tag.Substring(2, tag.Length - 2); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (tag == "wp") |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type = GlyphType.WaitOnPunctuation; |
|
|
|
|
|
|
|
} |
|
|
|
else if (tag.StartsWith("w=")) |
|
|
|
else if (tag.StartsWith("w=")) |
|
|
|
{ |
|
|
|
{ |
|
|
|
type = GlyphType.Wait; |
|
|
|
type = GlyphType.Wait; |
|
|
@ -377,19 +392,10 @@ namespace Fungus.Script |
|
|
|
{ |
|
|
|
{ |
|
|
|
type = GlyphType.Exit; |
|
|
|
type = GlyphType.Exit; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (tag.StartsWith("p=")) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type = GlyphType.Punctuation; |
|
|
|
|
|
|
|
paramText = tag.Substring(2, tag.Length - 2); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (tag == "p") |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type = GlyphType.Punctuation; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Glyph glyph = new Glyph(); |
|
|
|
Glyph glyph = new Glyph(); |
|
|
|
glyph.type = type; |
|
|
|
glyph.type = type; |
|
|
|
glyph.param = paramText; |
|
|
|
glyph.param = paramText.Trim(); |
|
|
|
|
|
|
|
|
|
|
|
return glyph; |
|
|
|
return glyph; |
|
|
|
} |
|
|
|
} |
|
|
|