Skip to main content

pack_from_files

Function pack_from_files 

Source
pub fn pack_from_files(
    sources: &PackSources<'_>,
    english: &BTreeMap<String, String>,
    data: Option<&SourceText>,
    rules: &PackRules<'_>,
) -> Result<LangPack, Vec<ContentError>>
Expand description

Parses and validates the pack made of sources, its screen text checked against english (the source’s screen text, whatever the language) and its data and dialogue text against data (left out without it: the data files failed to load). Reports every problem found; the messages call the source en.

A ui.ron or data.ron entry’s key must be one of the source’s and be there once, and its text must have the same placeholders as its source; a name, and the game’s data text, also keep to the rules of the source’s (rules). A dialogue entry is checked as LineEntry says: one whose line the source no longer has is an orphan, not an error.