Skip to main content

GamePlugin

Trait GamePlugin 

Source
pub trait GamePlugin: Send + Sync {
Show 27 methods // Required methods fn game_id(&self) -> &str; fn display_name(&self) -> &str; fn mod_directory(&self, install: &Path) -> PathBuf; // Provided methods fn detect_install(&self) -> Option<PathBuf> { ... } fn mod_root(&self, install: &Path) -> Result<PathBuf> { ... } fn deploy(&self, staging: &Path, target: &Path) -> Result<()> { ... } fn deploy_to_install(&self, staging: &Path, install: &Path) -> Result<()> { ... } fn post_deploy(&self, _install: &Path) -> Result<()> { ... } fn save_directory(&self) -> Option<PathBuf> { ... } fn deploy_targets(&self) -> &'static [DeployTarget] { ... } fn resolve_deploy_target( &self, _id: &str, _install: &Path, ) -> Option<PathBuf> { ... } fn supports_save_profiles(&self) -> bool { ... } fn classify_mod(&self, _mod_dir: &Path) -> ModSafety { ... } fn wine_dll_overrides(&self, _game_dir: &Path) -> SmallVec<[String; 4]> { ... } fn wine_dll_overrides_from_staging( &self, _staging: &Path, ) -> SmallVec<[String; 4]> { ... } fn executable_dir(&self, install: &Path) -> PathBuf { ... } fn ini_file_names(&self) -> &[&str] { ... } fn archive_extensions(&self) -> &[&str] { ... } fn has_plugin_system(&self) -> bool { ... } fn steam_app_id_u32(&self) -> Option<u32> { ... } fn plugins_txt_folder(&self) -> Option<&str> { ... } fn nexus_game_domain(&self) -> Option<&str> { ... } fn nexus_game_id_u32(&self) -> Option<u32> { ... } fn analyze_mod_archive( &self, _extracted_dir: &Path, ) -> Option<InstallMethod> { ... } fn recognizes_bare_layout(&self, _extracted_dir: &Path) -> bool { ... } fn classify_extension(&self, ext: &str) -> ContentCategory { ... } fn summarize_content(&self, mod_dir: &Path) -> ContentSummary { ... }
}
Expand description

Trait implemented by each supported game.

Required Methods§

Source

fn game_id(&self) -> &str

Unique game identifier (e.g. “skyrim-se”).

Source

fn display_name(&self) -> &str

Human-readable display name.

Source

fn mod_directory(&self, install: &Path) -> PathBuf

Return the mod directory relative to the install path.

Provided Methods§

Source

fn detect_install(&self) -> Option<PathBuf>

Attempt to detect the game’s install location. Default: delegates to detection::find_game_install(self.game_id()).

Source

fn mod_root(&self, install: &Path) -> Result<PathBuf>

Resolve the actual deployment root for enabled mods.

Most supported games use a directory under the install root, so the default delegates to GamePlugin::mod_directory. Games whose mod loader reads from a user-data path (for example Proton AppData) can override this without breaking existing install-relative callers.

Source

fn deploy(&self, staging: &Path, target: &Path) -> Result<()>

Deploy staged mods into the game’s mod directory. Default: recursive symlink farm via modde_core::fs::deploy_symlinks.

Source

fn deploy_to_install(&self, staging: &Path, install: &Path) -> Result<()>

Deploy staged mods using the game install root as context.

The default resolves GamePlugin::mod_root and delegates to GamePlugin::deploy. Games that stage multi-root overlays can override this to deploy to several install-relative destinations.

Source

fn post_deploy(&self, _install: &Path) -> Result<()>

Run any post-deployment steps (e.g. REDmod deploy).

Source

fn save_directory(&self) -> Option<PathBuf>

Return the save directory for this game, if known.

Source

fn deploy_targets(&self) -> &'static [DeployTarget]

Alternate deployment roots this game exposes to the installer (e.g. user-config dirs for INI tweak packs). Default: none, in which case the installer only ever stages into the game install dir. The order is significant: when the analyzer needs to pick a default target for a given DeployTargetKind it takes the first one of that kind.

Source

fn resolve_deploy_target(&self, _id: &str, _install: &Path) -> Option<PathBuf>

Resolve a DeployTarget::id this plugin advertises to a real filesystem path, using the live install dir for any path that must be derived from it (e.g. Steam compatdata adjacent to steamapps/common/<game>). Returns None if the target id is unknown to this plugin or the path cannot be resolved on this system (e.g. the Wine prefix doesn’t exist yet).

Source

fn supports_save_profiles(&self) -> bool

Whether this game participates in modde’s per-profile save layer.

Disabled games still support normal profile/mod management, but modde must not swap saves, compute save fingerprints, or expose save commands for them.

Source

fn classify_mod(&self, _mod_dir: &Path) -> ModSafety

Classify whether a mod is save-breaking based on its installed content.

mod_dir is the path to the mod’s staging directory. The game plugin inspects the files within to determine if the mod alters game logic (scripts, plugins, tweaks) or is purely cosmetic (textures, meshes).

Default: Unknown (conservative — included in fingerprints).

Source

fn wine_dll_overrides(&self, _game_dir: &Path) -> SmallVec<[String; 4]>

Scan the game directory for proxy/hook DLLs that need Wine n,b overrides.

Returns DLL base names (without extension) that should be added to WINEDLLOVERRIDES as name=n,b so Wine loads the native version instead of its built-in stub.

Source

fn wine_dll_overrides_from_staging( &self, _staging: &Path, ) -> SmallVec<[String; 4]>

Scan the staging directory for proxy DLLs that mods deploy. This catches DLLs that may have been deleted by other tools (e.g. fgmod) from the game directory but are still needed.

Source

fn executable_dir(&self, install: &Path) -> PathBuf

Return the directory containing the game executable, relative to the install root. Used to locate proxy DLLs that need Wine overrides.

Source

fn ini_file_names(&self) -> &[&str]

Source

fn archive_extensions(&self) -> &[&str]

Source

fn has_plugin_system(&self) -> bool

Source

fn steam_app_id_u32(&self) -> Option<u32>

Source

fn plugins_txt_folder(&self) -> Option<&str>

Source

fn nexus_game_domain(&self) -> Option<&str>

Source

fn nexus_game_id_u32(&self) -> Option<u32>

Numeric Nexus game ID. Required by the GraphQL v2 API for browse/search queries (which take gameId: Int, not a domain string). Games that only speak REST can leave this None.

Source

fn analyze_mod_archive(&self, _extracted_dir: &Path) -> Option<InstallMethod>

Claim an extracted archive as a game-specific install method.

Runs before the generic probes (FOMOD, BAIN, DLL overlay) in analyze, so a game can authoritatively identify layouts it knows about — e.g. Cyberpunk recognizing a REDmod by info.json + archives/ presence, or ENB for Bethesda.

Return None to fall through to the generic probes.

Source

fn recognizes_bare_layout(&self, _extracted_dir: &Path) -> bool

Decide whether an extracted archive drops cleanly into the game’s mod dir without any staging (e.g. a Skyrim archive with a top-level Data/ directory, or a Cyberpunk archive with r6/).

Called as the last fallback by analyze — if this returns true the plan becomes InstallMethod::BareExtract, otherwise the analyzer falls through to InstallMethod::Unknown and the caller dumps a dossier for the skill path.

Source

fn classify_extension(&self, ext: &str) -> ContentCategory

Classify a file extension into a content category.

Source

fn summarize_content(&self, mod_dir: &Path) -> ContentSummary

Scan a mod directory and return a content summary.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§