steam

package
v1.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindSteamRoots

func FindSteamRoots() []string

FindSteamRoots returns candidate Steam installation roots in search order. On many real Linux installs ~/.steam/steam is a symlink to ~/.local/share/Steam (or the reverse) - both paths exist and both pass the existence check below, but they are the same real directory. Scanning both would run DetectGames' whole library scan twice against identical data, duplicating every warning it produces (and doing twice the redundant work). Resolved-path dedup keeps only the first candidate (this list's own priority order) whenever a later one turns out to be the same real directory as one already kept.

func GetLibraryPaths

func GetLibraryPaths(steamRoot string) ([]string, error)

GetLibraryPaths returns all Steam library paths from a Steam root (reading libraryfolders.vdf).

func LoadKnownGames

func LoadKnownGames(configDir string) (map[string]GameInfo, error)

LoadKnownGames returns the known Steam App ID -> GameInfo map. It loads the embedded default list, then merges in configDir/steam-games.yaml if present (so you can add or override games without rebuilding).

Types

type AppManifest

type AppManifest struct {
	AppID      string
	Name       string
	InstallDir string
}

AppManifest holds parsed fields from an appmanifest_*.acf file.

func ParseAppManifest

func ParseAppManifest(data string) (AppManifest, error)

ParseAppManifest parses appmanifest_*.acf content and returns AppManifest.

type DetectedGame

type DetectedGame struct {
	SteamAppID  string            // Steam App ID
	Slug        string            // lmm game ID (from known games list)
	Name        string            // Display name
	InstallPath string            // Absolute path to game install (e.g. .../common/Skyrim Special Edition)
	ModPath     string            // Absolute path to mod directory (InstallPath + ModPath relative)
	NexusID     string            // NexusMods game domain ID. Optional: "" for games with no NexusMods presence (#177).
	DeployMode  string            // games.yaml's deploy_mode string, passed through from GameInfo.DeployMode. Optional: "" means the default (extract).
	Sources     map[string]string // games.yaml's sources map, passed through from GameInfo.Sources. Optional: nil means "derive {nexusmods: NexusID}".
}

DetectedGame is a Steam game found on disk that lmm knows how to configure.

func DetectGames

func DetectGames(configDir string) (games []DetectedGame, warnings []string, err error)

DetectGames scans Steam libraries for known moddable games and returns them. configDir is used to load the known-games list (embedded default + optional steam-games.yaml). Warnings are non-fatal errors (e.g. unreadable library, parse failure) so users can diagnose.

type GameInfo

type GameInfo struct {
	Slug    string // lmm game ID, e.g. "skyrim-se"
	Name    string // Display name, e.g. "Skyrim Special Edition"
	NexusID string // NexusMods game domain ID, e.g. "skyrimspecialedition". Optional: absent for games with no NexusMods presence (e.g. Icarus).
	ModPath string // Relative path from game install to mod directory, e.g. "Data"
	// DeployMode is games.yaml's deploy_mode string ("extract"/"copy"/"compile"),
	// passed through as-is for domain.ParseDeployMode to interpret. Optional:
	// "" means the game uses the default (extract), exactly as every entry
	// behaved before this field existed (#177).
	DeployMode string
	// Sources is a full source-id -> per-source game-id map (games.yaml's
	// "sources:" block), for games whose primary source isn't NexusMods (or
	// that need more than one source, e.g. #177's Icarus: {"icarus": "icarus"}).
	// Optional: nil means "derive {nexusmods: NexusID}", exactly as every
	// entry behaved before this field existed.
	Sources map[string]string
}

GameInfo describes a moddable game known to lmm, mapped from Steam App ID.

type VDFMap

type VDFMap map[string]interface{}

VDFMap is a parsed VDF key-value structure (nested maps and string values).

func ParseVDF

func ParseVDF(r io.Reader) (VDFMap, error)

ParseVDF reads Valve Key-Value format from r and returns the root map.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL