Skip to main content

Modification

Struct Modification 

Source
pub struct Modification {
    pub mods: Vec<Mod>,
    pub dirty: bool,
}
Expand description

The mod list: every package found, in list order.

Fields§

§mods: Vec<Mod>

The mods, the first winning over the others when they share a file.

§dirty: bool

+0: the list changed (Enable, Swap) since the packages were set up.

Implementations§

Source§

impl Modification

Source

pub fn refresh( found: Vec<(String, Vec<u8>)>, settings: &impl Settings, ) -> Modification

RefreshList over the packages found: (file name without .pkm, bytes).

Source

pub fn add(&mut self, found: Vec<(String, Vec<u8>)>, settings: &impl Settings)

Mods added while the game runs (dropped in the browser, or installed from Nexus Mods): the list is read again with them, replacing any of the same name. They take effect after a reload; the list is marked changed when an enabled mod was replaced or the enabled set changed.

Source

pub fn revert(&mut self, settings: &impl Settings)

RefreshList over the packages already read: the settings’ order and enabled mods again (the Mods dialog’s Cancel). The list stays dirty.

Source

pub fn save_list(&self, settings: &mut impl Settings)

SaveList.

Source

pub fn enable(&mut self, i: usize, on: bool)

Enable.

Source

pub fn swap(&mut self, a: usize, b: usize)

Swap: two places in the list.

Source

pub fn in_conflict(&self, i: usize) -> bool

Whether mod i is enabled with another enabled mod sharing a file.

Source

pub fn load_order(&self) -> Vec<&Mod>

The enabled mods in the order SetupFileSystem adds them: from the last in the list to the first.

Source

pub fn saved(&self) -> Vec<SavedMod>

SaveLoad::SaveMetaData: each enabled mod as the save records it, its name, its file under the data directory (WinData\<file>.pkm, inferred from GetPackDirectory) and its crc, game version and author’s version.

Source

pub fn check(&self, saved: &SavedMod) -> u32

0 when the saved mod is installed as it was, 1 when it is not installed (by its file, without case), 4 when its crc differs, 3 when the author’s version differs and 2 when it was made before game version 1.0.4.

Original: SaveLoad::CheckMod, Runtime 0x1800c3900.

Source

pub fn enabled_files(&self) -> Vec<String>

The enabled mods’ file names, in list order (their resource lists load in this order).

Trait Implementations§

Source§

impl Clone for Modification

Source§

fn clone(&self) -> Modification

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Modification

Source§

fn default() -> Modification

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.