commonlibsse_ng\re\f/
FormTypes.rs

1#[commonlibsse_ng_derive_internal::ffi_enum]
2#[repr(u8)]
3#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
4pub enum FormType {
5    None = 0,                   // 0x00 NONE TESForm
6    PluginInfo,                 // 0x01 TES4
7    FormGroup,                  // 0x02 GRUP
8    GameSetting,                // 0x03 GMST
9    Keyword,                    // 0x04 KYWD	BGSKeyword
10    LocationRefType,            // 0x05 LCRT	BGSLocationRefType
11    Action,                     // 0x06 AACT	BGSAction
12    TextureSet,                 // 0x07 TXST	BGSTextureSet
13    MenuIcon,                   // 0x08 MICN	BGSMenuIcon
14    Global,                     // 0x09 GLOB	TESGlobal
15    Class,                      // 0x0A CLAS	TESClass
16    Faction,                    // 0x0B FACT	TESFaction
17    HeadPart,                   // 0x0C HDPT	BGSHeadPart
18    Eyes,                       // 0x0D EYES	TESEyes
19    Race,                       // 0x0E RACE	TESRace
20    Sound,                      // 0x0F SOUN	TESSound
21    AcousticSpace,              // 0x10 ASPC	BGSAcousticSpace
22    Skill,                      // 0x11 SKIL
23    MagicEffect,                // 0x12 MGEF	EffectSetting
24    Script,                     // 0x13 SCPT	Script
25    LandTexture,                // 0x14 LTEX	TESLandTexture
26    Enchantment,                // 0x15 ENCH	EnchantmentItem
27    Spell,                      // 0x16 SPEL	SpellItem
28    Scroll,                     // 0x17 SCRL	ScrollItem
29    Activator,                  // 0x18 ACTI	TESObjectACTI
30    TalkingActivator,           // 0x19 TACT	BGSTalkingActivator
31    Armor,                      // 0x1A ARMO	TESObjectARMO
32    Book,                       // 0x1B BOOK	TESObjectBOOK
33    Container,                  // 0x1C CONT	TESObjectCONT
34    Door,                       // 0x1D DOOR	TESObjectDOOR
35    Ingredient,                 // 0x1E INGR	IngredientItem
36    Light,                      // 0x1F LIGH	TESObjectLIGH
37    Misc,                       // 0x20 MISC TESObjectMISC
38    Apparatus,                  // 0x21 APPA	BGSApparatus
39    Static,                     // 0x22 STAT	TESObjectSTAT
40    StaticCollection,           // 0x23 SCOL BGSStaticCollection
41    MovableStatic,              // 0x24 MSTT	BGSMovableStatic
42    Grass,                      // 0x25 GRAS	TESGrass
43    Tree,                       // 0x26 TREE	TESObjectTREE
44    Flora,                      // 0x27 FLOR	TESFlora
45    Furniture,                  // 0x28 FURN	TESFurniture
46    Weapon,                     // 0x29 WEAP	TESObjectWEAP
47    Ammo,                       // 0x2A AMMO	TESAmmo
48    NPC,                        // 0x2B NPC_	TESNPC
49    LeveledNPC,                 // 0x2C LVLN	TESLevCharacter
50    KeyMaster,                  // 0x2D KEYM	TESKey
51    AlchemyItem,                // 0x2E ALCH	AlchemyItem
52    IdleMarker,                 // 0x2F IDLM	BGSIdleMarker
53    Note,                       // 0x30 NOTE	BGSNote
54    ConstructibleObject,        // 0x31 COBJ	BGSConstructibleObject
55    Projectile,                 // 0x32 PROJ	BGSProjectile
56    Hazard,                     // 0x33 HAZD	BGSHazard
57    SoulGem,                    // 0x34 SLGM	TESSoulGem
58    LeveledItem,                // 0x35 LVLI	TESLevItem
59    Weather,                    // 0x36 WTHR	TESWeather
60    Climate,                    // 0x37 CLMT	TESClimate
61    ShaderParticleGeometryData, // 0x38 SPGD	BGSShaderParticleGeometryData
62    ReferenceEffect,            // 0x39 RFCT	BGSReferenceEffect
63    Region,                     // 0x3A REGN	TESRegion
64    Navigation,                 // 0x3B NAVI	NavMeshInfoMap
65    Cell,                       // 0x3C CELL	TESObjectCELL
66    Reference,                  // 0x3D REFR	TESObjectREFR
67    ActorCharacter,             // 0x3E ACHR	Actor / Character / PlayerCharacter
68    ProjectileMissile,          // 0x3F PMIS	MissileProjectile
69    ProjectileArrow,            // 0x40 PARW	ArrowProjectile
70    ProjectileGrenade,          // 0x41 PGRE	GrenadeProjectile
71    ProjectileBeam,             // 0x42 PBEA	BeamProjectile
72    ProjectileFlame,            // 0x43 PFLA	FlameProjectile
73    ProjectileCone,             // 0x44 PCON	ConeProjectile
74    ProjectileBarrier,          // 0x45 PBAR	BarrierProjectile
75    PlacedHazard,               // 0x46 PHZD	Hazard
76    WorldSpace,                 // 0x47 WRLD	TESWorldSpace
77    Land,                       // 0x48 LAND	TESObjectLAND
78    NavMesh,                    // 0x49 NAVM	NavMesh
79    TLOD,                       // 0x4A TLOD
80    Dialogue,                   // 0x4B DIAL	TESTopic
81    Info,                       // 0x4C INFO	TESTopicInfo
82    Quest,                      // 0x4D QUST	TESQuest
83    Idle,                       // 0x4E IDLE	TESIdleForm
84    Package,                    // 0x4F PACK	TESPackage / DialoguePackage
85    CombatStyle,                // 0x50 CSTY	TESCombatStyle
86    LoadScreen,                 // 0x51 LSCR	TESLoadScreen
87    LeveledSpell,               // 0x52 LVSP	TESLevSpell
88    AnimatedObject,             // 0x53 ANIO	TESObjectANIO
89    Water,                      // 0x54 WATR	TESWaterForm
90    EffectShader,               // 0x55 EFSH	TESEffectShader
91    TOFT,                       // 0x56 TOFT
92    Explosion,                  // 0x57 EXPL	BGSExplosion
93    Debris,                     // 0x58 DEBR	BGSDebris
94    ImageSpace,                 // 0x59 IMGS	TESImageSpace
95    ImageAdapter,               // 0x5A IMAD	TESImageSpaceModifier
96    FormList,                   // 0x5B FLST	BGSListForm
97    Perk,                       // 0x5C PERK	BGSPerk
98    BodyPartData,               // 0x5D BPTD	BGSBodyPartData
99    AddonNode,                  // 0x5E ADDN	BGSAddonNode
100    ActorValueInfo,             // 0x5F AVIF	ActorValueInfo
101    CameraShot,                 // 0x60 CAMS	BGSCameraShot
102    CameraPath,                 // 0x61 CPTH	BGSCameraPath
103    VoiceType,                  // 0x62 VTYP	BGSVoiceType
104    MaterialType,               // 0x63 MATT	BGSMaterialType
105    Impact,                     // 0x64 IPCT	BGSImpactData
106    ImpactDataSet,              // 0x65 IPDS	BGSImpactDataSet
107    Armature,                   // 0x66 ARMA	TESObjectARMA
108    EncounterZone,              // 0x67 ECZN	BGSEncounterZone
109    Location,                   // 0x68 LCTN	BGSLocation
110    Message,                    // 0x69 MESG	BGSMessage
111    Ragdoll,                    // 0x6A RGDL	BGSRagdoll
112    DefaultObject,              // 0x6B DOBJ BGSDefaultObjectManager
113    LightingMaster,             // 0x6C LGTM	BGSLightingTemplate
114    MusicType,                  // 0x6D MUSC	BGSMusicType
115    Footstep,                   // 0x6E FSTP	BGSFootstep
116    FootstepSet,                // 0x6F FSTS	BGSFootstepSet
117    StoryManagerBranchNode,     // 0x70 SMBN	BGSStoryManagerBranchNode
118    StoryManagerQuestNode,      // 0x71 SMQN	BGSStoryManagerQuestNode
119    StoryManagerEventNode,      // 0x72 SMEN	BGSStoryManagerEventNode
120    DialogueBranch,             // 0x73 DLBR	BGSDialogueBranch
121    MusicTrack,                 // 0x74 MUST	BGSMusicTrackFormWrapper
122    DialogueView,               // 0x75 DLVW
123    WordOfPower,                // 0x76 WOOP	TESWordOfPower
124    Shout,                      // 0x77 SHOU	TESShout
125    EquipSlot,                  // 0x78 EQUP	BGSEquipSlot
126    Relationship,               // 0x79 RELA	BGSRelationship
127    Scene,                      // 0x7A SCEN	BGSScene
128    AssociationType,            // 0x7B ASTP	BGSAssociationType
129    Outfit,                     // 0x7C OTFT	BGSOutfit
130    ArtObject,                  // 0x7D ARTO	BGSArtObject
131    MaterialObject,             // 0x7E MATO	BGSMaterialObject
132    MovementType,               // 0x7F MOVT	BGSMovementType
133    SoundRecord,                // 0x80 SNDR	BGSSoundDescriptorForm
134    DualCastData,               // 0x81 DUAL	BGSDualCastData
135    SoundCategory,              // 0x82 SNCT	BGSSoundCategory
136    SoundOutputModel,           // 0x83 SOPM	BGSSoundOutput
137    CollisionLayer,             // 0x84 COLL	BGSCollisionLayer
138    ColorForm,                  // 0x85 CLFM	BGSColorForm
139    ReverbParam,                // 0x86 REVB	BGSReverbParameters
140    LensFlare,                  // 0x87 LENS BGSLensFlare
141    LensSprite,                 // 0x88 LSPR
142    VolumetricLighting,         // 0x89 VOLI BGSVolumetricLighting
143
144    Max, //	0x8A
145}
146
147impl FormType {
148    pub const fn as_str(&self) -> &'static str {
149        match self {
150            Self::PluginInfo => "TES4",
151            Self::FormGroup => "GRUP",
152            Self::GameSetting => "GMST",
153            Self::Keyword => "KYWD",
154            Self::LocationRefType => "LCRT",
155            Self::Action => "AACT",
156            Self::TextureSet => "TXST",
157            Self::MenuIcon => "MICN",
158            Self::Global => "GLOB",
159            Self::Class => "CLAS",
160            Self::Faction => "FACT",
161            Self::HeadPart => "HDPT",
162            Self::Eyes => "EYES",
163            Self::Race => "RACE",
164            Self::Sound => "SOUN",
165            Self::AcousticSpace => "ASPC",
166            Self::Skill => "SKIL",
167            Self::MagicEffect => "MGEF",
168            Self::Script => "SCPT",
169            Self::LandTexture => "LTEX",
170            Self::Enchantment => "ENCH",
171            Self::Spell => "SPEL",
172            Self::Scroll => "SCRL",
173            Self::Activator => "ACTI",
174            Self::TalkingActivator => "TACT",
175            Self::Armor => "ARMO",
176            Self::Book => "BOOK",
177            Self::Container => "CONT",
178            Self::Door => "DOOR",
179            Self::Ingredient => "INGR",
180            Self::Light => "LIGH",
181            Self::Misc => "MISC",
182            Self::Apparatus => "APPA",
183            Self::Static => "STAT",
184            Self::StaticCollection => "SCOL",
185            Self::MovableStatic => "MSTT",
186            Self::Grass => "GRAS",
187            Self::Tree => "TREE",
188            Self::Flora => "FLOR",
189            Self::Furniture => "FURN",
190            Self::Weapon => "WEAP",
191            Self::Ammo => "AMMO",
192            Self::NPC => "NPC_",
193            Self::LeveledNPC => "LVLN",
194            Self::KeyMaster => "KEYM",
195            Self::AlchemyItem => "ALCH",
196            Self::IdleMarker => "IDLM",
197            Self::Note => "NOTE",
198            Self::ConstructibleObject => "COBJ",
199            Self::Projectile => "PROJ",
200            Self::Hazard => "HAZD",
201            Self::SoulGem => "SLGM",
202            Self::LeveledItem => "LVLI",
203            Self::Weather => "WTHR",
204            Self::Climate => "CLMT",
205            Self::ShaderParticleGeometryData => "SPGD",
206            Self::ReferenceEffect => "RFCT",
207            Self::Region => "REGN",
208            Self::Navigation => "NAVI",
209            Self::Cell => "CELL",
210            Self::Reference => "REFR",
211            Self::ActorCharacter => "ACHR",
212            Self::ProjectileMissile => "PMIS",
213            Self::ProjectileArrow => "PARW",
214            Self::ProjectileGrenade => "PGRE",
215            Self::ProjectileBeam => "PBEA",
216            Self::ProjectileFlame => "PFLA",
217            Self::ProjectileCone => "PCON",
218            Self::ProjectileBarrier => "PBAR",
219            Self::PlacedHazard => "PHZD",
220            Self::WorldSpace => "WRLD",
221            Self::Land => "LAND",
222            Self::NavMesh => "NAVM",
223            Self::TLOD => "TLOD",
224            Self::Dialogue => "DIAL",
225            Self::Info => "INFO",
226            Self::Quest => "QUST",
227            Self::Idle => "IDLE",
228            Self::Package => "PACK",
229            Self::CombatStyle => "CSTY",
230            Self::LoadScreen => "LSCR",
231            Self::LeveledSpell => "LVSP",
232            Self::AnimatedObject => "ANIO",
233            Self::Water => "WATR",
234            Self::EffectShader => "EFSH",
235            Self::TOFT => "TOFT",
236            Self::Explosion => "EXPL",
237            Self::Debris => "DEBR",
238            Self::ImageSpace => "IMGS",
239            Self::ImageAdapter => "IMAD",
240            Self::FormList => "FLST",
241            Self::Perk => "PERK",
242            Self::BodyPartData => "BPTD",
243            Self::AddonNode => "ADDN",
244            Self::ActorValueInfo => "AVIF",
245            Self::CameraShot => "CAMS",
246            Self::CameraPath => "CPTH",
247            Self::VoiceType => "VTYP",
248            Self::MaterialType => "MATT",
249            Self::Impact => "IPCT",
250            Self::ImpactDataSet => "IPDS",
251            Self::Armature => "ARMA",
252            Self::EncounterZone => "ECZN",
253            Self::Location => "LCTN",
254            Self::Message => "MESG",
255            Self::Ragdoll => "RGDL",
256            Self::DefaultObject => "DOBJ",
257            Self::LightingMaster => "LGTM",
258            Self::MusicType => "MUSC",
259            Self::Footstep => "FSTP",
260            Self::FootstepSet => "FSTS",
261            Self::StoryManagerBranchNode => "SMBN",
262            Self::StoryManagerQuestNode => "SMQN",
263            Self::StoryManagerEventNode => "SMEN",
264            Self::DialogueBranch => "DLBR",
265            Self::MusicTrack => "MUST",
266            Self::DialogueView => "DLVW",
267            Self::WordOfPower => "WOOP",
268            Self::Shout => "SHOU",
269            Self::EquipSlot => "EQUP",
270            Self::Relationship => "RELA",
271            Self::Scene => "SCEN",
272            Self::AssociationType => "ASTP",
273            Self::Outfit => "OTFT",
274            Self::ArtObject => "ARTO",
275            Self::MaterialObject => "MATO",
276            Self::MovementType => "MOVT",
277            Self::SoundRecord => "SNDR",
278            Self::DualCastData => "DUAL",
279            Self::SoundCategory => "SNCT",
280            Self::SoundOutputModel => "SOPM",
281            Self::CollisionLayer => "COLL",
282            Self::ColorForm => "CLFM",
283            Self::ReverbParam => "REVB",
284            Self::LensFlare => "LENS",
285            Self::LensSprite => "LSPR",
286            Self::VolumetricLighting => "VOLI",
287            _ => "NONE",
288        }
289    }
290}
291
292impl core::str::FromStr for FormType {
293    type Err = String;
294
295    fn from_str(s: &str) -> Result<Self, Self::Err> {
296        Ok(match s {
297            "TES4" => Self::PluginInfo,
298            "GRUP" => Self::FormGroup,
299            "GMST" => Self::GameSetting,
300            "KYWD" => Self::Keyword,
301            "LCRT" => Self::LocationRefType,
302            "AACT" => Self::Action,
303            "TXST" => Self::TextureSet,
304            "MICN" => Self::MenuIcon,
305            "GLOB" => Self::Global,
306            "CLAS" => Self::Class,
307            "FACT" => Self::Faction,
308            "HDPT" => Self::HeadPart,
309            "EYES" => Self::Eyes,
310            "RACE" => Self::Race,
311            "SOUN" => Self::Sound,
312            "ASPC" => Self::AcousticSpace,
313            "SKIL" => Self::Skill,
314            "MGEF" => Self::MagicEffect,
315            "SCPT" => Self::Script,
316            "LTEX" => Self::LandTexture,
317            "ENCH" => Self::Enchantment,
318            "SPEL" => Self::Spell,
319            "SCRL" => Self::Scroll,
320            "ACTI" => Self::Activator,
321            "TACT" => Self::TalkingActivator,
322            "ARMO" => Self::Armor,
323            "BOOK" => Self::Book,
324            "CONT" => Self::Container,
325            "DOOR" => Self::Door,
326            "INGR" => Self::Ingredient,
327            "LIGH" => Self::Light,
328            "MISC" => Self::Misc,
329            "APPA" => Self::Apparatus,
330            "STAT" => Self::Static,
331            "SCOL" => Self::StaticCollection,
332            "MSTT" => Self::MovableStatic,
333            "GRAS" => Self::Grass,
334            "TREE" => Self::Tree,
335            "FLOR" => Self::Flora,
336            "FURN" => Self::Furniture,
337            "WEAP" => Self::Weapon,
338            "AMMO" => Self::Ammo,
339            "NPC_" => Self::NPC,
340            "LVLN" => Self::LeveledNPC,
341            "KEYM" => Self::KeyMaster,
342            "ALCH" => Self::AlchemyItem,
343            "IDLM" => Self::IdleMarker,
344            "NOTE" => Self::Note,
345            "COBJ" => Self::ConstructibleObject,
346            "PROJ" => Self::Projectile,
347            "HAZD" => Self::Hazard,
348            "SLGM" => Self::SoulGem,
349            "LVLI" => Self::LeveledItem,
350            "WTHR" => Self::Weather,
351            "CLMT" => Self::Climate,
352            "SPGD" => Self::ShaderParticleGeometryData,
353            "RFCT" => Self::ReferenceEffect,
354            "REGN" => Self::Region,
355            "NAVI" => Self::Navigation,
356            "CELL" => Self::Cell,
357            "REFR" => Self::Reference,
358            "ACHR" => Self::ActorCharacter,
359            "NONE" => Self::None,
360            invalid => return Err(format!("Invalid FormType: {invalid}")),
361        })
362    }
363}