Skip to main content

refresh_hook_resolver

Function refresh_hook_resolver 

Source
pub fn refresh_hook_resolver(storage: &mut GameStorage)
Expand description

Rebuilds storage’s hook resolver from whatever is currently on disk under .supreme/mods/, the active redirection rules a fresh create_storage() call would produce, without needing to throw away and rebuild the rest of storage (its online configuration, etc.).

Call this any time the active mod configuration changes after startup (a mod enabled/disabled, reordered, or one of its parameters edited), HookResolver is loaded once and then cached for the lifetime of the GameStorage it’s attached to, so nothing picks up a change on disk until this (or a fresh create_storage()) runs again. The Mods page itself already knows the moment it persists such a change (its mods_page/render_mod_list/render_mod_details functions return whether they did), so callers should invoke this right after that signal fires rather than polling.