pub struct RawLocalisableFields {
pub fields: Vec<RawLocalisableField>,
}Expand description
Complete localisable fields definition from Assembly Kit.
This is the root structure parsed from TExc_LocalisableFields.xml. It contains
a list of all table fields that should be treated as localisable.
§Structure
Each entry in the file maps a table field to its localisable status. Multiple fields from the same table will appear as separate entries.
§Example
For a units table with two localisable fields, the file would contain:
<dataroot>
<TExc_LocalisableFields>
<table_name>units_tables</table_name>
<field>onscreen_name</field>
</TExc_LocalisableFields>
<TExc_LocalisableFields>
<table_name>units_tables</table_name>
<field>description</field>
</TExc_LocalisableFields>
</dataroot>Fields§
§fields: Vec<RawLocalisableField>All localisable field definitions.
Implementations§
Source§impl RawLocalisableFields
Implementation of RawLocalisableFields.
impl RawLocalisableFields
Implementation of RawLocalisableFields.
Sourcepub fn read(raw_data_path: &Path, version: i16) -> Result<Self>
pub fn read(raw_data_path: &Path, version: i16) -> Result<Self>
Parses the localisable fields definition file from Assembly Kit.
Reads and parses the TExc_LocalisableFields.xml file which lists all table
fields that contain translatable text.
§Arguments
raw_data_path- Path to the Assembly Kit data directoryversion- Assembly Kit version (1 = Shogun 2, 2 = Rome 2+)
§Returns
Returns a RawLocalisableFields containing all field definitions.
§Errors
Returns an error if:
- The version is not 1 or 2 (returns
RLibError::AssemblyKitUnsupportedVersion) - The
TExc_LocalisableFields.xmlfile cannot be found or opened - The XML is malformed
§Version 0 Note
Empire and Napoleon (Version 0) do not include a localisable fields file. For these games, localisable fields must be determined through other means (typically by analyzing actual game data or manual specification).
Trait Implementations§
Source§impl Clone for RawLocalisableFields
impl Clone for RawLocalisableFields
Source§fn clone(&self) -> RawLocalisableFields
fn clone(&self) -> RawLocalisableFields
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RawLocalisableFields
impl Debug for RawLocalisableFields
Source§impl<'de> Deserialize<'de> for RawLocalisableFields
impl<'de> Deserialize<'de> for RawLocalisableFields
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for RawLocalisableFields
impl RefUnwindSafe for RawLocalisableFields
impl Send for RawLocalisableFields
impl Sync for RawLocalisableFields
impl Unpin for RawLocalisableFields
impl UnsafeUnpin for RawLocalisableFields
impl UnwindSafe for RawLocalisableFields
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.