mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-17 11:13:13 +01:00
49 lines
No EOL
1,017 B
C#
49 lines
No EOL
1,017 B
C#
using System;
|
|
using Microsoft.Xna.Framework;
|
|
using MLEM.Textures;
|
|
|
|
namespace MLEM.Ui.Format {
|
|
public class FormattingCode {
|
|
|
|
public readonly Type CodeType;
|
|
public readonly Color Color;
|
|
public readonly TextStyle Style;
|
|
public readonly TextureRegion Icon;
|
|
|
|
public FormattingCode(Color color) {
|
|
this.Color = color;
|
|
this.CodeType = Type.Color;
|
|
}
|
|
|
|
public FormattingCode(TextStyle style) {
|
|
this.Style = style;
|
|
this.CodeType = Type.Style;
|
|
}
|
|
|
|
public FormattingCode(TextureRegion icon) {
|
|
this.Icon = icon;
|
|
this.CodeType = Type.Icon;
|
|
}
|
|
|
|
public string GetReplacementString() {
|
|
return this.CodeType == Type.Icon ? TextFormatting.OneEmString : string.Empty;
|
|
}
|
|
|
|
public enum Type {
|
|
|
|
Color,
|
|
Style,
|
|
Icon
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public enum TextStyle {
|
|
|
|
Regular,
|
|
Bold,
|
|
Italic
|
|
|
|
}
|
|
} |