From 8229ce8517fb4aa587466118d123935f9746e8d6 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 15 May 2020 19:56:16 +0200 Subject: [PATCH] maybe actually commit everything! --- MLEM/Formatting/Codes/AnimatedCode.cs | 2 +- MLEM/Formatting/Codes/ShadowCode.cs | 2 +- MLEM/Formatting/Codes/WobblyCode.cs | 2 +- MLEM/Formatting/Token.cs | 8 +++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/MLEM/Formatting/Codes/AnimatedCode.cs b/MLEM/Formatting/Codes/AnimatedCode.cs index 9e5eba4..de4dd56 100644 --- a/MLEM/Formatting/Codes/AnimatedCode.cs +++ b/MLEM/Formatting/Codes/AnimatedCode.cs @@ -3,7 +3,7 @@ using System.Text.RegularExpressions; namespace MLEM.Formatting.Codes { public class AnimatedCode : Code { - public AnimatedCode(Match match) : base(match) { + public AnimatedCode(Match match, Regex regex) : base(match, regex) { } public override bool EndsHere(Code other) { diff --git a/MLEM/Formatting/Codes/ShadowCode.cs b/MLEM/Formatting/Codes/ShadowCode.cs index e8eee17..53077ab 100644 --- a/MLEM/Formatting/Codes/ShadowCode.cs +++ b/MLEM/Formatting/Codes/ShadowCode.cs @@ -10,7 +10,7 @@ namespace MLEM.Formatting.Codes { private readonly Color color; private readonly Vector2 offset; - public ShadowCode(Match match, Color color, Vector2 offset) : base(match, null) { + public ShadowCode(Match match, Regex regex, Color color, Vector2 offset) : base(match, regex, null) { this.color = color; this.offset = offset; } diff --git a/MLEM/Formatting/Codes/WobblyCode.cs b/MLEM/Formatting/Codes/WobblyCode.cs index c20c64d..c016099 100644 --- a/MLEM/Formatting/Codes/WobblyCode.cs +++ b/MLEM/Formatting/Codes/WobblyCode.cs @@ -11,7 +11,7 @@ namespace MLEM.Formatting.Codes { private readonly float heightModifier; public TimeSpan TimeIntoAnimation; - public WobblyCode(Match match, float modifier, float heightModifier) : base(match) { + public WobblyCode(Match match, Regex regex, float modifier, float heightModifier) : base(match, regex) { this.modifier = modifier; this.heightModifier = heightModifier; } diff --git a/MLEM/Formatting/Token.cs b/MLEM/Formatting/Token.cs index 78d4a1b..2923045 100644 --- a/MLEM/Formatting/Token.cs +++ b/MLEM/Formatting/Token.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; @@ -21,7 +22,7 @@ namespace MLEM.Formatting { this.RawIndex = rawIndex; this.Substring = substring; this.RawSubstring = rawSubstring; - + foreach (var code in appliedCodes) code.Token = this; } @@ -34,6 +35,11 @@ namespace MLEM.Formatting { return this.AppliedCodes.Select(c => c.GetFont()).FirstOrDefault(); } + public void DrawSelf(GameTime time, SpriteBatch batch, Vector2 pos, GenericFont font, Color color, float scale, float depth) { + foreach (var code in this.AppliedCodes) + code.DrawSelf(time, batch, pos, font, color, scale, depth); + } + public void DrawCharacter(GameTime time, SpriteBatch batch, char c, string cString, int indexInToken, Vector2 pos, GenericFont font, Color color, float scale, float depth) { foreach (var code in this.AppliedCodes) { if (code.DrawCharacter(time, batch, c, cString, indexInToken, ref pos, font, ref color, ref scale, depth))