println!(r#"<th align="left"><kbd>{}</kbd></th>"#,
Html::from_txt(&spec.item).0);
println!(r#"<th align="left">{}</th>"#,
- p.describe_html(&GPiece::dummy())?.0);
+ p.describe_html(&GPiece::dummy(), unocc_ok)?.0);
let only1 = s.face_cols(unocc_ok) == 1;
for facecol in 0..(if only1 { 1 } else { max_facecols }) {
fn svg_piece(&self, f: &mut Html, gpc: &GPiece,
id: VisiblePieceId, y: ShowUnocculted) -> Result<(),IE>;
- fn describe_html(&self, gpc: &GPiece) -> Result<Html,IE>;
+ fn describe_html(&self, gpc: &GPiece, y: ShowUnocculted) -> Result<Html,IE>;
fn delete_hook(&self, _p: &GPiece, _gs: &mut GameState)
-> ExecuteGameChangeUpdates {
}
#[throws(IE)]
- fn describe_html(&self, gpc: &GPiece) -> Html {
+ fn describe_html(&self, gpc: &GPiece, _: ShowUnocculted) -> Html {
let xdata = gpc.xdata.get()?;
self.describe_html_inner(xdata)
}
gpieces: &mut GPieces,
goccults: &mut GameOccults,
ipieces: &IPieces,
- _ioccults: &IOccults,
+ ioccults: &IOccults,
to_permute: &mut ToPermute,
piece: PieceId,
// if no change, we return ret_vanilla(log_visible)
let bad = || internal_error_bydebug(&("missing", opiece, h.occid));
let oipc = ipieces.get(opiece).ok_or_else(bad)?;
let ogpc = gpieces.get(opiece).ok_or_else(bad)?;
- Ok::<_,IE>(oipc.p.describe_html(ogpc)?)
+ let ounocc = ogpc.fully_visible_to_everyone()
+ .ok_or_else(||internal_error_bydebug(&(occulteds, &ogpc)))?;
+ Ok::<_,IE>(oipc.p.describe_html(ogpc, ounocc)?)
};
let most_obscure = most_obscure.unwrap_or(&OccK::Visible); // no players!
show)
);
- let log = match most_obscure {
- OccK::Visible => {
+ let log = match most_obscure.map_displaced(|_|((),())).pri_occulted() {
+ Some(PriOG::Visible(_y)) => {
log_visible
}
- OccK::Scrambled | OccK::Displaced{..} => {
- let show = ipc.p.describe_html(gpc)?;
+ Some(prioc@ PriOG::Occulted) |
+ Some(prioc@ PriOG::Displaced(..)) => {
+ let show = prioc.describe(ioccults, gpc, ipc);
call_log_callback(Some(&show))?
},
- OccK::Invisible => {
+ None => {
call_log_callback(None)?
},
};
pub fn describe_fallible(&self, ioccults: &IOccults,
gpc: &GPiece, ipc: &IPiece) -> Html {
match self.instead(ioccults, ipc)? {
- Left(_y) => ipc.p.describe_html(gpc)?,
+ Left(y) => ipc.p.describe_html(gpc, y)?,
Right(i) => i.describe_html()?,
}
}
self.svg_piece_raw(f, gpc.face, &mut |_|Ok(()))?;
}
#[throws(IE)]
- fn describe_html(&self, gpc: &GPiece) -> Html {
+ fn describe_html(&self, gpc: &GPiece, _: ShowUnocculted) -> Html {
Html(if_chain! {
if let face = gpc.face;
if let Some(colour) = self.colours.get(face);
}
#[throws(IE)]
- fn describe_html(&self, gpc: &GPiece) -> Html {
+ fn describe_html(&self, gpc: &GPiece, _: ShowUnocculted) -> Html {
self.descs[ self.faces[gpc.face].desc ].clone()
}
let pat = glob::Pattern::new(pat).map_err(|pe| ME::BadGlob {
pat: pat.to_string(), msg: pe.msg.to_string() })?;
let mut out = vec![];
+ let unocc_ok = ShowUnocculted::new_visible();
for (k,v) in &self.items {
if !pat.matches(&k) { continue }
let loaded = match self.load1(v, &k) {
let ier = ItemEnquiryData {
itemname: k.clone(),
f0bbox,
- f0desc: loaded.p.describe_html(&GPiece::dummy())?,
+ f0desc: loaded.p.describe_html(&GPiece::dummy(), unocc_ok)?,
};
out.push(ier);
}