1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-05-29 03:23:37 +02:00

maybe actually commit everything!

This commit is contained in:
Ellpeck 2020-05-15 19:56:16 +02:00
parent fcd898e16b
commit 8229ce8517
4 changed files with 10 additions and 4 deletions

View file

@ -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) {

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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))