let loaded = spec.clone().load().context("load")?;
let p = loaded.p; // xxx show occulted version too
let mut uos = vec![];
- p.add_ui_operations(&mut uos, &GPiece::dummy()).context("add uos")?;
+ p.add_ui_operations(&mut uos, &GPiece::dummy(), unocc_ok)
+ .context("add uos")?;
let uos = uos.into_iter().map(|uo| uo.opname).collect::<Vec<_>>();
let spec = spec.clone();
#[throws(InternalError)]
fn add_ui_operations(&self, _upd: &mut Vec<UoDescription>,
- _gpc: &GPiece) { }
+ _gpc: &GPiece, _y: ShowUnocculted) { }
fn ui_operation(&self, _a: ApiPieceOpArgs<'_>,
_opname: &str, _wrc: WhatResponseToClientOp)
#[throws(InternalError)]
fn add_ui_operations(&self, upd: &mut Vec<UoDescription>,
- gpc: &GPiece) {
+ gpc: &GPiece, _: ShowUnocculted) {
upd.push(if_chain! {
if let Some(xdata) = gpc.xdata.get::<HandState>()?;
if let Some(_owner) = &xdata.owner;
#[throws(InternalError)]
pub fn ui_operations(&self, gpc: &GPiece, p: &dyn PieceTrait)
- -> Vec<UoDescription>
+ -> Vec<UoDescription>
{
- match self.occulted {
- PriOcculted::Visible(_) => (),
+ let y = match self.occulted {
+ PriOcculted::Visible(y) => y,
PriOcculted::Occulted | PriOcculted::Displaced(..) => return vec![],
};
desc: Html::lit("flip"),
})
}
- p.add_ui_operations(&mut out, gpc)?;
+ p.add_ui_operations(&mut out, gpc, y)?;
out
}
}