Skip to content

Commit

Permalink
Fix FADE2 message code handling
Browse files Browse the repository at this point in the history
I should have tested it before...
  • Loading branch information
xoascf committed Dec 19, 2023
1 parent d816c4d commit 6a68686
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions OTRMod/ID/Text.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,19 @@ public static string EvalCodes(string input) {
else if ((m = Regex.Match(s, @"^HIGHSCORE\((?<hs>\w+)\)")).Success)
sb.Append($"{(char)Code.HIGHSCORE}" +
$"{C<Highscore>(m.Groups["hs"].Value)}");
else if (s.StartsWith(cn = "ITEM_ICON") || s.StartsWith(cn = "SHIFT") ||
s.StartsWith(cn = "FADE") || s.StartsWith(cn = "TEXT_SPEED") ||
s.StartsWith(cn = "BOX_BREAK_DELAYED")) {
m = Regex.Match(s, @$"^{cn}\(\""{hex}\""\)");
sb.Append($"{C<Code>(cn)}{C(m.Groups[1].Value)}");
}
else if (s.StartsWith(cn = "TEXTID") || s.StartsWith(cn = "SFX") ||
s.StartsWith(cn = "FADE2")) { // FADE2 is used in STAFF
m = Regex.Match(s, @$"^{cn}\(\""{hex}{hex}\""\)");
sb.Append($"{C<Code>(cn)}" +
$"{C(m.Groups[1].Value)}" +
$"{C(m.Groups[2].Value)}");
}
else if (s.StartsWith(cn = "ITEM_ICON") || s.StartsWith(cn = "SHIFT") ||
s.StartsWith(cn = "FADE") || s.StartsWith(cn = "TEXT_SPEED") ||
s.StartsWith(cn = "BOX_BREAK_DELAYED")) {
m = Regex.Match(s, @$"^{cn}\(\""{hex}\""\)");
sb.Append($"{C<Code>(cn)}{C(m.Groups[1].Value)}");
}
else if (s.StartsWith(cn = "BACKGROUND")) {
m = Regex.Match(s,
@$"^{cn}\(\""{hex}\""\s*,\s*\""{hex}\""\s*,\s*\""{hex}\""\)");
Expand Down

0 comments on commit 6a68686

Please sign in to comment.