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