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