lighting
This commit is contained in:
@@ -85,6 +85,10 @@ pub(crate) struct PaletteEntry {
|
||||
/// Object pushability (defaults `false`). Only for `kind = "object"`.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub pushable: Option<bool>,
|
||||
/// Light radius in cells emitted on a dark board (defaults `0` = none).
|
||||
/// Only for `kind = "object"`. See [`ObjectDef::light`].
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub light: Option<u32>,
|
||||
/// Rhai script name. Only for `kind = "object"`.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub script_name: Option<String>,
|
||||
@@ -126,6 +130,8 @@ pub(crate) struct ObjectTemplate {
|
||||
pub solid: bool,
|
||||
pub opaque: bool,
|
||||
pub pushable: bool,
|
||||
/// Light radius in cells (0 = none); see [`ObjectDef::light`].
|
||||
pub light: u32,
|
||||
pub script_name: Option<String>,
|
||||
pub tags: Vec<String>,
|
||||
pub name: Option<String>,
|
||||
@@ -174,6 +180,7 @@ fn resolve_entry(ch: char, e: &PaletteEntry, errors: &mut Vec<LogLine>) -> Resol
|
||||
solid: e.solid.unwrap_or(true),
|
||||
opaque: e.opaque.unwrap_or(true),
|
||||
pushable: e.pushable.unwrap_or(false),
|
||||
light: e.light.unwrap_or(0),
|
||||
script_name: e.script_name.clone(),
|
||||
tags: e.tags.clone().unwrap_or_default(),
|
||||
name: e.name.clone(),
|
||||
|
||||
Reference in New Issue
Block a user