forked from fattard/FlagsEditorEXPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FlagsOrganizer_Helpers.cs
52 lines (49 loc) · 2.77 KB
/
FlagsOrganizer_Helpers.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
namespace FlagsEditorEXPlugin
{
static class EventFlagTypeExtensions
{
public static FlagsOrganizer.EventFlagType Parse(this FlagsOrganizer.EventFlagType _, string txt) => txt switch
{
"FIELD ITEM" => FlagsOrganizer.EventFlagType.FieldItem,
"HIDDEN ITEM" => FlagsOrganizer.EventFlagType.HiddenItem,
"SPECIAL ITEM" => FlagsOrganizer.EventFlagType.SpecialItem,
"TRAINER BATTLE" => FlagsOrganizer.EventFlagType.TrainerBattle,
"STATIC ENCOUNTER" => FlagsOrganizer.EventFlagType.StaticEncounter,
"IN-GAME TRADE" => FlagsOrganizer.EventFlagType.InGameTrade,
"ITEM GIFT" => FlagsOrganizer.EventFlagType.ItemGift,
"PKMN GIFT" => FlagsOrganizer.EventFlagType.PkmnGift,
"EVENT" => FlagsOrganizer.EventFlagType.GeneralEvent,
"SIDE EVENT" => FlagsOrganizer.EventFlagType.SideEvent,
"STORY EVENT" => FlagsOrganizer.EventFlagType.StoryEvent,
"BERRY TREE" => FlagsOrganizer.EventFlagType.BerryTree,
"FLY SPOT" => FlagsOrganizer.EventFlagType.FlySpot,
"COLLECTABLE" => FlagsOrganizer.EventFlagType.Collectable,
"_UNUSED" => FlagsOrganizer.EventFlagType._Unused,
"_SEPARATOR" => FlagsOrganizer.EventFlagType._Separator,
_ => FlagsOrganizer.EventFlagType._Unknown,
};
public static string AsText(this FlagsOrganizer.EventFlagType flagType) => flagType switch
{
FlagsOrganizer.EventFlagType.FieldItem => "FIELD ITEM",
FlagsOrganizer.EventFlagType.HiddenItem => "HIDDEN ITEM",
FlagsOrganizer.EventFlagType.SpecialItem => "SPECIAL ITEM",
FlagsOrganizer.EventFlagType.TrainerBattle => "TRAINER BATTLE",
FlagsOrganizer.EventFlagType.StaticEncounter => "STATIC ENCOUNTER",
FlagsOrganizer.EventFlagType.InGameTrade => "IN-GAME TRADE",
FlagsOrganizer.EventFlagType.ItemGift => "ITEM GIFT",
FlagsOrganizer.EventFlagType.PkmnGift => "PKMN GIFT",
FlagsOrganizer.EventFlagType.GeneralEvent => "EVENT",
FlagsOrganizer.EventFlagType.SideEvent => "SIDE EVENT",
FlagsOrganizer.EventFlagType.StoryEvent => "STORY EVENT",
FlagsOrganizer.EventFlagType.BerryTree => "BERRY TREE",
FlagsOrganizer.EventFlagType.FlySpot => "FLY SPOT",
FlagsOrganizer.EventFlagType.Collectable => "COLLECTABLE",
FlagsOrganizer.EventFlagType._Unused => "_UNUSED",
_ => "",
};
public static string AsLocalizedText(this FlagsOrganizer.EventFlagType flagType)
{
return LocalizedStrings.Find($"EventFlagType.{flagType}", flagType.ToString());
}
}
}