generated from Raicuparta/ow-mod-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathExtensions.cs
238 lines (209 loc) · 8.94 KB
/
Extensions.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
using DiscordRPC.Logging;
using OWML.Common;
namespace OWRichPresence
{
public static class Extensions
{
public static string KeyToText(this ImageKey imageKey) => imageKey switch
{
// Vanilla
ImageKey.ashtwin => "Ash Twin",
ImageKey.attlerock => "Attlerock",
ImageKey.brittlehollow => "Brittle Hollow",
ImageKey.darkbramble => "Dark Bramble",
ImageKey.dreamworld => "Dreamworld",
ImageKey.embertwin => "Ember Twin",
ImageKey.eyeoftheuniverse => "Eye of the Universe",
ImageKey.giantsdeep => "Giant's Deep",
ImageKey.hollowslantern => "Hollow's Lantern",
ImageKey.interloper => "Interloper",
ImageKey.orbitalprobecannon => "Orbital Probe Cannon",
ImageKey.outerwilds => "Outer Wilds Ventures",
ImageKey.quantummoon => "Quantum Moon",
ImageKey.ship => "Ship",
ImageKey.skyshutter => "Sky Shutter Satellite",
ImageKey.stranger => "Stranger",
ImageKey.sun => "Sun",
ImageKey.sunstation => "Sun Station",
ImageKey.timberhearth => "Timber Hearth",
ImageKey.whitehole => "White Hole",
//Carson
ImageKey.carson => "Carson",
ImageKey.alpinia => "Alpinia",
ImageKey.dester => "Dester",
ImageKey.draeo => "Draeo",
ImageKey.ekbur => "Ekbur",
ImageKey.glaze => "Glaze",
ImageKey.graebur => "Graebur",
ImageKey.loon => "Loon",
ImageKey.mirtha => "Mirtha",
ImageKey.platinumhue => "Platinum Hue",
ImageKey.pyer => "Pyer",
ImageKey.scarletstorm => "Scarlet Storm",
ImageKey.urath => "Urath",
ImageKey.volcus => "Volcus",
//Astral Codec
ImageKey.lingeringchime => "Lingering Chime",
//New Horizons
ImageKey.newhorizons => "New Horizons",
ImageKey.defaultplanet => "Custom Planet",
ImageKey.defaultplanetatmosphere => "Custom Atmospheric Planet",
ImageKey.defaultstar => "Custom Star",
//New Horizons Examples
ImageKey.darkgateway => "Dark Gateway",
ImageKey.dauntingconfidant => "Daunting Confidant",
ImageKey.devilsmaw => "Devil's Maw",
ImageKey.frigidpygmy => "Frigid Pygmy",
ImageKey.giantsdeepexamples => "Giant's Deep",
ImageKey.lavatwin => "Lava Twin",
ImageKey.lavatwins => "Lava Twins",
ImageKey.lightgateway => "Light Gateway",
ImageKey.lunalure => "Luna Lure",
ImageKey.nightlight => "Night Light",
ImageKey.ringedjewel => "Ringed Jewel",
ImageKey.sequesteredluminary => "Sequestered Luminary",
ImageKey.snowball => "Snowball",
ImageKey.terralure => "Terra Lure",
ImageKey.wetrock => "Wetrock",
ImageKey.hinderingskies => "Hindering Skies",
ImageKey.lava1 => "Lava 1",
ImageKey.lava2 => "Lava 2",
//TRAPPIST-1
ImageKey.trappist1 => "TRAPPIST-1",
ImageKey.boilingfire => "Boiling Fire",
ImageKey.cloudyskies => "Cloudy Skies",
ImageKey.deepwaters => "Deep Waters",
ImageKey.everlastingsunset => "Everlasting Sunset",
ImageKey.frigidseas => "Frigid Seas",
ImageKey.glacialsteam => "Glacial Steam",
ImageKey.hollowice => "Hollow Ice",
//RSS
ImageKey.barnardsstar => "Barnard's Star",
ImageKey.barnardsstarb => "Barnard's Star B",
ImageKey.callisto => "Callisto",
ImageKey.ceres => "Ceres",
ImageKey.charon => "Charon",
ImageKey.deimos => "Deimos",
ImageKey.earth => "Earth",
ImageKey.europa => "Europa",
ImageKey.ganymede => "Ganymede",
ImageKey.halleyscomet => "Halley's Comet",
ImageKey.hydra => "Hydra",
ImageKey.io => "Io",
ImageKey.jupiter => "Jupiter",
ImageKey.kerberos => "Kerberos",
ImageKey.luhman16a => "Luhman 16A",
ImageKey.luhman16b => "Luhman 16B",
ImageKey.mars => "Mars",
ImageKey.mercury => "Mercury",
ImageKey.themoon => "The Moon",
ImageKey.neptune => "Neptune",
ImageKey.nix => "Nix",
ImageKey.perdition => "Perdition",
ImageKey.phobos => "Phobos",
ImageKey.pluto => "Pluto",
ImageKey.proteus => "Proteus",
ImageKey.proximab => "Proxima B",
ImageKey.proximac => "Proxima C",
ImageKey.proximacentauri => "Proxima Centauri",
ImageKey.puck => "Puck",
ImageKey.rigilkentaurus => "Rigil Kentaurus",
ImageKey.saturn => "Saturn",
ImageKey.sol => "Sol",
ImageKey.styx => "Styx",
ImageKey.titan => "Titan",
ImageKey.titania => "Titania",
ImageKey.toliman => "Toliman",
ImageKey.triton => "Triton",
ImageKey.uranus => "Uranus",
ImageKey.venus => "Venus",
ImageKey.vesta => "Vesta",
//Upsilon Andromedae
ImageKey.titawin => "Titawin",
ImageKey.upsilonandromedaeb => "Upsilon Andromedae B",
//Outsider
ImageKey.darkbrambleoutsider => "Dark Bramble",
ImageKey.powerstation => "Bramble Power Station",
//Hearth's Neighbor
ImageKey.neighborsun => "Neighbor Sun",
ImageKey.lonelyhermit => "Lonely Hermit",
ImageKey.alpinecore => "Alpine Core",
ImageKey.lakecore => "Lake Core",
ImageKey.lavacore => "Lava Core",
ImageKey.derelictship => "Derelict Ship",
//Tesseract's Secret
ImageKey.tesseract => "Tesseract",
//Evacuation
ImageKey.thecampground => "The Campground",
ImageKey.layeredlagoon => "Layered Lagoon",
ImageKey.smolderinggulch => "Smoldering Gulch",
ImageKey.twilightfrost => "Twilight Frost",
ImageKey.spark => "Spark",
ImageKey.datacorrupted => "DATA CORRUPTED",
//Unnamed Mystery
ImageKey.aetherion => "Aetherion",
ImageKey.zephyria => "Zephyria",
ImageKey.thalassia => "Thalassia",
ImageKey.ginth => "Ginth",
ImageKey.helioplasmia => "Helioraxia",
ImageKey.metallos => "Metallos",
ImageKey.electrum => "Electrum",
ImageKey.outerspacestation => "Outer Space Station",
ImageKey.ghostmoon => "Ghost Moon",
//Mod Jam 3
ImageKey.jam3sun => "Jam 3 Sun",
ImageKey.starshipcommunity => "Starship Community",
//Axiom's Refuge
ImageKey.axiom => "Axiom",
ImageKey.aicale => "Aicale",
//Callis's Thesis
ImageKey.theboiledegg => "The Boiled Egg",
//Echo Hike
ImageKey.echohike => "Echo Hike",
//Finis
ImageKey.finisplateau => "Finis Plateau",
//Granite's Invitation
ImageKey.gravelrock => "Gravelrock",
//Hearth's Neighbor 2: Magistarium
ImageKey.magistarium => "Magistarium",
//Mod Jam Hub
ImageKey.modjamhub => "Mod Jam Hub",
//Band Together
ImageKey.fracturedharmony => "Fractured Harmony",
//Solar Rangers
ImageKey.eggstar => "Egg Star",
//Reflections
ImageKey.forlornproject => "Forlorn Project",
//Symbiosis
ImageKey.symbiosis => "Symbiosis",
_ => string.Empty,
};
public static string ConvertToRealName(string id) => id switch
{
"DB_D_ENTRY" => "Entry Dimension",
"DB_D_FEEDGROUND" => "Feed Ground Dimension",
"DB_D_GOAL" => "Goal Dimension",
"DB_D_HOPPERTOWN" => "Hopper Town Dimension",
"DB_D_MININGSITE" => "Mining Site Dimension",
"DB_D_REDSEED" => "Red Seed Dimension",
"DB_D_WHITEHOLE" => "White Hole Dimension",
_ => id,
};
public static MessageType DiscordToOWML(this LogLevel level) => level switch
{
LogLevel.Trace => MessageType.Debug,
LogLevel.Info => MessageType.Info,
LogLevel.Warning => MessageType.Warning,
LogLevel.Error => MessageType.Error,
_ => MessageType.Message,
};
public static LogLevel OWMLToDiscord(this MessageType type) => type switch
{
MessageType.Debug => LogLevel.Trace,
MessageType.Info => LogLevel.Info,
MessageType.Warning => LogLevel.Warning,
MessageType.Error => LogLevel.Error,
_ => LogLevel.None,
};
}
}