source-fs 0.3.0

A virtual filesystem implementation for Source Engine games, handling gameinfo.txt search paths, VPK archives, and cross-platform file resolution.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

#[cfg(feature = "steam")]
fn main() {
    use source_fs::{DummyVpk, FileSystem, FileSystemOptions, SimpleGameInfo};

    let options = FileSystemOptions::default();
    let fs = FileSystem::<DummyVpk>::load_from_app_id::<SimpleGameInfo>(620, "portal2", &options).unwrap();

    let file = fs.read_str("scripts/vscripts/mapspawn.nut", "game", false).unwrap();
    println!("Found file: \n{}", file);
}

#[cfg(not(feature = "steam"))]
fn main() {
    panic!("'Steam' feature is not enabled");
}