pub struct LangPackRon { /* private fields */ }Expand description
A language pack (lang-pack, .ron), read from its lang.ron in its
folder (lang/pt-BR/lang.ron), which is named by its tag as BCP 47
writes it: its ui.ron beside it, checked against the source’s
(lang/en/ui.ron, or the folder of the source the game declares,
LangPackRon::source_lang), and its data.ron and
dialogue/*.ron, checked against the game’s data text when it gives it
(LangPackRon::with_data; left out otherwise). Any other file in the
folder is an error, and the source’s folder is no pack. Checked as
pack_from_files says, with the game’s
rules, its limits counting a character of the font atlas’s wide glyphs
as two cells when the game gives the atlas
(LangPackRon::widths_of), as the pack has them
(LangInfo::widths); with the atlas, the
wide set its wide_font names must be one the atlas has.
Implementations§
Source§impl LangPackRon
impl LangPackRon
Sourcepub fn new(limits: DialogueLimits, tokens: &'static (dyn Tokens + Sync)) -> Self
pub fn new(limits: DialogueLimits, tokens: &'static (dyn Tokens + Sync)) -> Self
Packs whose dialogue fits limits and may use the game’s tokens,
with no rules of the game’s for its data text, no variants, no data
text to check theirs against, and English as the source.
Sourcepub fn source_lang(self, source: SourceLang) -> Self
pub fn source_lang(self, source: SourceLang) -> Self
These packs, of a game written in source: checked against its
screen text (<languages>/<code>/ui.ron), its folder no pack.
Sourcepub fn widths_of(self, atlas: &FontAtlasDef) -> Self
pub fn widths_of(self, atlas: &FontAtlasDef) -> Self
These packs, their limits counting a character with a wide glyph in
atlas as two cells (CellWidths::of), as the screen prints it,
and their wide_font naming one of its wide sets.
Sourcepub fn data_problem(
self,
data_problem: fn(&str, &str) -> Option<String>,
) -> Self
pub fn data_problem( self, data_problem: fn(&str, &str) -> Option<String>, ) -> Self
These packs, their data text kept to data_problem
(PackRules::data_problem).
Sourcepub fn variants(self, variants: &'static [&'static str]) -> Self
pub fn variants(self, variants: &'static [&'static str]) -> Self
These packs, whose dialogue entries may have variants
(PackRules::variants).
Sourcepub fn with_data(self, data: SourceText) -> Self
pub fn with_data(self, data: SourceText) -> Self
These packs, their data and dialogue text read and checked against
the source text of the game’s data, data.
Trait Implementations§
Source§impl Debug for LangPackRon
impl Debug for LangPackRon
Source§impl Format for LangPackRon
impl Format for LangPackRon
Source§fn id(&self) -> &'static str
fn id(&self) -> &'static str
"png", "tiled-tmx", "yarn": one per format
of a kind.Source§fn extensions(&self) -> &'static [&'static str]
fn extensions(&self) -> &'static [&'static str]
sniff.Source§fn max_bytes(&self) -> usize
fn max_bytes(&self) -> usize
decode sees it. DEFAULT_MAX_BYTES unless the
format says.