2019-09-05 20:28:05 +02:00
|
|
|
using System;
|
2019-08-24 00:07:54 +02:00
|
|
|
using Microsoft.Xna.Framework;
|
2019-09-05 20:28:05 +02:00
|
|
|
using MLEM.Textures;
|
2019-08-24 00:07:54 +02:00
|
|
|
|
|
|
|
namespace MLEM.Ui.Format {
|
|
|
|
public class FormattingCode {
|
|
|
|
|
2019-09-05 20:28:05 +02:00
|
|
|
public readonly Type CodeType;
|
2019-08-24 00:07:54 +02:00
|
|
|
public readonly Color Color;
|
|
|
|
public readonly TextStyle Style;
|
2019-09-05 20:28:05 +02:00
|
|
|
public readonly TextureRegion Icon;
|
2019-08-24 00:07:54 +02:00
|
|
|
|
|
|
|
public FormattingCode(Color color) {
|
|
|
|
this.Color = color;
|
2019-09-05 20:28:05 +02:00
|
|
|
this.CodeType = Type.Color;
|
2019-08-24 00:07:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public FormattingCode(TextStyle style) {
|
|
|
|
this.Style = style;
|
2019-09-05 20:28:05 +02:00
|
|
|
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
|
|
|
|
|
2019-08-24 00:07:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public enum TextStyle {
|
|
|
|
|
|
|
|
Regular,
|
|
|
|
Bold,
|
|
|
|
Italic
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|