Skip to main content

tiger_lib/
item.rs

1//! Giant enum for all the [`Item`] types in the game.
2
3use std::fmt::{Display, Formatter};
4
5use strum_macros::{EnumCount, EnumIter, IntoStaticStr};
6
7use crate::block::Block;
8use crate::db::Db;
9#[cfg(doc)]
10use crate::everything::Everything;
11use crate::game::{Game, GameFlags};
12use crate::pdxfile::PdxEncoding;
13use crate::report::{Confidence, Severity};
14use crate::token::Token;
15
16/// "items" are all the things that can be looked up in the game databases.
17/// Anything that can be looked up in script with a literal string key, or that's loaded into
18/// tiger's database and needs a unique key, is an `Item`.
19///
20/// There is some overlap with scopes, for example "culture" is both an `Item` and a scope type,
21/// but the difference is that scopes are runtime values while items are always strings.
22///
23/// For example if a trigger takes a culture *scope*, you could supply either `culture:german` or
24/// `scope:target_culture`, while if a trigger takes a culture *item*, you would have to supply just
25/// `german` and don't have the option of supplying something determined at runtime.
26#[derive(Copy, Clone, Debug, PartialEq, Eq, IntoStaticStr, Hash, PartialOrd, Ord, EnumCount, EnumIter)]
27#[strum(serialize_all = "snake_case")]
28#[non_exhaustive]
29// The item table is in several alphabetized sections. First the generic items, then items used by
30// multiple games, then a section for each game.
31//
32// Each item is marked with a cfg clause for its game. This is not strictly necessary, but it helps
33// prevent "leakage" between the games, where they accidentally use each other's item types.
34#[rustfmt::skip] // having cfg and the variant on the same line is much more readable
35pub enum Item {
36    // Generic items used by all games and assumed to be there by the validators in
37    // non-game-specific `data` modules.
38    #[cfg(feature = "jomini")]
39    Accessory,
40    #[cfg(feature = "jomini")]
41    AccessoryTag,
42    #[cfg(feature = "jomini")]
43    AccessoryVariation,
44    #[cfg(feature = "jomini")]
45    AccessoryVariationLayout,
46    #[cfg(feature = "jomini")]
47    AccessoryVariationTextures,
48    Achievement,
49    #[cfg(feature = "jomini")]
50    AchievementGroup,
51    Asset,
52    BlendShape,
53    #[cfg(feature = "jomini")]
54    CharacterInteraction,
55    #[cfg(feature = "jomini")]
56    Coa,
57    #[cfg(feature = "jomini")]
58    CoaColorList,
59    #[cfg(feature = "jomini")]
60    CoaColoredEmblemList,
61    #[cfg(feature = "ck3")]
62    CoaDesignerColorPalette,
63    #[cfg(feature = "jomini")]
64    CoaDesignerColoredEmblem,
65    #[cfg(feature = "ck3")]
66    CoaDesignerEmblemLayout,
67    #[cfg(feature = "jomini")]
68    CoaDesignerPattern,
69    #[cfg(feature = "jomini")]
70    CoaPatternList,
71    #[cfg(feature = "jomini")]
72    CoaTemplate,
73    #[cfg(feature = "jomini")]
74    CoaTemplateList,
75    #[cfg(feature = "jomini")]
76    CoaTexturedEmblemList,
77    #[cfg(feature = "jomini")]
78    Culture,
79    #[cfg(feature = "jomini")]
80    CustomLocalization,
81    Decision,
82    Define,
83    Directory,
84    Dlc,
85    DlcFeature,
86    DlcName,
87    #[cfg(feature = "jomini")]
88    EffectLocalization,
89    Entity,
90    Entry,
91    #[cfg(feature = "jomini")]
92    Ethnicity,
93    Event,
94    EventNamespace,
95    File,
96    Font,
97    Fontfiles,
98    #[cfg(feature = "jomini")]
99    GameConcept,
100    GameRule,
101    GameRuleSetting,
102    #[cfg(feature = "jomini")]
103    GeneAgePreset,
104    #[cfg(feature = "jomini")]
105    GeneAttribute,
106    #[cfg(feature = "jomini")]
107    GeneCategory,
108    #[cfg(feature = "jomini")]
109    GovernmentType,
110    GuiLayer,
111    GuiTemplate,
112    GuiType,
113    #[cfg(feature = "jomini")]
114    LawGroup,
115    Localization,
116    MapEnvironment,
117    MapMode,
118    Modifier,
119    Music,
120    #[cfg(feature = "jomini")]
121    MusicPlayerCategory,
122    #[cfg(feature = "jomini")]
123    NamedColor,
124    OnAction,
125    Pdxmesh,
126    #[cfg(feature = "jomini")]
127    PortraitAnimation,
128    #[cfg(feature = "jomini")]
129    PortraitCamera,
130    #[cfg(feature = "jomini")]
131    PortraitEnvironment,
132    #[cfg(feature = "jomini")]
133    PortraitModifierGroup,
134    #[cfg(feature = "jomini")]
135    PortraitModifierPack,
136    Province,
137    #[cfg(feature = "jomini")]
138    Religion,
139    ScriptedEffect,
140    ScriptedGui,
141    #[cfg(feature = "jomini")]
142    ScriptedList,
143    #[cfg(feature = "jomini")]
144    ScriptedModifier,
145    #[cfg(feature = "jomini")]
146    ScriptedRule,
147    ScriptedTrigger,
148    #[cfg(feature = "jomini")]
149    ScriptValue,
150    Shortcut,
151    Sound,
152    Terrain,
153    TextFormat,
154    TextIcon,
155    TextureFile,
156    #[cfg(feature = "jomini")]
157    TriggerLocalization,
158    WidgetName,
159
160    // Items shared by more than one game
161    #[cfg(any(feature = "vic3", feature = "hoi4"))]
162    AiStrategy,
163    #[cfg(any(feature = "ck3", feature = "imperator", feature = "hoi4"))]
164    Building,
165    #[cfg(any(feature = "ck3", feature = "hoi4"))]
166    Character,
167    #[cfg(any(feature = "ck3", feature = "vic3"))]
168    CharacterTemplate,
169    #[cfg(any(feature = "vic3", feature = "imperator"))]
170    CharacterTrait,
171    #[cfg(any(feature = "imperator", feature = "hoi4"))]
172    CombatTactic,
173    #[cfg(any(feature = "vic3", feature = "imperator", feature = "hoi4"))]
174    Country,
175    #[cfg(any(feature = "ck3", feature = "imperator"))]
176    DeathReason,
177    #[cfg(any(feature = "ck3", feature = "vic3"))]
178    Dna,
179    #[cfg(any(feature = "ck3", feature = "imperator"))]
180    EventTheme,
181    #[cfg(any(feature = "imperator", feature = "hoi4"))]
182    Idea,
183    #[cfg(any(feature = "vic3", feature = "hoi4"))]
184    Ideology,
185    #[cfg(any(feature = "ck3", feature = "imperator"))]
186    Law,
187    #[cfg(any(feature = "ck3", feature = "vic3"))]
188    Message,
189    #[cfg(any(feature = "imperator", feature = "hoi4"))]
190    Mission,
191    #[cfg(any(feature = "vic3", feature = "imperator"))]
192    PopType,
193    #[cfg(any(feature = "ck3", feature = "imperator"))]
194    Region,
195    #[cfg(any(feature = "vic3", feature = "hoi4"))] 
196    StrategicRegion,
197    #[cfg(any(feature = "vic3", feature = "imperator"))]
198    SubjectType,
199    #[cfg(any(feature = "vic3", feature = "hoi4"))]
200    Technology,
201    #[cfg(any(feature = "ck3", feature = "vic3"))]
202    TutorialLesson,
203    #[cfg(any(feature = "ck3", feature = "vic3"))]
204    TutorialLessonChain,
205    #[cfg(any(feature = "ck3", feature = "vic3"))]
206    TutorialLessonStep,
207
208    // Items for ck3
209    #[cfg(feature = "ck3")] AccoladeCategory,
210    #[cfg(feature = "ck3")] AccoladeIcon,
211    #[cfg(feature = "ck3")] AccoladeName,
212    #[cfg(feature = "ck3")] AccoladeParameter,
213    #[cfg(feature = "ck3")] AccoladeType,
214    #[cfg(feature = "ck3")] ActivityGroupType,
215    #[cfg(feature = "ck3")] ActivityIntent,
216    #[cfg(feature = "ck3")] ActivityLocale,
217    #[cfg(feature = "ck3")] ActivityOption,
218    #[cfg(feature = "ck3")] ActivityOptionCategory,
219    #[cfg(feature = "ck3")] ActivityPhase,
220    #[cfg(feature = "ck3")] ActivityPulseAction,
221    #[cfg(feature = "ck3")] ActivityState,
222    #[cfg(feature = "ck3")] ActivityType,
223    #[cfg(feature = "ck3")] AiWarStance,
224    #[cfg(feature = "ck3")] AgentType,
225    #[cfg(feature = "ck3")] Amenity,
226    #[cfg(feature = "ck3")] AmenitySetting,
227    #[cfg(feature = "ck3")] ArtifactBlueprint,
228    #[cfg(feature = "ck3")] ArtifactFeature,
229    #[cfg(feature = "ck3")] ArtifactFeatureGroup,
230    #[cfg(feature = "ck3")] ArtifactHistory,
231    #[cfg(feature = "ck3")] ArtifactRarity,
232    #[cfg(feature = "ck3")] ArtifactSlot,
233    #[cfg(feature = "ck3")] ArtifactSlotType,
234    #[cfg(feature = "ck3")] ArtifactTemplate,
235    #[cfg(feature = "ck3")] ArtifactType,
236    #[cfg(feature = "ck3")] ArtifactVisual,
237    #[cfg(feature = "ck3")] Bookmark,
238    #[cfg(feature = "ck3")] BookmarkGroup,
239    #[cfg(feature = "ck3")] BookmarkPortrait,
240    #[cfg(feature = "ck3")] BooleanHouseHeadParameter,
241    #[cfg(feature = "ck3")] BooleanHousePowerParameter,
242    #[cfg(feature = "ck3")] BooleanHouseRelationParameter,
243    #[cfg(feature = "ck3")] BuildingFlag,
244    #[cfg(feature = "ck3")] BuildingGfx,
245    #[cfg(feature = "ck3")] CasusBelli,
246    #[cfg(feature = "ck3")] CasusBelliGroup,
247    #[cfg(feature = "ck3")] Catalyst,
248    #[cfg(feature = "ck3")] ChallengeCharacter,
249    #[cfg(feature = "ck3")] CharacterBackground,
250    #[cfg(feature = "ck3")] CharacterInteractionCategory,
251    #[cfg(feature = "ck3")] Climate,
252    #[cfg(feature = "ck3")] ClothingGfx,
253    #[cfg(feature = "ck3")] CoaGfx,
254    #[cfg(feature = "ck3")] CoaDynamicDefinition,
255    #[cfg(feature = "ck3")] CohesionLevelParameter,
256    #[cfg(feature = "ck3")] CombatEffect,
257    #[cfg(feature = "ck3")] CombatPhaseEvent,
258    #[cfg(feature = "ck3")] ConfederationType,
259    #[cfg(feature = "ck3")] ConnectionArrow,
260    #[cfg(feature = "ck3")] CouncilPosition,
261    #[cfg(feature = "ck3")] CouncilTask,
262    #[cfg(feature = "ck3")] Countermeasure,
263    #[cfg(feature = "ck3")] CountermeasureParameter,
264    #[cfg(feature = "ck3")] CourtPosition,
265    #[cfg(feature = "ck3")] CourtPositionTask,
266    #[cfg(feature = "ck3")] CourtSceneCulture,
267    #[cfg(feature = "ck3")] CourtSceneGroup,
268    #[cfg(feature = "ck3")] CourtSceneRole,
269    #[cfg(feature = "ck3")] CourtSceneSetting,
270    #[cfg(feature = "ck3")] CourtType,
271    #[cfg(feature = "ck3")] CourtierGuestManagement,
272    #[cfg(feature = "ck3")] CultureAesthetic,
273    #[cfg(feature = "ck3")] CultureCreationName,
274    #[cfg(feature = "ck3")] CultureEra,
275    #[cfg(feature = "ck3")] CultureEthos,
276    #[cfg(feature = "ck3")] CultureHeritage,
277    #[cfg(feature = "ck3")] CultureHistory,
278    #[cfg(feature = "ck3")] CultureParameter,
279    #[cfg(feature = "ck3")] CulturePillar,
280    #[cfg(feature = "ck3")] CultureTradition,
281    #[cfg(feature = "ck3")] CultureTraditionCategory,
282    #[cfg(feature = "ck3")] DangerType,
283    #[cfg(feature = "ck3")] DecisionGroup,
284    #[cfg(feature = "ck3")] DiarchyMandate,
285    #[cfg(feature = "ck3")] DiarchyParameter,
286    #[cfg(feature = "ck3")] DiarchyType,
287    #[cfg(feature = "ck3")] Doctrine,
288    #[cfg(feature = "ck3")] DoctrineBooleanParameter,
289    #[cfg(feature = "ck3")] DoctrineCategory,
290    #[cfg(feature = "ck3")] DoctrineParameter,
291    #[cfg(feature = "ck3")] DomicileBuilding,
292    #[cfg(feature = "ck3")] DomicileParameter,
293    #[cfg(feature = "ck3")] DomicileType,
294    #[cfg(feature = "ck3")] Dynasty,
295    #[cfg(feature = "ck3")] DynastyLegacy,
296    #[cfg(feature = "ck3")] DynastyPerk,
297    #[cfg(feature = "ck3")] EpidemicType,
298    #[cfg(feature = "ck3")] EpidemicDeathReason,
299    #[cfg(feature = "ck3")] EventBackground,
300    #[cfg(feature = "ck3")] EventEffect2d,
301    #[cfg(feature = "ck3")] EventTransition,
302    #[cfg(feature = "ck3")] Faction,
303    #[cfg(feature = "ck3")] Faith,
304    #[cfg(feature = "ck3")] FaithIcon,
305    #[cfg(feature = "ck3")] FervorModifier,
306    #[cfg(feature = "ck3")] Flavorization,
307    #[cfg(feature = "ck3")] Focus,
308    #[cfg(feature = "ck3")] GeneticConstraint,
309    #[cfg(feature = "ck3")] GovernmentFlag,
310    #[cfg(feature = "ck3")] GraphicalFaith,
311    #[cfg(feature = "ck3")] GraphicalUnitType,
312    #[cfg(feature = "ck3")] GreatProjectType,
313    #[cfg(feature = "ck3")] GuestInviteRule,
314    #[cfg(feature = "ck3")] GuestSubset,
315    #[cfg(feature = "ck3")] GuestSystem,
316    #[cfg(feature = "ck3")] HeadDetermination,
317    #[cfg(feature = "ck3")] HoldingParameter,
318    #[cfg(feature = "ck3")] HoldingType,
319    #[cfg(feature = "ck3")] HolySite,
320    #[cfg(feature = "ck3")] HolySiteFlag,
321    #[cfg(feature = "ck3")] Hook,
322    #[cfg(feature = "ck3")] House,
323    #[cfg(feature = "ck3")] HouseAspiration,
324    #[cfg(feature = "ck3")] HouseRelationLevel,
325    #[cfg(feature = "ck3")] HouseRelationType,
326    #[cfg(feature = "ck3")] HouseUnity,
327    #[cfg(feature = "ck3")] HouseUnityParameter,
328    #[cfg(feature = "ck3")] HouseUnityStage,
329    #[cfg(feature = "ck3")] ImportantAction,
330    #[cfg(feature = "ck3")] Innovation,
331    #[cfg(feature = "ck3")] InnovationFlag,
332    #[cfg(feature = "ck3")] InnovationParameter,
333    #[cfg(feature = "ck3")] Inspiration,
334    #[cfg(feature = "ck3")] Language,
335    #[cfg(feature = "ck3")] LawFlag,
336    #[cfg(feature = "ck3")] LeaseContract,
337    #[cfg(feature = "ck3")] LegendChapter,
338    #[cfg(feature = "ck3")] LegendChronicle,
339    #[cfg(feature = "ck3")] LegendProperty,
340    #[cfg(feature = "ck3")] LegendSeed,
341    #[cfg(feature = "ck3")] LegendType,
342    #[cfg(feature = "ck3")] LegitimacyFlag,
343    #[cfg(feature = "ck3")] LegitimacyType,
344    #[cfg(feature = "ck3")] Lifestyle,
345    #[cfg(feature = "ck3")] LineType,
346    #[cfg(feature = "ck3")] MartialCustom,
347    #[cfg(feature = "ck3")] MemoryCategory,
348    #[cfg(feature = "ck3")] MemoryType,
349    #[cfg(feature = "ck3")] MenAtArms,
350    #[cfg(feature = "ck3")] MenAtArmsBase,
351    #[cfg(feature = "ck3")] MessageFilterType,
352    #[cfg(feature = "ck3")] MessageGroupType,
353    #[cfg(feature = "ck3")] ModifierFormat,
354    #[cfg(feature = "ck3")] MottoInsert,
355    #[cfg(feature = "ck3")] Motto,
356    #[cfg(feature = "ck3")] NameEquivalency,
357    #[cfg(feature = "ck3")] NameList,
358    #[cfg(feature = "ck3")] Nickname,
359    #[cfg(feature = "ck3")] OpinionModifier,
360    #[cfg(feature = "ck3")] Perk,
361    #[cfg(feature = "ck3")] PerkTree,
362    #[cfg(feature = "ck3")] PlayableDifficultyInfo,
363    #[cfg(feature = "ck3")] PointOfInterest,
364    #[cfg(feature = "ck3")] PoolSelector,
365    #[cfg(feature = "ck3")] PortraitType,
366    #[cfg(feature = "ck3")] PrisonType,
367    #[cfg(feature = "ck3")] ProjectContribution,
368    #[cfg(feature = "ck3")] ProvinceEffect,
369    #[cfg(feature = "ck3")] ProvinceMapping,
370    #[cfg(feature = "ck3")] RaidIntent,
371    #[cfg(feature = "ck3")] Relation,
372    #[cfg(feature = "ck3")] RelationFlag,
373    #[cfg(feature = "ck3")] ReligionFamily,
374    #[cfg(feature = "ck3")] RewardItem,
375    #[cfg(feature = "ck3")] RulerObjectiveType,
376    #[cfg(feature = "ck3")] Scheme,
377    #[cfg(feature = "ck3")] SchemePulseAction,
378    #[cfg(feature = "ck3")] ScriptedAnimation,
379    #[cfg(feature = "ck3")] ScriptedCost,
380    #[cfg(feature = "ck3")] ScriptedIllustration,
381    #[cfg(feature = "ck3")] Secret,
382    #[cfg(feature = "ck3")] Sexuality,
383    #[cfg(feature = "ck3")] Situation,
384    #[cfg(feature = "ck3")] SituationCatalyst,
385    #[cfg(feature = "ck3")] SituationGroupType,
386    #[cfg(feature = "ck3")] SituationHistory,
387    #[cfg(feature = "ck3")] SituationParticipantGroup,
388    #[cfg(feature = "ck3")] SituationParticipantGroupParameter,
389    #[cfg(feature = "ck3")] SituationPhase,
390    #[cfg(feature = "ck3")] SituationPhaseParameter,
391    #[cfg(feature = "ck3")] SituationSubRegion,
392    #[cfg(feature = "ck3")] Skill,
393    #[cfg(feature = "ck3")] SpecialBuilding,
394    #[cfg(feature = "ck3")] SpecialGuest,
395    #[cfg(feature = "ck3")] Story,
396    #[cfg(feature = "ck3")] Struggle,
397    #[cfg(feature = "ck3")] StruggleHistory,
398    #[cfg(feature = "ck3")] StrugglePhase,
399    #[cfg(feature = "ck3")] StrugglePhaseParameter,
400    #[cfg(feature = "ck3")] SubjectContract,
401    #[cfg(feature = "ck3")] SubjectContractFlag,
402    #[cfg(feature = "ck3")] SubjectContractGroup,
403    #[cfg(feature = "ck3")] SubjectContractObligationLevel,
404    #[cfg(feature = "ck3")] SuccessionAppointment,
405    #[cfg(feature = "ck3")] SuccessionElection,
406    #[cfg(feature = "ck3")] Suggestion,
407    #[cfg(feature = "ck3")] TaskContractGroup,
408    #[cfg(feature = "ck3")] TaskContractReward,
409    #[cfg(feature = "ck3")] TaskContractType,
410    #[cfg(feature = "ck3")] TaxSlotObligation,
411    #[cfg(feature = "ck3")] TaxSlotType,
412    #[cfg(feature = "ck3")] Title,
413    #[cfg(feature = "ck3")] TitleHistory,
414    #[cfg(feature = "ck3")] Trait,
415    #[cfg(feature = "ck3")] TraitCategory,
416    #[cfg(feature = "ck3")] TraitFlag,
417    #[cfg(feature = "ck3")] TraitPortraitModifier,
418    #[cfg(feature = "ck3")] TraitTrack,
419    #[cfg(feature = "ck3")] TravelOption,
420    #[cfg(feature = "ck3")] UnitGfx,
421    #[cfg(feature = "ck3")] VassalStance,
422
423    // Items specific to vic3
424    #[cfg(feature = "vic3")] AcceptanceStatus,
425    #[cfg(feature = "vic3")] AirGraphics,
426    #[cfg(feature = "vic3")] Alert,
427    #[cfg(feature = "vic3")] AlertGroup,
428    #[cfg(feature = "vic3")] Amendment,
429    #[cfg(feature = "vic3")] Approval,
430    #[cfg(feature = "vic3")] ArmyDiorama,
431    #[cfg(feature = "vic3")] Attitude,
432    #[cfg(feature = "vic3")] BattleCondition,
433    #[cfg(feature = "vic3")] BuildingGroup,
434    #[cfg(feature = "vic3")] BuildingType,
435    #[cfg(feature = "vic3")] BuyPackage,
436    #[cfg(feature = "vic3")] CanalType,
437    #[cfg(feature = "vic3")] CharacterRole,
438    #[cfg(feature = "vic3")] CityBuildingVfx,
439    #[cfg(feature = "vic3")] CityCenterpiece,
440    #[cfg(feature = "vic3")] CityGraphicsType,
441    #[cfg(feature = "vic3")] CityVfx,
442    #[cfg(feature = "vic3")] CombatUnit,
443    #[cfg(feature = "vic3")] CombatUnitExperienceLevel,
444    #[cfg(feature = "vic3")] CombatUnitGroup,
445    #[cfg(feature = "vic3")] CommanderOrder,
446    #[cfg(feature = "vic3")] CommanderRank,
447    #[cfg(feature = "vic3")] CompanyType,
448    #[cfg(feature = "vic3")] CompanyCharterType,
449    #[cfg(feature = "vic3")] CohesionLevel,
450    #[cfg(feature = "vic3")] CountryCreation,
451    #[cfg(feature = "vic3")] CountryFormation,
452    #[cfg(feature = "vic3")] CountryRank,
453    #[cfg(feature = "vic3")] CountryTier,
454    #[cfg(feature = "vic3")] CountryType,
455    #[cfg(feature = "vic3")] CultureGraphics,
456    #[cfg(feature = "vic3")] Decree,
457    #[cfg(feature = "vic3")] DiplomaticAction,
458    #[cfg(feature = "vic3")] DiplomaticCatalyst,
459    #[cfg(feature = "vic3")] DiplomaticCatalystCategory,
460    #[cfg(feature = "vic3")] DiplomaticPlay,
461    #[cfg(feature = "vic3")] DiscriminationTrait,
462    #[cfg(feature = "vic3")] DiscriminationTraitGroup,
463    #[cfg(feature = "vic3")] DynamicCompanyName,
464    #[cfg(feature = "vic3")] DynamicCountryMapColor,
465    #[cfg(feature = "vic3")] DynamicCountryName,
466    #[cfg(feature = "vic3")] DynamicTreatyName,
467    #[cfg(feature = "vic3")] EventCategory,
468    #[cfg(feature = "vic3")] FlagDefinition,
469    #[cfg(feature = "vic3")] FleetDiorama,
470    #[cfg(feature = "vic3")] FrontGraphics,
471    #[cfg(feature = "vic3")] GeographicRegion,
472    #[cfg(feature = "vic3")] GeographicRegionShortKey,
473    #[cfg(feature = "vic3")] Goods,
474    #[cfg(feature = "vic3")] GradientBorderSettings,
475    #[cfg(feature = "vic3")] HarvestConditionType,
476    #[cfg(feature = "vic3")] HeritageTrait,
477    #[cfg(feature = "vic3")] InfamyThreshold,
478    #[cfg(feature = "vic3")] Institution,
479    #[cfg(feature = "vic3")] InterestGroup,
480    #[cfg(feature = "vic3")] InterestGroupTrait,
481    #[cfg(feature = "vic3")] JournalEntry,
482    #[cfg(feature = "vic3")] JournalEntryGroup,
483    #[cfg(feature = "vic3")] LanguageTrait,
484    #[cfg(feature = "vic3")] LawType,
485    #[cfg(feature = "vic3")] LegitimacyLevel,
486    #[cfg(feature = "vic3")] Level,
487    #[cfg(feature = "vic3")] LibertyDesireLevel,
488    #[cfg(feature = "vic3")] MapLayer,
489    #[cfg(feature = "vic3")] MapInteractionType,
490    #[cfg(feature = "vic3")] MapNotificationType,
491    #[cfg(feature = "vic3")] MediaAlias,
492    #[cfg(feature = "vic3")] MilitaryFormationFlag,
493    #[cfg(feature = "vic3")] MobilizationOption,
494    #[cfg(feature = "vic3")] MobilizationOptionGroup,
495    #[cfg(feature = "vic3")] ModifierTypeDefinition,
496    #[cfg(feature = "vic3")] Objective,
497    #[cfg(feature = "vic3")] ObjectiveSubgoal,
498    #[cfg(feature = "vic3")] ObjectiveSubgoalCategory,
499    #[cfg(feature = "vic3")] Party,
500    #[cfg(feature = "vic3")] PoliticalLobby,
501    #[cfg(feature = "vic3")] PoliticalLobbyAppeasement,
502    #[cfg(feature = "vic3")] PoliticalMovement,
503    #[cfg(feature = "vic3")] PoliticalMovementCategory,
504    #[cfg(feature = "vic3")] PoliticalMovementPopSupport,
505    #[cfg(feature = "vic3")] PopNeed,
506    #[cfg(feature = "vic3")] PowerBlocCoaPiece,
507    #[cfg(feature = "vic3")] PowerBlocIdentity,
508    #[cfg(feature = "vic3")] PowerBlocMapTexture,
509    #[cfg(feature = "vic3")] PowerBlocName,
510    #[cfg(feature = "vic3")] PrestigeGoods,
511    #[cfg(feature = "vic3")] Principle,
512    #[cfg(feature = "vic3")] PrincipleGroup,
513    #[cfg(feature = "vic3")] ProductionMethod,
514    #[cfg(feature = "vic3")] ProductionMethodGroup,
515    #[cfg(feature = "vic3")] ProposalType,
516    #[cfg(feature = "vic3")] RelationsThreshold,
517    #[cfg(feature = "vic3")] ScriptedButton,
518    #[cfg(feature = "vic3")] ScriptedProgressBar,
519    #[cfg(feature = "vic3")] ScriptedTest,
520    #[cfg(feature = "vic3")] SecretGoal,
521    #[cfg(feature = "vic3")] Skin,
522    #[cfg(feature = "vic3")] SocialClass,
523    #[cfg(feature = "vic3")] SocialHierarchy,
524    #[cfg(feature = "vic3")] StateRegion,
525    #[cfg(feature = "vic3")] StateTrait,
526    #[cfg(feature = "vic3")] Strata,
527    #[cfg(feature = "vic3")] TechnologyEra,
528    #[cfg(feature = "vic3")] TerrainKey,
529    #[cfg(feature = "vic3")] TerrainLabel,
530    #[cfg(feature = "vic3")] TerrainManipulator,
531    #[cfg(feature = "vic3")] TerrainMask,
532    #[cfg(feature = "vic3")] TerrainMaterial,
533    #[cfg(feature = "vic3")] Theme,
534    #[cfg(feature = "vic3")] TraditionTrait,
535    #[cfg(feature = "vic3")] TransferOfPower,
536    #[cfg(feature = "vic3")] TreatyArticle,
537    #[cfg(feature = "vic3")] WarGoalType,
538
539    // Items specific to imperator
540    #[cfg(feature = "imperator")] Ambition,
541    #[cfg(feature = "imperator")] AiPlanGoals,
542    #[cfg(feature = "imperator")] Area,
543    #[cfg(feature = "imperator")] CultureGroup,
544    #[cfg(feature = "imperator")] Deity,
545    #[cfg(feature = "imperator")] DeityCategory,
546    #[cfg(feature = "imperator")] DiplomaticStance,
547    #[cfg(feature = "imperator")] EconomicPolicy,
548    #[cfg(feature = "imperator")] EventPicture,
549    #[cfg(feature = "imperator")] GovernorPolicy,
550    #[cfg(feature = "imperator")] GraphicalCultureType,
551    #[cfg(feature = "imperator")] GreatWorkEffectTier,
552    #[cfg(feature = "imperator")] GreatWorkEffect,
553    #[cfg(feature = "imperator")] GreatWorkCategory,
554    #[cfg(feature = "imperator")] GreatWorkMaterial,
555    #[cfg(feature = "imperator")] GreatWorkModule,
556    #[cfg(feature = "imperator")] GreatWorkTemplate,
557    #[cfg(feature = "imperator")] Heritage,
558    #[cfg(feature = "imperator")] Invention,
559    #[cfg(feature = "imperator")] InventionGroup,
560    #[cfg(feature = "imperator")] LegionDistinction,
561    #[cfg(feature = "imperator")] LevyTemplate,
562    #[cfg(feature = "imperator")] Loyalty,
563    #[cfg(feature = "imperator")] MilitaryTraditionTree,
564    #[cfg(feature = "imperator")] MilitaryTradition,
565    #[cfg(feature = "imperator")] MissionTask,
566    #[cfg(feature = "imperator")] Office,
567    #[cfg(feature = "imperator")] Opinion,
568    #[cfg(feature = "imperator")] PartyAgenda,
569    #[cfg(feature = "imperator")] PartyType,
570    #[cfg(feature = "imperator")] PostSetupCharacters,
571    #[cfg(feature = "imperator")] Price,
572    #[cfg(feature = "imperator")] ProvinceRank,
573    #[cfg(feature = "imperator")] SetupCharacters,
574    #[cfg(feature = "imperator")] SetupProvinces,
575    #[cfg(feature = "imperator")] TechnologyTable,
576    #[cfg(feature = "imperator")] TradeGood,
577    #[cfg(feature = "imperator")] Treasure,
578    #[cfg(feature = "imperator")] Unit,
579    #[cfg(feature = "imperator")] UnitAbility,
580    #[cfg(feature = "imperator")] Wargoal,
581
582    #[cfg(feature = "hoi4")] Ability,
583    #[cfg(feature = "hoi4")] Acclimatation,
584    #[cfg(feature = "hoi4")] AceModifier,
585    #[cfg(feature = "hoi4")] AdjacencyRule,
586    #[cfg(feature = "hoi4")] AiArea,
587    #[cfg(feature = "hoi4")] AiStrategyType,
588    #[cfg(feature = "hoi4")] AdvisorSlot,
589    #[cfg(feature = "hoi4")] CharacterIdeaToken,
590    #[cfg(feature = "hoi4")] CombatTacticPhase,
591    #[cfg(feature = "hoi4")] Continent,
592    #[cfg(feature = "hoi4")] CountryLeaderTrait,
593    #[cfg(feature = "hoi4")] CountryHistory,
594    #[cfg(feature = "hoi4")] CountryTag,
595    #[cfg(feature = "hoi4")] CountryTagAlias,
596    #[cfg(feature = "hoi4")] DecisionCategory,
597    #[cfg(feature = "hoi4")] DivisionNamesGroup,
598    #[cfg(feature = "hoi4")] DivisionTemplate,
599    #[cfg(feature = "hoi4")] DynamicModifier,
600    #[cfg(feature = "hoi4")] Equipment,
601    #[cfg(feature = "hoi4")] EquipmentBonusType,
602    #[cfg(feature = "hoi4")] EquipmentCategory,
603    #[cfg(feature = "hoi4")] EquipmentGroup,
604    #[cfg(feature = "hoi4")] EquipmentModule,
605    #[cfg(feature = "hoi4")] EquipmentModuleCategory,
606    #[cfg(feature = "hoi4")] EquipmentSearchFilter,
607    #[cfg(feature = "hoi4")] EquipmentStat,
608    #[cfg(feature = "hoi4")] EquipmentUpgrade,
609    #[cfg(feature = "hoi4")] GraphicalTerrain,
610    #[cfg(feature = "hoi4")] IdeaCategory,
611    #[cfg(feature = "hoi4")] IdeologyGroup,
612    #[cfg(feature = "hoi4")] IndustrialOrg,
613    #[cfg(feature = "hoi4")] IndustrialOrgBonusWeight,
614    #[cfg(feature = "hoi4")] IndustrialOrgPolicy,
615    #[cfg(feature = "hoi4")] IndustrialOrgTrait,
616    #[cfg(feature = "hoi4")] IntelligenceAgencyBranch,
617    #[cfg(feature = "hoi4")] IntelligenceAgencyUpgrade,
618    #[cfg(feature = "hoi4")] MusicAsset,
619    #[cfg(feature = "hoi4")] NationalFocus,
620    #[cfg(feature = "hoi4")] NationalFocusStyle,
621    #[cfg(feature = "hoi4")] NationalFocusTree,
622    #[cfg(feature = "hoi4")] Operation,
623    #[cfg(feature = "hoi4")] OperationPhase,
624    #[cfg(feature = "hoi4")] OperationToken,
625    #[cfg(feature = "hoi4")] PowerBalance,
626    #[cfg(feature = "hoi4")] PowerBalanceSide,
627    #[cfg(feature = "hoi4")] ProductionStat,
628    #[cfg(feature = "hoi4")] PrototypeReward,
629    #[cfg(feature = "hoi4")] RailwayGunNames,
630    #[cfg(feature = "hoi4")] Resource,
631    #[cfg(feature = "hoi4")] ScriptEnum,
632    #[cfg(feature = "hoi4")] ScriptedConstant,
633    #[cfg(feature = "hoi4")] ScriptedLocalisation,
634    #[cfg(feature = "hoi4")] ShipNames,
635    #[cfg(feature = "hoi4")] SoundEffect,
636    #[cfg(feature = "hoi4")] SoundFalloff,
637    #[cfg(feature = "hoi4")] SpawnPoint,
638    #[cfg(feature = "hoi4")] Specialization,
639    #[cfg(feature = "hoi4")] SpecialProject,
640    #[cfg(feature = "hoi4")] SpecialProjectTag,
641    #[cfg(feature = "hoi4")] ScientistTrait,
642    #[cfg(feature = "hoi4")] ShipName,
643    #[cfg(feature = "hoi4")] Sprite,
644    #[cfg(feature = "hoi4")] State,
645    #[cfg(feature = "hoi4")] StateCategory,
646    #[cfg(feature = "hoi4")] SubUnit,
647    #[cfg(feature = "hoi4")] SubUnitCategory,
648    #[cfg(feature = "hoi4")] SupplyArea,
649    #[cfg(feature = "hoi4")] TechnologyCategory,
650    #[cfg(feature = "hoi4")] TechnologyFolder,
651    #[cfg(feature = "hoi4")] TechnologySharing,
652    #[cfg(feature = "hoi4")] UnitHistory,
653    #[cfg(feature = "hoi4")] UnitLeaderSkill,
654    #[cfg(feature = "hoi4")] UnitLeaderTrait,
655    #[cfg(feature = "hoi4")] UnitNames,
656}
657
658/// Display items in `separated word case` for maximum friendliness.
659///
660/// Unfortunately there's no option for this in `strum` so we have to roll our own
661/// by using `snake_case` and changing the `_` to a space.
662impl Display for Item {
663    fn fmt(&self, f: &mut Formatter) -> Result<(), std::fmt::Error> {
664        let s: &'static str = self.into();
665        write!(f, "{}", s.replace('_', " "))
666    }
667}
668
669impl Item {
670    /// Returns a path where items of this type are kept in the script files. Can be `""` for items
671    /// that are built in.
672    ///
673    /// These paths are used both for the user in error reports, and to find the items when loading them.
674    pub fn path(self) -> &'static str {
675        #[allow(clippy::match_same_arms)]
676        // These variants are in the same order as the Item enum declaration
677        match self {
678            #[cfg(feature = "jomini")]
679            Item::Accessory => "gfx/portraits/accessories/",
680            #[cfg(feature = "jomini")]
681            Item::AccessoryTag => "gfx/portraits/accessories/",
682            #[cfg(feature = "jomini")]
683            Item::AccessoryVariation => "gfx/portraits/accessory_variations/",
684            #[cfg(feature = "jomini")]
685            Item::AccessoryVariationLayout => "gfx/portraits/accessory_variations/",
686            #[cfg(feature = "jomini")]
687            Item::AccessoryVariationTextures => "gfx/portraits/accessory_variations/",
688            Item::Achievement => match Game::game() {
689                #[cfg(feature = "ck3")]
690                Game::Ck3 => "common/achievements/",
691                #[cfg(feature = "vic3")]
692                Game::Vic3 => "common/achievements/",
693                #[cfg(feature = "imperator")]
694                Game::Imperator => "common/achievements/",
695                #[cfg(feature = "hoi4")]
696                Game::Hoi4 => "common/achievements.txt",
697            },
698            #[cfg(feature = "jomini")]
699            Item::AchievementGroup => "common/achievement_groups.txt",
700            Item::Asset => "gfx/models/",
701            Item::BlendShape => "gfx/models/",
702            #[cfg(feature = "jomini")]
703            Item::CharacterInteraction => "common/character_interactions/",
704            #[cfg(feature = "jomini")]
705            Item::Coa => "common/coat_of_arms/coat_of_arms/",
706            #[cfg(feature = "jomini")]
707            Item::CoaColorList => "common/coat_of_arms/template_lists/",
708            #[cfg(feature = "jomini")]
709            Item::CoaColoredEmblemList => "common/coat_of_arms/template_lists/",
710            #[cfg(feature = "ck3")]
711            Item::CoaDesignerColorPalette => "gfx/coat_of_arms/color_palettes/",
712            #[cfg(feature = "jomini")]
713            Item::CoaDesignerColoredEmblem => "gfx/coat_of_arms/colored_emblems/",
714            #[cfg(feature = "ck3")]
715            Item::CoaDesignerEmblemLayout => "gfx/coat_of_arms/emblem_layouts/",
716            #[cfg(feature = "jomini")]
717            Item::CoaDesignerPattern => "gfx/coat_of_arms/patterns/",
718            #[cfg(feature = "jomini")]
719            Item::CoaPatternList => "common/coat_of_arms/template_lists/",
720            #[cfg(feature = "jomini")]
721            Item::CoaTemplate => "common/coat_of_arms/coat_of_arms/",
722            #[cfg(feature = "jomini")]
723            Item::CoaTemplateList => "common/coat_of_arms/template_lists/",
724            #[cfg(feature = "jomini")]
725            Item::CoaTexturedEmblemList => "common/coat_of_arms/template_lists/",
726            #[cfg(feature = "jomini")]
727            Item::Culture => match Game::game() {
728                #[cfg(feature = "ck3")]
729                Game::Ck3 => "common/culture/cultures/",
730                #[cfg(feature = "vic3")]
731                Game::Vic3 => "common/cultures/",
732                #[cfg(feature = "imperator")]
733                Game::Imperator => "common/cultures/",
734                #[cfg(feature = "hoi4")]
735                Game::Hoi4 => unreachable!(),
736            },
737            #[cfg(feature = "jomini")]
738            Item::CustomLocalization => "common/customizable_localization/",
739            Item::Decision => match Game::game() {
740                #[cfg(feature = "ck3")]
741                Game::Ck3 => "common/decisions/",
742                #[cfg(feature = "vic3")]
743                Game::Vic3 => "common/decisions/",
744                #[cfg(feature = "imperator")]
745                Game::Imperator => "decisions/",
746                #[cfg(feature = "hoi4")]
747                Game::Hoi4 => "common/decisions/",
748            },
749            Item::Define => "common/defines/",
750            Item::Dlc => "dlc_metadata/",
751            Item::DlcFeature => "",
752            Item::DlcName => "dlc_metadata/",
753            Item::Directory => "",
754            #[cfg(feature = "jomini")]
755            Item::EffectLocalization => "common/effect_localization/",
756            Item::Entity => "gfx/models/",
757            Item::Entry => "",
758            #[cfg(feature = "jomini")]
759            Item::Ethnicity => "common/ethnicities/",
760            Item::Event => "events/",
761            Item::EventNamespace => "events/",
762            Item::File => "",
763            Item::Font => "fonts/",
764            Item::Fontfiles => "fonts/",
765            #[cfg(feature = "jomini")]
766            Item::GameConcept => "common/game_concepts/",
767            Item::GameRule => "common/game_rules/",
768            Item::GameRuleSetting => "common/game_rules/",
769            #[cfg(feature = "jomini")]
770            Item::GeneAgePreset => "common/genes/",
771            #[cfg(feature = "jomini")]
772            Item::GeneAttribute => "gfx/models/",
773            #[cfg(feature = "jomini")]
774            Item::GeneCategory => "common/genes/",
775            #[cfg(feature = "jomini")]
776            Item::GovernmentType => match Game::game() {
777                #[cfg(feature = "ck3")]
778                Game::Ck3 => "common/governments/",
779                #[cfg(feature = "vic3")]
780                Game::Vic3 => "common/government_types/",
781                #[cfg(feature = "imperator")]
782                Game::Imperator => "common/governments/",
783                #[cfg(feature = "hoi4")]
784                Game::Hoi4 => unreachable!(),
785            },
786            Item::GuiLayer => "gui/",
787            Item::GuiTemplate => "gui/",
788            Item::GuiType => "gui/",
789            Item::Localization => "localization/",
790            Item::MapEnvironment => "gfx/map/environment/",
791            Item::MapMode => "gfx/map/map_modes/",
792            Item::Modifier => match Game::game() {
793                #[cfg(feature = "ck3")]
794                Game::Ck3 => "common/modifiers/",
795                #[cfg(feature = "vic3")]
796                Game::Vic3 => "common/static_modifiers/",
797                #[cfg(feature = "imperator")]
798                Game::Imperator => "common/modifiers/",
799                #[cfg(feature = "hoi4")]
800                Game::Hoi4 => "common/modifiers/", // TODO HOI4
801            },
802            Item::Music => "music/",
803            #[cfg(feature = "jomini")]
804            Item::MusicPlayerCategory => "music/music_player_categories/",
805            #[cfg(feature = "jomini")]
806            Item::NamedColor => "common/named_colors/",
807            Item::OnAction => match Game::game() {
808                #[cfg(feature = "ck3")]
809                Game::Ck3 => "common/on_action/",
810                #[cfg(feature = "vic3")]
811                Game::Vic3 => "common/on_actions/",
812                #[cfg(feature = "imperator")]
813                Game::Imperator => "common/on_action/",
814                #[cfg(feature = "hoi4")]
815                Game::Hoi4 => "common/on_actions/", // TODO HOI4
816            },
817            Item::Pdxmesh => "gfx/models/",
818            #[cfg(feature = "jomini")]
819            Item::PortraitAnimation => "gfx/portraits/portrait_animations/",
820            #[cfg(feature = "jomini")]
821            Item::PortraitCamera => "gfx/portraits/cameras/",
822            #[cfg(feature = "jomini")]
823            Item::PortraitEnvironment => "gfx/portraits/environments/",
824            #[cfg(feature = "jomini")]
825            Item::PortraitModifierGroup => "gfx/portraits/portrait_modifiers/",
826            #[cfg(feature = "jomini")]
827            Item::PortraitModifierPack => "gfx/portraits/portrait_animations/",
828            Item::Province => match Game::game() {
829                #[cfg(feature = "ck3")]
830                Game::Ck3 => "map_data/definition.csv",
831                #[cfg(feature = "vic3")]
832                Game::Vic3 => "map_data/provinces.png",
833                #[cfg(feature = "imperator")]
834                Game::Imperator => "map_data/provinces.png",
835                #[cfg(feature = "hoi4")]
836                Game::Hoi4 => "map/definition.csv", // TODO HOI4
837            },
838            #[cfg(feature = "jomini")]
839            Item::Religion => match Game::game() {
840                #[cfg(feature = "ck3")]
841                Game::Ck3 => "common/religion/religions/",
842                #[cfg(feature = "vic3")]
843                Game::Vic3 => "common/religions/",
844                #[cfg(feature = "imperator")]
845                Game::Imperator => "common/religions/",
846                #[cfg(feature = "hoi4")]
847                Game::Hoi4 => unreachable!(),
848            },
849            Item::ScriptedEffect => "common/scripted_effects/",
850            Item::ScriptedGui => "common/scripted_guis/",
851            #[cfg(feature = "jomini")]
852            Item::ScriptedList => "common/scripted_lists/",
853            #[cfg(feature = "jomini")]
854            Item::ScriptedModifier => "common/scripted_modifiers/",
855            #[cfg(feature = "jomini")]
856            Item::ScriptedRule => "common/scripted_rules/",
857            Item::ScriptedTrigger => "common/scripted_triggers/",
858            #[cfg(feature = "jomini")]
859            Item::ScriptValue => "common/script_values/",
860            Item::Shortcut => "gui/shortcuts.shortcuts",
861            Item::Sound => match Game::game() {
862                #[cfg(feature = "hoi4")]
863                Game::Hoi4 => "sound/",
864                #[cfg(feature = "jomini")]
865                _ => "",
866            },
867            Item::Terrain => match Game::game() {
868                #[cfg(feature = "ck3")]
869                Game::Ck3 => "common/terrain_types/",
870                #[cfg(feature = "vic3")]
871                Game::Vic3 => "common/terrain/",
872                #[cfg(feature = "imperator")]
873                Game::Imperator => "common/terrain_types/",
874                #[cfg(feature = "hoi4")]
875                Game::Hoi4 => "common/terrain/",
876            },
877            Item::TextFormat => "gui/",
878            Item::TextIcon => "gui/",
879            Item::TextureFile => "gfx/models/",
880            #[cfg(feature = "jomini")]
881            Item::TriggerLocalization => "common/trigger_localization/",
882            Item::WidgetName => "gui/",
883
884            #[cfg(any(feature = "vic3", feature = "hoi4"))]
885            Item::AiStrategy => match Game::game() {
886                #[cfg(feature = "vic3")]
887                Game::Vic3 => "common/ai_strategies/",
888                #[cfg(feature = "hoi4")]
889                Game::Hoi4 => "common/ai_strategy/",
890                #[allow(unreachable_patterns)]
891                _ => unreachable!(),
892            },
893            #[cfg(any(feature = "ck3", feature = "imperator", feature = "hoi4"))]
894            Item::Building => "common/buildings/",
895            #[cfg(any(feature = "ck3", feature = "hoi4"))]
896            Item::Character => match Game::game() {
897                #[cfg(feature = "ck3")]
898                Game::Ck3 => "history/characters/",
899                #[cfg(feature = "hoi4")]
900                Game::Hoi4 => "common/characters/",
901                #[allow(unreachable_patterns)]
902                _ => unreachable!(),
903            },
904            #[cfg(any(feature = "ck3", feature = "vic3"))]
905            Item::CharacterTemplate => match Game::game() {
906                #[cfg(feature = "ck3")]
907                Game::Ck3 => "common/scripted_character_templates/",
908                #[cfg(feature = "vic3")]
909                Game::Vic3 => "common/character_templates/",
910                #[allow(unreachable_patterns)]
911                _ => unreachable!(),
912            },
913            #[cfg(any(feature = "vic3", feature = "imperator"))]
914            Item::CharacterTrait => match Game::game() {
915                #[cfg(feature = "vic3")]
916                Game::Vic3 => "common/character_traits/",
917                #[cfg(feature = "imperator")]
918                Game::Imperator => "common/traits/",
919                #[allow(unreachable_patterns)]
920                _ => unreachable!(),
921            },
922            #[cfg(any(feature = "imperator", feature = "hoi4"))]
923            Item::CombatTactic => match Game::game() {
924                #[cfg(feature = "imperator")]
925                Game::Imperator => "common/combat_tactics/",
926                #[cfg(feature = "hoi4")]
927                Game::Hoi4 => "common/combat_tactics.txt", // TODO HOI4
928                #[allow(unreachable_patterns)]
929                _ => unreachable!(),
930            },
931            #[cfg(any(feature = "vic3", feature = "imperator", feature = "hoi4"))]
932            Item::Country => match Game::game() {
933                #[cfg(feature = "vic3")]
934                Game::Vic3 => "common/country_definitions/",
935                #[cfg(feature = "imperator")]
936                Game::Imperator => "setup/countries/countries.txt",
937                #[cfg(feature = "hoi4")]
938                Game::Hoi4 => "common/countries/", // TODO HOI4
939                #[allow(unreachable_patterns)]
940                _ => unreachable!(),
941            },
942            #[cfg(any(feature = "ck3", feature = "imperator"))]
943            Item::DeathReason => "common/deathreasons/",
944            #[cfg(any(feature = "ck3", feature = "vic3"))]
945            Item::Dna => "common/dna_data/",
946            #[cfg(any(feature = "ck3", feature = "imperator"))]
947            Item::EventTheme => "common/event_themes/",
948            #[cfg(any(feature = "imperator", feature = "hoi4"))]
949            Item::Idea => "common/ideas/", // TODO HOI4
950            #[cfg(any(feature = "vic3", feature = "hoi4"))]
951            Item::Ideology => "common/ideologies/",
952            #[cfg(any(feature = "ck3", feature = "imperator"))]
953            Item::Law => "common/laws/",
954            #[cfg(any(feature = "ck3", feature = "vic3", feature = "imperator"))]
955            Item::LawGroup => match Game::game() {
956                #[cfg(feature = "ck3")]
957                Game::Ck3 => "common/laws/",
958                #[cfg(feature = "imperator")]
959                Game::Imperator => "common/laws/",
960                #[cfg(feature = "vic3")]
961                Game::Vic3 => "common/law_groups/",
962                #[allow(unreachable_patterns)]
963                _ => unreachable!(),
964            },
965            #[cfg(any(feature = "ck3", feature = "vic3"))]
966            Item::Message => "common/messages",
967            #[cfg(any(feature = "imperator", feature = "hoi4"))]
968            Item::Mission => match Game::game() {
969                #[cfg(feature = "imperator")]
970                Game::Imperator => "common/missions/",
971                #[cfg(feature = "hoi4")]
972                Game::Hoi4 => "common/script_enums.txt",
973                #[allow(unreachable_patterns)]
974                _ => unreachable!(),
975            },
976            #[cfg(any(feature = "vic3", feature = "imperator"))]
977            Item::PopType => "common/pop_types/",
978            #[cfg(any(feature = "ck3", feature = "imperator"))]
979            Item::Region => match Game::game() {
980                #[cfg(feature = "ck3")]
981                Game::Ck3 => "map_data/geographical_regions/",
982                #[cfg(feature = "imperator")]
983                Game::Imperator => "map_data/regions.txt",
984                #[allow(unreachable_patterns)]
985                _ => unreachable!(),
986            },
987            #[cfg(any(feature = "vic3", feature = "hoi4"))]
988            Item::StrategicRegion => match Game::game() {
989                #[cfg(feature = "vic3")]
990                Game::Vic3 => "common/strategic_regions/",
991                #[cfg(feature = "hoi4")]
992                Game::Hoi4 => "map/strategicregions/",
993                #[allow(unreachable_patterns)]
994                _ => unreachable!(),
995            },
996            #[cfg(any(feature = "vic3", feature = "imperator"))]
997            Item::SubjectType => "common/subject_types/",
998            #[cfg(any(feature = "vic3", feature = "hoi4"))]
999            Item::Technology => match Game::game() {
1000                #[cfg(feature = "vic3")]
1001                Game::Vic3 => "common/technology/technologies/",
1002                #[cfg(feature = "hoi4")]
1003                Game::Hoi4 => "common/technologies/",
1004                #[allow(unreachable_patterns)]
1005                _ => unreachable!(),
1006            },
1007            #[cfg(any(feature = "ck3", feature = "vic3"))]
1008            Item::TutorialLesson => "common/tutorial_lessons",
1009            #[cfg(any(feature = "ck3", feature = "vic3"))]
1010            Item::TutorialLessonChain => "common/tutorial_lesson_chains",
1011            #[cfg(any(feature = "ck3", feature = "vic3"))]
1012            Item::TutorialLessonStep => "common/tutorial_lessons",
1013
1014            #[cfg(feature = "ck3")]
1015            Item::AccoladeCategory => "common/accolade_types/",
1016            #[cfg(feature = "ck3")]
1017            Item::AccoladeIcon => "common/accolade_icons/",
1018            #[cfg(feature = "ck3")]
1019            Item::AccoladeName => "common/accolade_names/",
1020            #[cfg(feature = "ck3")]
1021            Item::AccoladeParameter => "common/accolade_types/",
1022            #[cfg(feature = "ck3")]
1023            Item::AccoladeType => "common/accolade_types/",
1024            #[cfg(feature = "ck3")]
1025            Item::ActivityGroupType => "common/activities/activity_group_types/",
1026            #[cfg(feature = "ck3")]
1027            Item::ActivityIntent => "common/activities/intents/",
1028            #[cfg(feature = "ck3")]
1029            Item::ActivityLocale => "common/activities/activity_locales/",
1030            #[cfg(feature = "ck3")]
1031            Item::ActivityOption => "common/activities/activity_types/",
1032            #[cfg(feature = "ck3")]
1033            Item::ActivityOptionCategory => "common/activities/activity_types/",
1034            #[cfg(feature = "ck3")]
1035            Item::ActivityPhase => "common/activities/activity_types/",
1036            #[cfg(feature = "ck3")]
1037            Item::ActivityPulseAction => "common/activities/pulse_actions/",
1038            #[cfg(feature = "ck3")]
1039            Item::ActivityState => "",
1040            #[cfg(feature = "ck3")]
1041            Item::ActivityType => "common/activities/activity_types/",
1042            #[cfg(feature = "ck3")]
1043            Item::AiWarStance => "common/ai_war_stances/",
1044            #[cfg(feature = "ck3")]
1045            Item::AgentType => "common/schemes/agent_types/",
1046            #[cfg(feature = "ck3")]
1047            Item::Amenity => "common/court_amenities/",
1048            #[cfg(feature = "ck3")]
1049            Item::AmenitySetting => "common/court_amenities/",
1050            #[cfg(feature = "ck3")]
1051            Item::ArtifactBlueprint => "common/artifacts/blueprints/",
1052            #[cfg(feature = "ck3")]
1053            Item::ArtifactFeature => "common/artifacts/features/",
1054            #[cfg(feature = "ck3")]
1055            Item::ArtifactFeatureGroup => "common/artifacts/feature_groups/",
1056            #[cfg(feature = "ck3")]
1057            Item::ArtifactHistory => "",
1058            #[cfg(feature = "ck3")]
1059            Item::ArtifactRarity => "",
1060            #[cfg(feature = "ck3")]
1061            Item::ArtifactSlot => "common/artifacts/slots/",
1062            #[cfg(feature = "ck3")]
1063            Item::ArtifactSlotType => "common/artifacts/slots/",
1064            #[cfg(feature = "ck3")]
1065            Item::ArtifactTemplate => "common/artifacts/templates/",
1066            #[cfg(feature = "ck3")]
1067            Item::ArtifactType => "common/artifacts/types/",
1068            #[cfg(feature = "ck3")]
1069            Item::ArtifactVisual => "common/artifacts/visuals/",
1070            #[cfg(feature = "ck3")]
1071            Item::Bookmark => "common/bookmarks/bookmarks/",
1072            #[cfg(feature = "ck3")]
1073            Item::BookmarkGroup => "common/bookmarks/groups/",
1074            #[cfg(feature = "ck3")]
1075            Item::BookmarkPortrait => "common/bookmark_portraits/",
1076            #[cfg(feature = "ck3")]
1077            Item::BooleanHouseHeadParameter => "common/house_aspirations/",
1078            #[cfg(feature = "ck3")]
1079            Item::BooleanHousePowerParameter => "common/house_aspirations/",
1080            #[cfg(feature = "ck3")]
1081            Item::BooleanHouseRelationParameter => "common/house_relation_types/",
1082            #[cfg(feature = "ck3")]
1083            Item::BuildingFlag => "common/buildings/",
1084            #[cfg(feature = "ck3")]
1085            Item::BuildingGfx => "common/culture/cultures/",
1086            #[cfg(feature = "ck3")]
1087            Item::CasusBelli => "common/casus_belli_types/",
1088            #[cfg(feature = "ck3")]
1089            Item::CasusBelliGroup => "common/casus_belli_groups/",
1090            #[cfg(feature = "ck3")]
1091            Item::Catalyst => "common/struggle/catalysts/",
1092            #[cfg(feature = "ck3")]
1093            Item::ChallengeCharacter => "common/bookmarks/challenge_characters/",
1094            #[cfg(feature = "ck3")]
1095            Item::CharacterBackground => "common/character_backgrounds/",
1096            #[cfg(feature = "ck3")]
1097            Item::CharacterInteractionCategory => "common/character_interaction_categories/",
1098            #[cfg(feature = "ck3")]
1099            Item::Climate => "map_data/climate.txt",
1100            #[cfg(feature = "ck3")]
1101            Item::ClothingGfx => "common/culture/cultures/",
1102            #[cfg(feature = "ck3")]
1103            Item::CoaGfx => "common/culture/cultures/",
1104            #[cfg(feature = "ck3")]
1105            Item::CoaDynamicDefinition => "common/coat_of_arms/dynamic_definitions/",
1106            #[cfg(feature = "ck3")]
1107            Item::CohesionLevelParameter => "common/confederation_types/",
1108            #[cfg(feature = "ck3")]
1109            Item::CombatEffect => "common/combat_effects/",
1110            #[cfg(feature = "ck3")]
1111            Item::CombatPhaseEvent => "common/combat_phase_events/",
1112            #[cfg(feature = "ck3")]
1113            Item::ConfederationType => "common/confederation_types/",
1114            #[cfg(feature = "ck3")]
1115            Item::ConnectionArrow => "common/connection_arrows/",
1116            #[cfg(feature = "ck3")]
1117            Item::CouncilPosition => "common/council_positions/",
1118            #[cfg(feature = "ck3")]
1119            Item::CouncilTask => "common/council_tasks/",
1120            #[cfg(feature = "ck3")]
1121            Item::Countermeasure => "common/schemes/scheme_countermeasures/",
1122            #[cfg(feature = "ck3")]
1123            Item::CountermeasureParameter => "common/schemes/scheme_countermeasures/",
1124            #[cfg(feature = "ck3")]
1125            Item::CourtPosition => "common/court_positions/types/",
1126            #[cfg(feature = "ck3")]
1127            Item::CourtPositionTask => "common/court_positions/tasks/",
1128            #[cfg(feature = "ck3")]
1129            Item::CourtSceneCulture => "gfx/court_scene/scene_cultures/",
1130            #[cfg(feature = "ck3")]
1131            Item::CourtSceneGroup => "gfx/court_scene/character_groups/",
1132            #[cfg(feature = "ck3")]
1133            Item::CourtSceneRole => "gfx/court_scene/character_roles/",
1134            #[cfg(feature = "ck3")]
1135            Item::CourtSceneSetting => "gfx/court_scene/scene_settings/",
1136            #[cfg(feature = "ck3")]
1137            Item::CourtType => "common/court_types/",
1138            #[cfg(feature = "ck3")]
1139            Item::CourtierGuestManagement => "common/courtier_guest_management/",
1140            #[cfg(feature = "ck3")]
1141            Item::CultureAesthetic => "common/culture/aesthetics_bundles/",
1142            #[cfg(feature = "ck3")]
1143            Item::CultureCreationName => "common/culture/creation_names/",
1144            #[cfg(feature = "ck3")]
1145            Item::CultureEra => "common/culture/eras/",
1146            #[cfg(feature = "ck3")]
1147            Item::CultureEthos => "common/culture/pillars/",
1148            #[cfg(feature = "ck3")]
1149            Item::CultureHeritage => "common/culture/pillars/",
1150            #[cfg(feature = "ck3")]
1151            Item::CultureHistory => "history/cultures/",
1152            #[cfg(feature = "ck3")]
1153            // This is ugly since it isn't a path, but the path won't be used except in messages.
1154            Item::CultureParameter => "common/culture/ parameters blocks",
1155            #[cfg(feature = "ck3")]
1156            Item::CulturePillar => "common/culture/pillars/",
1157            #[cfg(feature = "ck3")]
1158            Item::CultureTradition => "common/culture/traditions/",
1159            #[cfg(feature = "ck3")]
1160            Item::CultureTraditionCategory => "common/culture/traditions/",
1161            #[cfg(feature = "ck3")]
1162            Item::DangerType => "",
1163            #[cfg(feature = "ck3")]
1164            Item::DecisionGroup => "common/decision_group_types/",
1165            #[cfg(feature = "ck3")]
1166            Item::DiarchyMandate => "common/diarchies/diarchy_mandates/",
1167            #[cfg(feature = "ck3")]
1168            Item::DiarchyParameter => "common/diarchies/diarchy_types/",
1169            #[cfg(feature = "ck3")]
1170            Item::DiarchyType => "common/diarchies/diarchy_types/",
1171            #[cfg(feature = "ck3")]
1172            Item::Doctrine => "common/religion/doctrines/",
1173            #[cfg(feature = "ck3")]
1174            Item::DoctrineBooleanParameter => "common/religion/doctrines/",
1175            #[cfg(feature = "ck3")]
1176            Item::DoctrineCategory => "common/religion/doctrines/",
1177            #[cfg(feature = "ck3")]
1178            Item::DoctrineParameter => "common/religion/doctrines/",
1179            #[cfg(feature = "ck3")]
1180            Item::DomicileBuilding => "common/domiciles/buildings/",
1181            #[cfg(feature = "ck3")]
1182            Item::DomicileParameter => "common/domiciles/buildings/",
1183            #[cfg(feature = "ck3")]
1184            Item::DomicileType => "common/domiciles/types/",
1185            #[cfg(feature = "ck3")]
1186            Item::Dynasty => "common/dynasties/",
1187            #[cfg(feature = "ck3")]
1188            Item::DynastyLegacy => "common/dynasty_legacies/",
1189            #[cfg(feature = "ck3")]
1190            Item::DynastyPerk => "common/dynasty_perks/",
1191            #[cfg(feature = "ck3")]
1192            Item::EpidemicType => "common/epidemics/",
1193            #[cfg(feature = "ck3")]
1194            Item::EpidemicDeathReason => "common/deathreasons/",
1195            #[cfg(feature = "ck3")]
1196            Item::EventBackground => "common/event_backgrounds/",
1197            #[cfg(feature = "ck3")]
1198            Item::EventEffect2d => "common/event_2d_effects/",
1199            #[cfg(feature = "ck3")]
1200            Item::EventTransition => "common/event_transitions/",
1201            #[cfg(feature = "ck3")]
1202            Item::Faith => "common/religion/religions/",
1203            #[cfg(feature = "ck3")]
1204            Item::FaithIcon => "common/religion/religions/",
1205            #[cfg(feature = "ck3")]
1206            Item::FervorModifier => "common/religion/fervor_modifiers/",
1207            #[cfg(feature = "ck3")]
1208            Item::Faction => "common/factions/",
1209            #[cfg(feature = "ck3")]
1210            Item::Flavorization => "common/flavorization/",
1211            #[cfg(feature = "ck3")]
1212            Item::Focus => "common/focuses/",
1213            #[cfg(feature = "ck3")]
1214            Item::GeneticConstraint => "common/traits/",
1215            #[cfg(feature = "ck3")]
1216            Item::GovernmentFlag => "common/governments/",
1217            #[cfg(feature = "ck3")]
1218            Item::GraphicalFaith => "common/religion/religions/",
1219            #[cfg(feature = "ck3")]
1220            Item::GraphicalUnitType => "common/graphical_unit_types/",
1221            #[cfg(feature = "ck3")]
1222            Item::GreatProjectType => "common/great_projects/types/",
1223            #[cfg(feature = "ck3")]
1224            Item::GuestInviteRule => "common/activities/guest_invite_rules/",
1225            #[cfg(feature = "ck3")]
1226            Item::GuestSubset => "common/activities/activity_types/",
1227            #[cfg(feature = "ck3")]
1228            Item::GuestSystem => "common/guest_system/",
1229            #[cfg(feature = "ck3")]
1230            Item::HeadDetermination => "common/culture/pillars/",
1231            #[cfg(feature = "ck3")]
1232            Item::HoldingParameter => "common/holdings/",
1233            #[cfg(feature = "ck3")]
1234            Item::HoldingType => "common/holdings/",
1235            #[cfg(feature = "ck3")]
1236            Item::HolySite => "common/religion/holy_sites/",
1237            #[cfg(feature = "ck3")]
1238            Item::HolySiteFlag => "common/religion/holy_sites/",
1239            #[cfg(feature = "ck3")]
1240            Item::Hook => "common/hook_types/",
1241            #[cfg(feature = "ck3")]
1242            Item::House => "common/dynasty_houses/",
1243            #[cfg(feature = "ck3")]
1244            Item::HouseAspiration => "common/house_aspirations/",
1245            #[cfg(feature = "ck3")]
1246            Item::HouseRelationLevel => "common/house_relation_types/",
1247            #[cfg(feature = "ck3")]
1248            Item::HouseRelationType => "common/house_relation_types/",
1249            #[cfg(feature = "ck3")]
1250            Item::HouseUnity => "common/house_unities/",
1251            #[cfg(feature = "ck3")]
1252            Item::HouseUnityParameter => "common/house_unities",
1253            #[cfg(feature = "ck3")]
1254            Item::HouseUnityStage => "common/house_unities/",
1255            #[cfg(feature = "ck3")]
1256            Item::ImportantAction => "common/important_actions/",
1257            #[cfg(feature = "ck3")]
1258            Item::Innovation => "common/culture/innovations/",
1259            #[cfg(feature = "ck3")]
1260            Item::InnovationFlag => "common/culture/innovations/",
1261            #[cfg(feature = "ck3")]
1262            Item::InnovationParameter => "common/culture/innovations/",
1263            #[cfg(feature = "ck3")]
1264            Item::Inspiration => "common/inspirations/",
1265            #[cfg(feature = "ck3")]
1266            Item::Language => "common/culture/pillars/",
1267            #[cfg(feature = "ck3")]
1268            Item::LawFlag => "common/laws/",
1269            #[cfg(feature = "ck3")]
1270            Item::LeaseContract => "common/lease_contracts/",
1271            #[cfg(feature = "ck3")]
1272            Item::LegendChapter => "common/legends/chronicles/",
1273            #[cfg(feature = "ck3")]
1274            Item::LegendChronicle => "common/legends/chronicles/",
1275            #[cfg(feature = "ck3")]
1276            Item::LegendProperty => "common/legends/chronicles/",
1277            #[cfg(feature = "ck3")]
1278            Item::LegendSeed => "common/legends/legend_seeds/",
1279            #[cfg(feature = "ck3")]
1280            Item::LegendType => "common/legends/legend_types/",
1281            #[cfg(feature = "ck3")]
1282            Item::LegitimacyFlag => "common/legitimacy/",
1283            #[cfg(feature = "ck3")]
1284            Item::LegitimacyType => "common/legitimacy/",
1285            #[cfg(feature = "ck3")]
1286            Item::Lifestyle => "common/lifestyles/",
1287            #[cfg(feature = "ck3")]
1288            Item::LineType => "gfx/lines/lines.lines",
1289            #[cfg(feature = "ck3")]
1290            Item::MartialCustom => "common/culture/pillars/",
1291            #[cfg(feature = "ck3")]
1292            Item::MemoryCategory => "common/character_memory_types/",
1293            #[cfg(feature = "ck3")]
1294            Item::MemoryType => "common/character_memory_types/",
1295            #[cfg(feature = "ck3")]
1296            Item::MenAtArms => "common/men_at_arms_types/",
1297            #[cfg(feature = "ck3")]
1298            Item::MenAtArmsBase => "common/men_at_arms_types/",
1299            #[cfg(feature = "ck3")]
1300            Item::MessageFilterType => "common/message_filter_types/",
1301            #[cfg(feature = "ck3")]
1302            Item::MessageGroupType => "common/message_group_types/",
1303            #[cfg(feature = "ck3")]
1304            Item::ModifierFormat => "common/modifier_definition_formats/",
1305            #[cfg(feature = "ck3")]
1306            Item::MottoInsert => "common/dynasty_house_motto_inserts/",
1307            #[cfg(feature = "ck3")]
1308            Item::Motto => "common/dynasty_house_mottos/",
1309            #[cfg(feature = "ck3")]
1310            Item::NameEquivalency => "common/culture/name_equivalency/",
1311            #[cfg(feature = "ck3")]
1312            Item::NameList => "common/culture/name_lists/",
1313            #[cfg(feature = "ck3")]
1314            Item::Nickname => "common/nicknames/",
1315            #[cfg(feature = "ck3")]
1316            Item::OpinionModifier => "common/opinion_modifiers/",
1317            #[cfg(feature = "ck3")]
1318            Item::Perk => "common/lifestyle_perks/",
1319            #[cfg(feature = "ck3")]
1320            Item::PerkTree => "common/lifestyle_perks/",
1321            #[cfg(feature = "ck3")]
1322            Item::PlayableDifficultyInfo => "common/playable_difficulty_infos/",
1323            #[cfg(feature = "ck3")]
1324            Item::PointOfInterest => "common/travel/point_of_interest_types/",
1325            #[cfg(feature = "ck3")]
1326            Item::PoolSelector => "common/pool_character_selectors/",
1327            #[cfg(feature = "ck3")]
1328            Item::PortraitType => "common/portrait_types/",
1329            #[cfg(feature = "ck3")]
1330            Item::ProjectContribution => "common/great_projects/types/",
1331            #[cfg(feature = "ck3")]
1332            Item::ProvinceEffect => "gfx/map/province_effects/",
1333            #[cfg(feature = "ck3")]
1334            Item::ProvinceMapping => "history/province_mapping/",
1335            #[cfg(feature = "ck3")]
1336            Item::PrisonType => "",
1337            #[cfg(feature = "ck3")]
1338            Item::RaidIntent => "common/raids/intents/",
1339            #[cfg(feature = "ck3")]
1340            Item::Relation => "common/scripted_relations/",
1341            #[cfg(feature = "ck3")]
1342            Item::RelationFlag => "common/scripted_relations/",
1343            #[cfg(feature = "ck3")]
1344            Item::ReligionFamily => "common/religion/religion_families/",
1345            #[cfg(feature = "ck3")]
1346            Item::RewardItem => "",
1347            #[cfg(feature = "ck3")]
1348            Item::RulerObjectiveType => "common/ruler_objective_advice_types/",
1349            #[cfg(feature = "ck3")]
1350            Item::SubjectContract => "common/subject_contracts/contracts/",
1351            #[cfg(feature = "ck3")]
1352            Item::SubjectContractFlag => "common/subject_contracts/contracts/",
1353            #[cfg(feature = "ck3")]
1354            Item::SubjectContractGroup => "common/subject_contracts/groups/",
1355            #[cfg(feature = "ck3")]
1356            Item::SubjectContractObligationLevel => "common/subject_contracts/contracts/",
1357            #[cfg(feature = "ck3")]
1358            Item::Scheme => "common/schemes/scheme_types",
1359            #[cfg(feature = "ck3")]
1360            Item::SchemePulseAction => "common/schemes/pulse_actions",
1361            #[cfg(feature = "ck3")]
1362            Item::ScriptedAnimation => "common/scripted_animations/",
1363            #[cfg(feature = "ck3")]
1364            Item::ScriptedCost => "common/scripted_costs/",
1365            #[cfg(feature = "ck3")]
1366            Item::ScriptedIllustration => "gfx/interface/illustrations/scripted_illustrations/",
1367            #[cfg(feature = "ck3")]
1368            Item::Secret => "common/secret_types/",
1369            #[cfg(feature = "ck3")]
1370            Item::Sexuality => "",
1371            #[cfg(feature = "ck3")]
1372            Item::Situation => "common/situation/situations/",
1373            #[cfg(feature = "ck3")]
1374            Item::SituationCatalyst => "common/situation/catalysts/",
1375            #[cfg(feature = "ck3")]
1376            Item::SituationGroupType => "common/situation/situation_group_types/",
1377            #[cfg(feature = "ck3")]
1378            Item::SituationHistory => "history/situations/",
1379            #[cfg(feature = "ck3")]
1380            Item::SituationParticipantGroup => "common/situation/situations/",
1381            #[cfg(feature = "ck3")]
1382            Item::SituationParticipantGroupParameter => "common/situation/situations/",
1383            #[cfg(feature = "ck3")]
1384            Item::SituationPhase => "common/situation/situations/",
1385            #[cfg(feature = "ck3")]
1386            Item::SituationPhaseParameter => "common/situation/situations/",
1387            #[cfg(feature = "ck3")]
1388            Item::SituationSubRegion => "common/situation/situations/",
1389            #[cfg(feature = "ck3")]
1390            Item::Skill => "",
1391            #[cfg(feature = "ck3")]
1392            Item::SpecialBuilding => "common/buildings/",
1393            #[cfg(feature = "ck3")]
1394            Item::SpecialGuest => "common/activities/activity_types/",
1395            #[cfg(feature = "ck3")]
1396            Item::Story => "common/story_cycles/",
1397            #[cfg(feature = "ck3")]
1398            Item::Struggle => "common/struggle/struggles/",
1399            #[cfg(feature = "ck3")]
1400            Item::StruggleHistory => "history/struggles/",
1401            #[cfg(feature = "ck3")]
1402            Item::StrugglePhase => "common/struggle/struggles/",
1403            #[cfg(feature = "ck3")]
1404            Item::StrugglePhaseParameter => "common/struggle/struggles/",
1405            #[cfg(feature = "ck3")]
1406            Item::SuccessionAppointment => "common/succession_appointment/",
1407            #[cfg(feature = "ck3")]
1408            Item::SuccessionElection => "common/succession_election/",
1409            #[cfg(feature = "ck3")]
1410            Item::Suggestion => "common/suggestions/",
1411            #[cfg(feature = "ck3")]
1412            Item::TaskContractGroup => "common/task_contracts/",
1413            #[cfg(feature = "ck3")]
1414            Item::TaskContractReward => "common/task_contracts/",
1415            #[cfg(feature = "ck3")]
1416            Item::TaskContractType => "common/task_contracts/",
1417            #[cfg(feature = "ck3")]
1418            Item::TaxSlotObligation => "common/tax_slots/obligations",
1419            #[cfg(feature = "ck3")]
1420            Item::TaxSlotType => "common/tax_slots/types",
1421            #[cfg(feature = "ck3")]
1422            Item::Title => "common/landed_titles/",
1423            #[cfg(feature = "ck3")]
1424            Item::TitleHistory => "history/titles/",
1425            #[cfg(feature = "ck3")]
1426            Item::Trait => "common/traits/",
1427            #[cfg(feature = "ck3")]
1428            Item::TraitCategory => "",
1429            #[cfg(feature = "ck3")]
1430            Item::TraitFlag => "common/traits/",
1431            #[cfg(feature = "ck3")]
1432            Item::TraitPortraitModifier => "gfx/portraits/trait_portrait_modifiers",
1433            #[cfg(feature = "ck3")]
1434            Item::TraitTrack => "common/traits/",
1435            #[cfg(feature = "ck3")]
1436            Item::TravelOption => "common/travel/travel_options/",
1437            #[cfg(feature = "ck3")]
1438            Item::UnitGfx => "common/culture/cultures/",
1439            #[cfg(feature = "ck3")]
1440            Item::VassalStance => "common/vassal_stances/",
1441
1442            #[cfg(feature = "vic3")]
1443            Item::AcceptanceStatus => "common/acceptance_statuses/",
1444            #[cfg(feature = "vic3")]
1445            Item::AirGraphics => "gfx/map/air_graphics/",
1446            #[cfg(feature = "vic3")]
1447            Item::Alert => "common/alert_types",
1448            #[cfg(feature = "vic3")]
1449            Item::AlertGroup => "common/alert_groups",
1450            #[cfg(feature = "vic3")]
1451            Item::Amendment => "common/amendments/",
1452            #[cfg(feature = "vic3")]
1453            Item::Approval => "",
1454            #[cfg(feature = "vic3")]
1455            Item::ArmyDiorama => "gfx/map/army_dioramas/",
1456            #[cfg(feature = "vic3")]
1457            Item::Attitude => "",
1458            #[cfg(feature = "vic3")]
1459            Item::BattleCondition => "common/battle_conditions/",
1460            #[cfg(feature = "vic3")]
1461            Item::BuildingGroup => "common/building_groups/",
1462            #[cfg(feature = "vic3")]
1463            Item::BuildingType => "common/buildings/",
1464            #[cfg(feature = "vic3")]
1465            Item::BuyPackage => "common/buy_packages/",
1466            #[cfg(feature = "vic3")]
1467            Item::CanalType => "common/canals/",
1468            #[cfg(feature = "vic3")]
1469            Item::CharacterRole => "",
1470            #[cfg(feature = "vic3")]
1471            Item::CityBuildingVfx => "gfx/map/city_data/city_building_vfx/",
1472            #[cfg(feature = "vic3")]
1473            Item::CityCenterpiece => "gfx/map/city_data/city_centerpiece/",
1474            #[cfg(feature = "vic3")]
1475            Item::CityGraphicsType => "gfx/map/city_data/city_types/",
1476            #[cfg(feature = "vic3")]
1477            Item::CityVfx => "gfx/map/city_data/city_vfx/",
1478            #[cfg(feature = "vic3")]
1479            Item::CombatUnit => "common/combat_unit_types/",
1480            #[cfg(feature = "vic3")]
1481            Item::CombatUnitExperienceLevel => "common/combat_unit_experience_levels/",
1482            #[cfg(feature = "vic3")]
1483            Item::CombatUnitGroup => "common/combat_unit_groups/",
1484            #[cfg(feature = "vic3")]
1485            Item::CommanderOrder => "common/commander_orders/",
1486            #[cfg(feature = "vic3")]
1487            Item::CommanderRank => "common/commander_ranks/",
1488            #[cfg(feature = "vic3")]
1489            Item::CompanyType => "common/company_types/",
1490            #[cfg(feature = "vic3")]
1491            Item::CompanyCharterType => "common/company_charter_types/",
1492            #[cfg(feature = "vic3")]
1493            Item::CohesionLevel => "common/cohesion_levels/",
1494            #[cfg(feature = "vic3")]
1495            Item::CountryCreation => "common/country_creation/",
1496            #[cfg(feature = "vic3")]
1497            Item::CountryFormation => "common/country_formation/",
1498            #[cfg(feature = "vic3")]
1499            Item::CountryRank => "common/country_ranks/",
1500            #[cfg(feature = "vic3")]
1501            Item::CountryTier => "",
1502            #[cfg(feature = "vic3")]
1503            Item::CountryType => "common/country_types/",
1504            #[cfg(feature = "vic3")]
1505            Item::CultureGraphics => "common/culture_graphics/",
1506            #[cfg(feature = "vic3")]
1507            Item::Decree => "common/decrees/",
1508            #[cfg(feature = "vic3")]
1509            Item::DiplomaticAction => "common/diplomatic_actions/",
1510            #[cfg(feature = "vic3")]
1511            Item::DiplomaticCatalyst => "common/diplomatic_catalysts/",
1512            #[cfg(feature = "vic3")]
1513            Item::DiplomaticCatalystCategory => "common/diplomatic_catalyst_categories/",
1514            #[cfg(feature = "vic3")]
1515            Item::DiplomaticPlay => "common/diplomatic_plays/",
1516            #[cfg(feature = "vic3")]
1517            Item::DiscriminationTrait => "common/discrimination_traits/",
1518            #[cfg(feature = "vic3")]
1519            Item::DiscriminationTraitGroup => "common/discrimination_trait_groups/",
1520            #[cfg(feature = "vic3")]
1521            Item::DynamicCompanyName => "common/dynamic_company_names/",
1522            #[cfg(feature = "vic3")]
1523            Item::DynamicCountryMapColor => "common/dynamic_country_map_colors/",
1524            #[cfg(feature = "vic3")]
1525            Item::DynamicCountryName => "common/dynamic_country_names/",
1526            #[cfg(feature = "vic3")]
1527            Item::DynamicTreatyName => "common/dynamic_treaty_names/",
1528            #[cfg(feature = "vic3")]
1529            Item::EventCategory => "",
1530            #[cfg(feature = "vic3")]
1531            Item::FlagDefinition => "common/flag_definitions/",
1532            #[cfg(feature = "vic3")]
1533            Item::FleetDiorama => "gfx/map/fleet_dioramas/",
1534            #[cfg(feature = "vic3")]
1535            Item::FrontGraphics => "gfx/map/borders/front_graphics/",
1536            #[cfg(feature = "vic3")]
1537            Item::GeographicRegion => "common/geographic_regions/",
1538            #[cfg(feature = "vic3")]
1539            Item::GeographicRegionShortKey => "common/geographic_regions/",
1540            #[cfg(feature = "vic3")]
1541            Item::Goods => "common/goods/",
1542            #[cfg(feature = "vic3")]
1543            // TODO: find out if different filenames are acceptable in this dir
1544            Item::GradientBorderSettings => "gfx/map/gradient_border_settings/",
1545            #[cfg(feature = "vic3")]
1546            Item::HarvestConditionType => "common/harvest_condition_types/",
1547            #[cfg(feature = "vic3")]
1548            Item::HeritageTrait => "common/discrimination_traits/",
1549            #[cfg(feature = "vic3")]
1550            Item::InfamyThreshold => "",
1551            #[cfg(feature = "vic3")]
1552            Item::Institution => "common/institutions/",
1553            #[cfg(feature = "vic3")]
1554            Item::InterestGroup => "common/interest_groups/",
1555            #[cfg(feature = "vic3")]
1556            Item::InterestGroupTrait => "common/interest_group_traits/",
1557            #[cfg(feature = "vic3")]
1558            Item::JournalEntry => "common/journal_entries/",
1559            #[cfg(feature = "vic3")]
1560            Item::JournalEntryGroup => "common/journal_entry_groups/",
1561            #[cfg(feature = "vic3")]
1562            Item::LawType => "common/laws/",
1563            #[cfg(feature = "vic3")]
1564            Item::LanguageTrait => "common/discrimination_traits/",
1565            #[cfg(feature = "vic3")]
1566            Item::LegitimacyLevel => "common/legitimacy_levels/",
1567            #[cfg(feature = "vic3")]
1568            Item::Level => "",
1569            #[cfg(feature = "vic3")]
1570            Item::LibertyDesireLevel => "common/liberty_desire_levels/",
1571            #[cfg(feature = "vic3")]
1572            Item::MapLayer => "gfx/map/map_object_data/layers.txt",
1573            #[cfg(feature = "vic3")]
1574            Item::MapInteractionType => "common/map_interaction_types/",
1575            #[cfg(feature = "vic3")]
1576            Item::MapNotificationType => "common/map_notification_types/",
1577            #[cfg(feature = "vic3")]
1578            Item::MediaAlias => "gfx/media_aliases/",
1579            #[cfg(feature = "vic3")]
1580            Item::MilitaryFormationFlag => "common/military_formation_flags/",
1581            #[cfg(feature = "vic3")]
1582            Item::MobilizationOption => "common/mobilization_options/",
1583            #[cfg(feature = "vic3")]
1584            Item::MobilizationOptionGroup => "common/mobilization_option_groups/",
1585            #[cfg(feature = "vic3")]
1586            Item::ModifierTypeDefinition => "common/modifier_type_definitions/",
1587            #[cfg(feature = "vic3")]
1588            Item::Objective => "common/objectives/",
1589            #[cfg(feature = "vic3")]
1590            Item::ObjectiveSubgoal => "common/objective_subgoals/",
1591            #[cfg(feature = "vic3")]
1592            Item::ObjectiveSubgoalCategory => "common/objective_subgoal_categories/",
1593            #[cfg(feature = "vic3")]
1594            Item::Party => "common/parties/",
1595            #[cfg(feature = "vic3")]
1596            Item::PoliticalLobby => "common/political_lobbies/",
1597            #[cfg(feature = "vic3")]
1598            Item::PoliticalLobbyAppeasement => "common/political_lobby_appeasement/",
1599            #[cfg(feature = "vic3")]
1600            Item::PoliticalMovement => "common/political_movements",
1601            #[cfg(feature = "vic3")]
1602            Item::PoliticalMovementCategory => "common/political_movement_categories",
1603            #[cfg(feature = "vic3")]
1604            Item::PoliticalMovementPopSupport => "common/political_movement_pop_support",
1605            #[cfg(feature = "vic3")]
1606            Item::PopNeed => "common/pop_needs/",
1607            #[cfg(feature = "vic3")]
1608            Item::PowerBlocCoaPiece => "common/power_bloc_coa_pieces/",
1609            #[cfg(feature = "vic3")]
1610            Item::PowerBlocIdentity => "common/power_bloc_identities/",
1611            #[cfg(feature = "vic3")]
1612            Item::PowerBlocMapTexture => "common/power_bloc_map_textures/",
1613            #[cfg(feature = "vic3")]
1614            Item::PowerBlocName => "common/power_bloc_names/",
1615            #[cfg(feature = "vic3")]
1616            Item::PrestigeGoods => "common/prestige_goods/",
1617            #[cfg(feature = "vic3")]
1618            Item::Principle => "common/power_bloc_principles/",
1619            #[cfg(feature = "vic3")]
1620            Item::PrincipleGroup => "common/power_bloc_principle_groups/",
1621            #[cfg(feature = "vic3")]
1622            Item::ProductionMethod => "common/production_methods/",
1623            #[cfg(feature = "vic3")]
1624            Item::ProductionMethodGroup => "common/production_method_groups/",
1625            #[cfg(feature = "vic3")]
1626            Item::ProposalType => "common/proposal_types/",
1627            #[cfg(feature = "vic3")]
1628            Item::RelationsThreshold => "",
1629            #[cfg(feature = "vic3")]
1630            Item::ScriptedButton => "common/scripted_buttons/",
1631            #[cfg(feature = "vic3")]
1632            Item::ScriptedProgressBar => "common/scripted_progress_bars/",
1633            #[cfg(feature = "vic3")]
1634            Item::ScriptedTest => "tools/scripted_tests/",
1635            #[cfg(feature = "vic3")]
1636            Item::SecretGoal => "",
1637            #[cfg(feature = "vic3")]
1638            Item::Skin => "gfx/skins/",
1639            #[cfg(feature = "vic3")]
1640            Item::SocialClass => "common/social_classes/",
1641            #[cfg(feature = "vic3")]
1642            Item::SocialHierarchy => "common/social_hierarchies/",
1643            #[cfg(feature = "vic3")]
1644            Item::StateRegion => "map_data/state_regions/",
1645            #[cfg(feature = "vic3")]
1646            Item::StateTrait => "common/state_traits/",
1647            #[cfg(feature = "vic3")]
1648            Item::Strata => "",
1649            #[cfg(feature = "vic3")]
1650            Item::TechnologyEra => "common/technology/eras/",
1651            #[cfg(feature = "vic3")]
1652            Item::TerrainKey => "common/labels/",
1653            #[cfg(feature = "vic3")]
1654            Item::TerrainLabel => "common/labels/",
1655            #[cfg(feature = "vic3")]
1656            Item::TerrainManipulator => "common/terrain_manipulators/",
1657            #[cfg(feature = "vic3")]
1658            Item::TerrainMask => "gfx/map/masks/",
1659            #[cfg(feature = "vic3")]
1660            Item::TerrainMaterial => "gfx/map/terrain/materials.settings",
1661            #[cfg(feature = "vic3")]
1662            Item::Theme => "common/themes/",
1663            #[cfg(feature = "vic3")]
1664            Item::TraditionTrait => "common/discrimination_traits/",
1665            #[cfg(feature = "vic3")]
1666            Item::TransferOfPower => "",
1667            #[cfg(feature = "vic3")]
1668            Item::TreatyArticle => "common/treaty_articles/",
1669            #[cfg(feature = "vic3")]
1670            Item::WarGoalType => "common/war_goal_types/",
1671
1672            #[cfg(feature = "imperator")]
1673            Item::AiPlanGoals => "common/ai_plan_goals/",
1674            #[cfg(feature = "imperator")]
1675            Item::Ambition => "common/ambitions/",
1676            #[cfg(feature = "imperator")]
1677            Item::Area => "map_data/areas.txt",
1678            #[cfg(feature = "imperator")]
1679            Item::CultureGroup => "common/cultures/",
1680            #[cfg(feature = "imperator")]
1681            Item::Deity => "common/deities/",
1682            #[cfg(feature = "imperator")]
1683            Item::DeityCategory => "common/deity_categories/",
1684            #[cfg(feature = "imperator")]
1685            Item::DiplomaticStance => "common/diplomatic_stances/",
1686            #[cfg(feature = "imperator")]
1687            Item::EconomicPolicy => "common/economic_policies/",
1688            #[cfg(feature = "imperator")]
1689            Item::EventPicture => "common/event_pictures/",
1690            #[cfg(feature = "imperator")]
1691            Item::GovernorPolicy => "common/governor_policies/",
1692            #[cfg(feature = "imperator")]
1693            Item::GraphicalCultureType => "common/graphical_culture_types/",
1694            #[cfg(feature = "imperator")]
1695            Item::GreatWorkEffect => "common/great_work_effects/",
1696            #[cfg(feature = "imperator")]
1697            Item::GreatWorkEffectTier => "common/great_work_effect_tiers/",
1698            #[cfg(feature = "imperator")]
1699            Item::GreatWorkCategory => "common/great_work_categories/",
1700            #[cfg(feature = "imperator")]
1701            Item::GreatWorkMaterial => "common/great_work_materials/",
1702            #[cfg(feature = "imperator")]
1703            Item::GreatWorkModule => "common/great_work_modules/",
1704            #[cfg(feature = "imperator")]
1705            Item::GreatWorkTemplate => "common/great_work_templates/",
1706            #[cfg(feature = "imperator")]
1707            Item::Heritage => "common/heritage/",
1708            #[cfg(feature = "imperator")]
1709            Item::Invention => "common/inventions/",
1710            #[cfg(feature = "imperator")]
1711            Item::InventionGroup => "common/inventions/",
1712            #[cfg(feature = "imperator")]
1713            Item::LegionDistinction => "common/legion_distinctions/",
1714            #[cfg(feature = "imperator")]
1715            Item::LevyTemplate => "common/levy_templates/",
1716            #[cfg(feature = "imperator")]
1717            Item::Loyalty => "common/loyalty/",
1718            #[cfg(feature = "imperator")]
1719            Item::MilitaryTraditionTree => "common/military_traditions/",
1720            #[cfg(feature = "imperator")]
1721            Item::MilitaryTradition => "common/military_traditions/",
1722            #[cfg(feature = "imperator")]
1723            Item::MissionTask => "common/missions/",
1724            #[cfg(feature = "imperator")]
1725            Item::Office => "common/offices/",
1726            #[cfg(feature = "imperator")]
1727            Item::Opinion => "common/opinions/",
1728            #[cfg(feature = "imperator")]
1729            Item::PartyAgenda => "common/party_agendas",
1730            #[cfg(feature = "imperator")]
1731            Item::PartyType => "common/party_types/",
1732            #[cfg(feature = "imperator")]
1733            Item::PostSetupCharacters => "setup/post_character/",
1734            #[cfg(feature = "imperator")]
1735            Item::Price => "common/prices/",
1736            #[cfg(feature = "imperator")]
1737            Item::ProvinceRank => "common/province_ranks/",
1738            #[cfg(feature = "imperator")]
1739            Item::TechnologyTable => "common/technology_tables/",
1740            #[cfg(feature = "imperator")]
1741            Item::SetupCharacters => "setup/characters/",
1742            #[cfg(feature = "imperator")]
1743            Item::SetupProvinces => "setup/provinces/",
1744            #[cfg(feature = "imperator")]
1745            Item::TradeGood => "common/trade_goods/",
1746            #[cfg(feature = "imperator")]
1747            Item::Treasure => "setup/main/",
1748            #[cfg(feature = "imperator")]
1749            Item::Unit => "common/units/",
1750            #[cfg(feature = "imperator")]
1751            Item::UnitAbility => "common/unit_abilities/",
1752            #[cfg(feature = "imperator")]
1753            Item::Wargoal => "common/wargoals",
1754
1755            #[cfg(feature = "hoi4")]
1756            Item::Ability => "common/abilities/",
1757            #[cfg(feature = "hoi4")]
1758            Item::Acclimatation => "common/acclimatation.txt",
1759            #[cfg(feature = "hoi4")]
1760            Item::AdjacencyRule => "map/adjacency_rules.txt",
1761            #[cfg(feature = "hoi4")]
1762            Item::AceModifier => "common/aces",
1763            #[cfg(feature = "hoi4")]
1764            Item::AdvisorSlot => "common/script_enums.txt",
1765            #[cfg(feature = "hoi4")]
1766            Item::AiArea => "common/ai_areas/",
1767            #[cfg(feature = "hoi4")]
1768            Item::AiStrategyType => "common/ai_strategy/_documentation.md",
1769            #[cfg(feature = "hoi4")]
1770            Item::CharacterIdeaToken => "common/characters/",
1771            #[cfg(feature = "hoi4")]
1772            Item::CombatTacticPhase => "common/combat_tactics.txt",
1773            #[cfg(feature = "hoi4")]
1774            Item::Continent => "map/continent.txt",
1775            #[cfg(feature = "hoi4")]
1776            Item::CountryLeaderTrait => "common/country_leader/",
1777            #[cfg(feature = "hoi4")]
1778            Item::CountryHistory => "history/countries/",
1779            #[cfg(feature = "hoi4")]
1780            Item::CountryTag => "common/country_tags/",
1781            #[cfg(feature = "hoi4")]
1782            Item::CountryTagAlias => "common/country_tag_aliases/",
1783            #[cfg(feature = "hoi4")]
1784            Item::DecisionCategory => "common/decisions/categories/",
1785            #[cfg(feature = "hoi4")]
1786            Item::DivisionNamesGroup => "common/units/names_divisions/",
1787            #[cfg(feature = "hoi4")]
1788            Item::DivisionTemplate => "history/units/",
1789            #[cfg(feature = "hoi4")]
1790            Item::DynamicModifier => "common/dynamic_modifiers/",
1791            #[cfg(feature = "hoi4")]
1792            Item::Equipment => "common/units/equipment/",
1793            #[cfg(feature = "hoi4")]
1794            Item::EquipmentBonusType => "common/script_enums.txt",
1795            #[cfg(feature = "hoi4")]
1796            Item::EquipmentCategory => "common/script_enums.txt",
1797            #[cfg(feature = "hoi4")]
1798            Item::EquipmentGroup => "common/equipment_groups/",
1799            #[cfg(feature = "hoi4")]
1800            Item::EquipmentModule => "common/units/equipment/modules/",
1801            #[cfg(feature = "hoi4")]
1802            Item::EquipmentModuleCategory => "common/units/equipment/modules/",
1803            #[cfg(feature = "hoi4")]
1804            Item::EquipmentSearchFilter => "common/units/equipment/",
1805            #[cfg(feature = "hoi4")]
1806            Item::EquipmentStat => "common/script_enums.txt",
1807            #[cfg(feature = "hoi4")]
1808            Item::EquipmentUpgrade => "common/units/equipment/upgrades/", // TODO HOI4
1809            #[cfg(feature = "hoi4")]
1810            Item::GraphicalTerrain => "common/terrain/",
1811            #[cfg(feature = "hoi4")]
1812            Item::IdeaCategory => "common/idea_tags/",
1813            #[cfg(feature = "hoi4")]
1814            Item::IdeologyGroup => "common/ideologies/",
1815            #[cfg(feature = "hoi4")]
1816            Item::IndustrialOrg => "common/military_industrial_organization/organizations/",
1817            #[cfg(feature = "hoi4")]
1818            Item::IndustrialOrgBonusWeight => {
1819                "common/military_industrial_organization/ai_bonus_weights/"
1820            }
1821            #[cfg(feature = "hoi4")]
1822            Item::IndustrialOrgPolicy => "common/military_industrial_organization/policies/",
1823            #[cfg(feature = "hoi4")]
1824            Item::IndustrialOrgTrait => "common/military_industrial_organization/organizations/",
1825            #[cfg(feature = "hoi4")]
1826            Item::IntelligenceAgencyBranch => "common/intelligence_agency_upgrades/",
1827            #[cfg(feature = "hoi4")]
1828            Item::IntelligenceAgencyUpgrade => "common/intelligence_agency_upgrades/",
1829            #[cfg(feature = "hoi4")]
1830            Item::MusicAsset => "music/",
1831            #[cfg(feature = "hoi4")]
1832            Item::NationalFocus => "common/national_focus/",
1833            #[cfg(feature = "hoi4")]
1834            Item::NationalFocusStyle => "common/national_focus/",
1835            #[cfg(feature = "hoi4")]
1836            Item::NationalFocusTree => "common/national_focus/",
1837            #[cfg(feature = "hoi4")]
1838            Item::Operation => "common/operations/",
1839            #[cfg(feature = "hoi4")]
1840            Item::OperationPhase => "common/operation_phases/",
1841            #[cfg(feature = "hoi4")]
1842            Item::OperationToken => "common/operation_tokens/",
1843            #[cfg(feature = "hoi4")]
1844            Item::PowerBalance => "common/bop/",
1845            #[cfg(feature = "hoi4")]
1846            Item::PowerBalanceSide => "common/bop/",
1847            #[cfg(feature = "hoi4")]
1848            Item::ProductionStat => "common/script_enum.txt",
1849            #[cfg(feature = "hoi4")]
1850            Item::PrototypeReward => "common/special_projects/prototype_rewards/",
1851            #[cfg(feature = "hoi4")]
1852            Item::RailwayGunNames => "common/units/names_railway_guns/",
1853            #[cfg(feature = "hoi4")]
1854            Item::Resource => "common/resources/",
1855            #[cfg(feature = "hoi4")]
1856            Item::ScriptEnum => "common/script_enums.txt",
1857            #[cfg(feature = "hoi4")]
1858            Item::ScriptedConstant => "common/scripted_constants/", // TODO HOI4
1859            #[cfg(feature = "hoi4")]
1860            Item::ScriptedLocalisation => "common/scripted_localisation/",
1861            #[cfg(feature = "hoi4")]
1862            Item::ShipNames => "common/units/names_ships/",
1863            #[cfg(feature = "hoi4")]
1864            Item::SoundEffect | Item::SoundFalloff => "sound/",
1865            #[cfg(feature = "hoi4")]
1866            Item::SpawnPoint => "common/buildings/",
1867            #[cfg(feature = "hoi4")]
1868            Item::Specialization => "common/special_projects/specialization/",
1869            #[cfg(feature = "hoi4")]
1870            Item::SpecialProject => "common/special_projects/projects/",
1871            #[cfg(feature = "hoi4")]
1872            Item::SpecialProjectTag => "common/special_projects/project_tags/",
1873            #[cfg(feature = "hoi4")]
1874            Item::ScientistTrait => "common/scientist_traits/",
1875            #[cfg(feature = "hoi4")]
1876            Item::ShipName => "history/units/",
1877            #[cfg(feature = "hoi4")]
1878            Item::Sprite => "gfx/",
1879            #[cfg(feature = "hoi4")]
1880            Item::State => "history/states/",
1881            #[cfg(feature = "hoi4")]
1882            Item::StateCategory => "common/state_category/",
1883            #[cfg(feature = "hoi4")]
1884            Item::SubUnit => "common/units/",
1885            #[cfg(feature = "hoi4")]
1886            Item::SubUnitCategory => "common/unit_tags/",
1887            #[cfg(feature = "hoi4")]
1888            Item::SupplyArea => "map/supplyareas",
1889            #[cfg(feature = "hoi4")]
1890            Item::TechnologyCategory => "common/technology_tags/",
1891            #[cfg(feature = "hoi4")]
1892            Item::TechnologyFolder => "common/technology_tags/",
1893            #[cfg(feature = "hoi4")]
1894            Item::TechnologySharing => "common/technology_sharing/",
1895            #[cfg(feature = "hoi4")]
1896            Item::UnitHistory => "history/units/",
1897            #[cfg(feature = "hoi4")]
1898            Item::UnitLeaderSkill => "common/unit_leader/",
1899            #[cfg(feature = "hoi4")]
1900            Item::UnitLeaderTrait => "common/unit_leader/",
1901            #[cfg(feature = "hoi4")]
1902            Item::UnitNames => "common/units/names/",
1903        }
1904    }
1905
1906    /// Confidence value to use when reporting that an item is missing.
1907    /// Should be `Strong` for most, `Weak` for items that aren't defined anywhere but just used (such as gfx flags).
1908    pub fn confidence(self) -> Confidence {
1909        match self {
1910            #[cfg(feature = "jomini")]
1911            Item::AccessoryTag => Confidence::Weak,
1912
1913            // GuiType and GuiTemplate are here because referring to templates in other mods is a
1914            // common compatibility technique.
1915            Item::GuiType | Item::GuiTemplate | Item::Sound => Confidence::Weak,
1916
1917            #[cfg(feature = "ck3")]
1918            Item::AccoladeCategory
1919            | Item::BuildingGfx
1920            | Item::ClothingGfx
1921            | Item::CoaGfx
1922            | Item::CultureParameter
1923            | Item::MemoryCategory
1924            | Item::UnitGfx => Confidence::Weak,
1925
1926            #[cfg(feature = "ck3")]
1927            Item::SpecialBuilding => Confidence::Reasonable,
1928
1929            _ => Confidence::Strong,
1930        }
1931    }
1932
1933    /// Severity value to use when reporting that an item is missing.
1934    /// * `Error` - most things
1935    /// * `Warning` - things that only impact visuals or presentation
1936    /// * `Untidy` - things that don't matter much at all
1937    /// * `Fatal` - things that cause crashes if they're missing
1938    ///
1939    /// This is only one piece of the severity puzzle. It can also depend on the caller who's expecting the item to exist.
1940    /// That part isn't handled yet.
1941    pub fn severity(self) -> Severity {
1942        match self {
1943            // GuiType and GuiTemplate are here because referring to templates in other mods is a
1944            // common compatibility technique.
1945            Item::GuiType | Item::GuiTemplate => Severity::Untidy,
1946
1947            Item::File | Item::Localization | Item::MapEnvironment => Severity::Warning,
1948
1949            #[cfg(feature = "jomini")]
1950            Item::Accessory
1951            | Item::AccessoryTag
1952            | Item::AccessoryVariation
1953            | Item::AccessoryVariationLayout
1954            | Item::AccessoryVariationTextures
1955            | Item::Coa
1956            | Item::CoaColorList
1957            | Item::CoaColoredEmblemList
1958            | Item::CoaPatternList
1959            | Item::CoaTemplate
1960            | Item::CoaTemplateList
1961            | Item::CoaTexturedEmblemList
1962            | Item::CustomLocalization
1963            | Item::EffectLocalization
1964            | Item::Ethnicity
1965            | Item::GameConcept
1966            | Item::NamedColor
1967            | Item::PortraitAnimation
1968            | Item::PortraitCamera
1969            | Item::PortraitEnvironment
1970            | Item::Sound
1971            | Item::TextFormat
1972            | Item::TextIcon
1973            | Item::TextureFile
1974            | Item::TriggerLocalization => Severity::Warning,
1975
1976            #[cfg(feature = "ck3")]
1977            Item::AccoladeIcon
1978            | Item::ArtifactVisual
1979            | Item::BuildingGfx
1980            | Item::ClothingGfx
1981            | Item::CoaDynamicDefinition
1982            | Item::CoaGfx
1983            | Item::CultureAesthetic
1984            | Item::CultureCreationName
1985            | Item::EventBackground
1986            | Item::EventTheme
1987            | Item::EventTransition
1988            | Item::Flavorization
1989            | Item::GraphicalFaith
1990            | Item::ModifierFormat
1991            | Item::MottoInsert
1992            | Item::Motto
1993            | Item::Music
1994            | Item::Nickname
1995            | Item::RulerObjectiveType
1996            | Item::ScriptedIllustration
1997            | Item::UnitGfx => Severity::Warning,
1998
1999            #[cfg(feature = "vic3")]
2000            Item::MapLayer
2001            | Item::ModifierTypeDefinition
2002            | Item::TerrainManipulator
2003            | Item::TerrainMask
2004            | Item::TerrainMaterial => Severity::Warning,
2005
2006            #[cfg(feature = "hoi4")]
2007            Item::Sprite => Severity::Warning,
2008
2009            _ => Severity::Error,
2010        }
2011    }
2012}
2013
2014/// The callback type for adding one item instance to the database.
2015pub(crate) type ItemAdder = fn(&mut Db, Token, Block);
2016
2017/// The specification for loading an [`Item`] type into the [`Db`].
2018///
2019/// An instance of this can be placed in every `data` module using the `inventory::submit!` macro.
2020/// This will register the loader so that the [`Everything`] object can load all defined items.
2021// Note that this is an enum so that users can more conveniently construct it. It used to be a
2022// struct with various constructor functions, but that didn't work because the ItemAdder type has a
2023// &mut in it, and that wasn't allowed in const functions even though the function pointer itself
2024// is const. See https://github.com/rust-lang/rust/issues/57349 for details.
2025// TODO: once that issue stabilizes, we can revisit the ItemLoader type.
2026pub(crate) enum ItemLoader {
2027    /// A convenience variant for loaders that are the most common type.
2028    ///
2029    /// * [`GameFlags`] is which games this item loader is for.
2030    /// * [`Item`] is the item type being loaded.
2031    ///
2032    /// The [`ItemAdder`] function does not have to load exclusively this type of item.
2033    /// Related items are ok. The main use of the [`Item`] field is to get the path for this item
2034    /// type, so that files are loaded from that folder.
2035    ///
2036    /// `Normal` loaders have extension `.txt`, `LoadAsFile::No`, and `Recursive::Maybe`. They default
2037    /// to a [`PdxEncoding`] appropriate to the game being validated.
2038    Normal(GameFlags, Item, ItemAdder),
2039    /// A variant that allows the full range of item loader behvavior.
2040    /// * [`PdxEncoding`] indicates whether to expect utf-8 and/or a BOM in the files.
2041    /// * The `&'static str` is the file extension to look for (including the dot).
2042    /// * [`LoadAsFile`] is whether to load the whole file as one item, or treat it as normal with a
2043    ///   series of items in one file.
2044    /// * [`Recursive`] indicates whether to load subfolders of the item's main folder.
2045    ///   `Recursive::Maybe` means apply game-dependent logic.
2046    Full(GameFlags, Item, PdxEncoding, &'static str, LoadAsFile, Recursive, ItemAdder),
2047}
2048
2049inventory::collect!(ItemLoader);
2050
2051impl ItemLoader {
2052    pub fn for_game(&self, game: Game) -> bool {
2053        let game_flags = match self {
2054            ItemLoader::Normal(game_flags, _, _)
2055            | ItemLoader::Full(game_flags, _, _, _, _, _, _) => game_flags,
2056        };
2057        game_flags.contains(GameFlags::from(game))
2058    }
2059
2060    pub fn itype(&self) -> Item {
2061        match self {
2062            ItemLoader::Normal(_, itype, _) | ItemLoader::Full(_, itype, _, _, _, _, _) => *itype,
2063        }
2064    }
2065
2066    pub fn encoding(&self) -> PdxEncoding {
2067        match self {
2068            ItemLoader::Normal(_, _, _) => {
2069                #[cfg(feature = "hoi4")]
2070                if Game::is_hoi4() {
2071                    return PdxEncoding::Utf8NoBom;
2072                }
2073                PdxEncoding::Utf8Bom
2074            }
2075            ItemLoader::Full(_, _, encoding, _, _, _, _) => *encoding,
2076        }
2077    }
2078
2079    pub fn extension(&self) -> &'static str {
2080        match self {
2081            ItemLoader::Normal(_, _, _) => ".txt",
2082            ItemLoader::Full(_, _, _, extension, _, _, _) => extension,
2083        }
2084    }
2085
2086    pub fn whole_file(&self) -> bool {
2087        match self {
2088            ItemLoader::Normal(_, _, _) => false,
2089            ItemLoader::Full(_, _, _, _, load_as_file, _, _) => {
2090                matches!(load_as_file, LoadAsFile::Yes)
2091            }
2092        }
2093    }
2094
2095    pub fn recursive(&self) -> bool {
2096        match self {
2097            ItemLoader::Normal(_, _, _) => {
2098                Game::is_ck3() && self.itype().path().starts_with("common/")
2099            }
2100            ItemLoader::Full(_, _, _, _, _, recursive, _) => match recursive {
2101                Recursive::Yes => true,
2102                Recursive::No => false,
2103                Recursive::Maybe => Game::is_ck3() && self.itype().path().starts_with("common/"),
2104            },
2105        }
2106    }
2107
2108    pub fn adder(&self) -> ItemAdder {
2109        match self {
2110            ItemLoader::Normal(_, _, adder) | ItemLoader::Full(_, _, _, _, _, _, adder) => *adder,
2111        }
2112    }
2113}
2114
2115pub enum LoadAsFile {
2116    Yes,
2117    No,
2118}
2119
2120pub enum Recursive {
2121    Yes,
2122    No,
2123    #[allow(dead_code)]
2124    Maybe,
2125}