pub trait OptimizableContainer: Container {
    // Required method
    fn optimize(
        &mut self,
        paths_to_optimize: Option<Vec<ContainerPath>>,
        dependencies: &mut Dependencies,
        schema: &Schema,
        optimize_datacored_tables: bool
    ) -> Result<HashSet<String>>;
}
Expand description

This trait marks a Container as an Optimizable container, meaning it can be cleaned up to reduce size and improve compatibility.

Required Methods§

source

fn optimize( &mut self, paths_to_optimize: Option<Vec<ContainerPath>>, dependencies: &mut Dependencies, schema: &Schema, optimize_datacored_tables: bool ) -> Result<HashSet<String>>

This function optimizes the provided Container to reduce its size and improve compatibility.

It returns the list of files that has been safetly deleted during the optimization process.

Implementations on Foreign Types§

source§

impl OptimizableContainer for Pack

source§

fn optimize( &mut self, paths_to_optimize: Option<Vec<ContainerPath>>, dependencies: &mut Dependencies, _schema: &Schema, optimize_datacored_tables: bool ) -> Result<HashSet<String>>

This function optimizes the provided Pack file in order to make it smaller and more compatible.

Specifically, it performs the following optimizations:

  • DB/Loc tables (except if the table has the same name as his vanilla/parent counterpart and optimize_datacored_tables is false):
    • Removal of duplicated entries.
    • Removal of ITM (Identical To Master) entries.
    • Removal of ITNR (Identical To New Row) entries.
    • Removal of empty tables.
  • XML files:
    • Removal of XML files in map folders (extra files resulting of Terry export process).
    • Removal of XML files in prefabs folder (extra files resulting of Terry export process).

NOTE: due to a consequence of the optimization, all tables are also sorted by their first key.

Not yet working:

  • Remove files identical to Parent/Vanilla files (if is identical to vanilla, but a parent mod overwrites it, it ignores it).

Implementors§