mirror of
https://codeberg.org/icewind/vmt-parser.git
synced 2026-06-03 12:04:06 +02:00
underwater doesn't have base texture
This commit is contained in:
parent
ca3db417d5
commit
47e37c5b81
3 changed files with 8 additions and 4 deletions
|
|
@ -88,7 +88,7 @@ impl Material {
|
||||||
Material::VertexLitGeneric(mat) => &mat.base_texture,
|
Material::VertexLitGeneric(mat) => &mat.base_texture,
|
||||||
Material::UnlitGeneric(mat) => &mat.base_texture,
|
Material::UnlitGeneric(mat) => &mat.base_texture,
|
||||||
Material::WorldVertexTransition(mat) => &mat.base_texture,
|
Material::WorldVertexTransition(mat) => &mat.base_texture,
|
||||||
Material::Water(mat) => &mat.base_texture,
|
Material::Water(mat) => mat.base_texture.as_deref().unwrap_or_default(),
|
||||||
Material::EyeRefract(mat) => &mat.iris,
|
Material::EyeRefract(mat) => &mat.iris,
|
||||||
_ => "",
|
_ => "",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,12 @@ use serde::{Deserialize, Serialize};
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub struct WaterMaterial {
|
pub struct WaterMaterial {
|
||||||
/// Usually referred to as a "sludge-layer", acts as a layer on top of the surface of the $AboveWater Material.
|
/// Usually referred to as a "sludge-layer", acts as a layer on top of the surface of the $AboveWater Material.
|
||||||
#[serde(rename = "$basetexture", deserialize_with = "deserialize_path")]
|
#[serde(
|
||||||
pub base_texture: String,
|
rename = "$basetexture",
|
||||||
|
default,
|
||||||
|
deserialize_with = "deserialize_path"
|
||||||
|
)]
|
||||||
|
pub base_texture: Option<String>,
|
||||||
/// Tells this material is used for models and not brushes.
|
/// Tells this material is used for models and not brushes.
|
||||||
#[serde(rename = "$abovewater", default)]
|
#[serde(rename = "$abovewater", default)]
|
||||||
pub above_water: bool,
|
pub above_water: bool,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ source: tests/parse.rs
|
||||||
expression: result
|
expression: result
|
||||||
---
|
---
|
||||||
water(WaterMaterial(
|
water(WaterMaterial(
|
||||||
r#$basetexture: "swamp/water/water_murky",
|
r#$basetexture: Some("swamp/water/water_murky"),
|
||||||
r#$abovewater: true,
|
r#$abovewater: true,
|
||||||
r#$bottommaterial: Some("swamp/water/water_murky_beneath.vmt"),
|
r#$bottommaterial: Some("swamp/water/water_murky_beneath.vmt"),
|
||||||
r#$underwaterover: None,
|
r#$underwaterover: None,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue