mirror of
https://codeberg.org/icewind/vbspview.git
synced 2026-06-03 10:14:10 +02:00
load hl2 assets again
This commit is contained in:
parent
ba871ebfcc
commit
925cc3c37d
3 changed files with 15 additions and 11 deletions
10
Cargo.lock
generated
10
Cargo.lock
generated
|
|
@ -2636,8 +2636,8 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
|
|||
|
||||
[[package]]
|
||||
name = "vbsp"
|
||||
version = "0.2.0"
|
||||
source = "git+https://github.com/icewind1991/vbsp#160370b5f835e1671bc6eb1b8ee91474d9f1927e"
|
||||
version = "0.3.0"
|
||||
source = "git+https://github.com/icewind1991/vbsp#7a491f86272a30a7022aa96c8ff44291bf57238e"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"arrayvec",
|
||||
|
|
@ -2657,7 +2657,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "vbsp-derive"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/icewind1991/vbsp#160370b5f835e1671bc6eb1b8ee91474d9f1927e"
|
||||
source = "git+https://github.com/icewind1991/vbsp#7a491f86272a30a7022aa96c8ff44291bf57238e"
|
||||
dependencies = [
|
||||
"merge",
|
||||
"proc-macro2",
|
||||
|
|
@ -2696,7 +2696,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "vdf-reader"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/icewind1991/vdf-reader#d14f22d1bc97cd57c35585b9545c1491f32189bf"
|
||||
source = "git+https://github.com/icewind1991/vdf-reader#63b3bdbefdb97d7ea20858697702a8530b541e70"
|
||||
dependencies = [
|
||||
"logos",
|
||||
"miette",
|
||||
|
|
@ -2735,7 +2735,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "vmt-parser"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/icewind1991/vmt-parser#8f31c601e56624482b541849f099ff233bb3e2b8"
|
||||
source = "git+https://github.com/icewind1991/vmt-parser#105afbc9550178c25143695091ab10ff869b5df6"
|
||||
dependencies = [
|
||||
"miette",
|
||||
"serde",
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ license = "MIT"
|
|||
#three-d = { version = "0.16.3", features = ["egui-gui"] }
|
||||
three-d = { version = "0.16.3", features = ["egui-gui"], path = "../rust/three-d" }
|
||||
three-d-asset = { version = "0.6" }
|
||||
vbsp = { version = "0.2.0", git = "https://github.com/icewind1991/vbsp" }
|
||||
#vbsp = { version = "0.2.0", path = "../bsp" }
|
||||
vbsp = { version = "0.3.0", git = "https://github.com/icewind1991/vbsp" }
|
||||
#vbsp = { version = "0.3.0", path = "../bsp" }
|
||||
miette = { version = "5.5.0", features = ["fancy"] }
|
||||
thiserror = "1.0.37"
|
||||
delaunator = "1.0.1"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use std::fmt::{Debug, Formatter};
|
|||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
use steamlocate::SteamDir;
|
||||
use tracing::{debug, info};
|
||||
use tracing::debug;
|
||||
use vbsp::Packfile;
|
||||
use vpk::VPK;
|
||||
|
||||
|
|
@ -24,15 +24,20 @@ impl Debug for Loader {
|
|||
|
||||
impl Loader {
|
||||
pub fn new() -> Result<Self, Error> {
|
||||
let tf_dir = SteamDir::locate()
|
||||
let tf2_dir = SteamDir::locate()
|
||||
.ok_or("Can't find steam directory")?
|
||||
.app(&440)
|
||||
.ok_or("Can't find tf2 directory")?
|
||||
.path
|
||||
.join("tf");
|
||||
.clone();
|
||||
|
||||
let tf_dir = tf2_dir.join("tf");
|
||||
let hl_dir = tf2_dir.join("hl2");
|
||||
let download = tf_dir.join("download");
|
||||
|
||||
let vpks = tf_dir
|
||||
.read_dir()?
|
||||
.chain(hl_dir.read_dir()?)
|
||||
.filter_map(|item| item.ok())
|
||||
.filter_map(|item| Some(item.path().to_str()?.to_string()))
|
||||
.filter(|path| path.ends_with("dir.vpk"))
|
||||
|
|
@ -106,7 +111,6 @@ impl Loader {
|
|||
return Ok(data);
|
||||
}
|
||||
}
|
||||
info!("Failed to find {} in vpk", name);
|
||||
Err(Error::ResourceNotFound(name.to_string()))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue