forked from decaprime/VampireCommandFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFormat.cs
25 lines (17 loc) · 1.15 KB
/
Format.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
namespace VampireCommandFramework;
public static class Format
{
public enum FormatMode { GameChat, None };
public static FormatMode Mode { get; set; } = FormatMode.GameChat;
public static string B(string input) => Bold(input);
public static string Bold(this string input) => Mode == FormatMode.GameChat ? $"<b>{input}</b>" : input;
public static string I(string input) => Italic(input);
public static string Italic(this string input) => Mode == FormatMode.GameChat ? $"<i>{input}</i>" : input;
public static string Underline(this string input) => Mode == FormatMode.GameChat ? $"<u>{input}</u>" : input;
public static string Color(this string input, string color) => Mode == FormatMode.GameChat ? $"<color={color}>{input}</color>" : input;
public static string Size(this string input, int size) => Mode == FormatMode.GameChat ? $"<size={size}>{input}</size>" : input;
public static string Small(this string input) => Size(input, 10);
public static string Normal(this string input) => Size(input, 16); // how to reset
public static string Medium(this string input) => Size(input, 20);
public static string Large(this string input) => Size(input, 24);
}