item_name: Arc<String>,
outline: Outline,
desc: Html,
+ xform: FaceTransform,
svg: parking_lot::Mutex<Option<Arc<Html>>>,
}
struct ItemOccultable {
svg: Arc<Html>,
desc: Html,
+ xform: FaceTransform,
outline: Outline,
}
#[typetag::serde(name="Lib")]
impl OccultedPieceTrait for ItemOccultable {
#[throws(IE)]
- fn svg(&self, f: &mut Html, _:VisiblePieceId) { f.0.write_str(&self.svg.0)? }
+ fn svg(&self, f: &mut Html, _: VisiblePieceId) {
+ self.xform.write_svgd(f, &self.svg)?;
+ }
#[throws(IE)]
fn describe_html(&self) -> Html { self.desc.clone() }
}
};
let it = Box::new(ItemOccultable {
svg,
+ xform: occ.xform.clone(),
desc: occ.desc.clone(),
outline: occ.outline.clone(),
}) as Box<dyn OccultedPieceTrait>;
item_name: Arc::new(subst(&item_name, "_c", &colour)?),
desc: Html(subst(&fe.desc.0, "_colour", "")?),
outline: outline.clone(),
+ xform: FaceTransform::from_group(&group.d),
svg: default(),
}))
},