Skip to main content

save_enabled_order

Function save_enabled_order 

Source
pub fn save_enabled_order(
    storage: &GameStorage,
    mods: &[LoadedMod],
) -> Result<(), HookConfigError>
Expand description

Persists the current display order and enabled set of mods to mods.json: active.order is set directly from mods’ current list order, this is what makes reordering in the UI stick, and, since display order is DLL merge priority for the active configuration, what makes a drag-reorder change priority too. active.enabled is set to the checked subset (membership only; its effective order always comes from active.order via ModsPreset::priority_order, never stored separately). A single call covers both a checkbox toggle and a drag-reorder, since mods already reflects whichever just happened. Called after every checkbox toggle or reorder.

§Errors

Returns an error if the mods directory can’t be created or the file can’t be written.