-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathUtility.cs
88 lines (82 loc) · 3.34 KB
/
Utility.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using Harmony;
using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
namespace ScoreOverlay
{
public static class Utility
{
public static string modsPath = Application.dataPath + "/../Mods/";
public static string overlayPath = modsPath + "scoreoverlay.overlay";
/// <summary>
/// Removes all RTF tags from input strung.
/// </summary>
public static string RemoveFormatting(string input)
{
System.Text.RegularExpressions.Regex rx = new System.Text.RegularExpressions.Regex("<[^>]*>");
return rx.Replace(input, "");
}
/// <summary>
/// Returns abbreviations of currently selected modifiers.
/// </summary>
public static string GetModText()
{
var modifiers = GameplayModifiers.I;
if (modifiers != null)
{
var mods = modifiers.GetCurrentModifiers();
List<string> modStrings = new List<string>();
for (int i = 0; i < mods.Length; i++)
{
switch (mods[i])
{
case GameplayModifiers.Modifier.FastTargets:
modStrings.Add("FT");
break;
case GameplayModifiers.Modifier.TempoIncrement:
modStrings.Add("TI");
break;
case GameplayModifiers.Modifier.MirrorMode:
modStrings.Add("MM");
break;
case GameplayModifiers.Modifier.WrongHands:
modStrings.Add("WH");
break;
case GameplayModifiers.Modifier.ReducedAimAssist:
modStrings.Add("50% AA");
break;
case GameplayModifiers.Modifier.Psychedelia:
modStrings.Add("Rainbow");
break;
case GameplayModifiers.Modifier.MoreParticles:
modStrings.Add("EP");
break;
case GameplayModifiers.Modifier.InvisibleGuns:
modStrings.Add("IG");
break;
case GameplayModifiers.Modifier.NoTelegraphs:
modStrings.Add("NT");
break;
case GameplayModifiers.Modifier.SpeedWobble:
modStrings.Add("SW");
break;
case GameplayModifiers.Modifier.NoLook:
modStrings.Add("NL");
break;
case GameplayModifiers.Modifier.MaxMovement:
modStrings.Add("MaxMovement");
break;
case GameplayModifiers.Modifier.MinMovement:
modStrings.Add("MinMovement");
break;
default:
break;
}
}
return string.Join(" + ", modStrings);
}
else return "";
}
}
}