We're going to want this.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
};
}
- ipc.show(y).ui_operation(a, &self.opname, self.wrc)?
+ ipc.show(y).ui_operation(y, a, &self.opname, self.wrc)?
}
}
}
pub type ItemForOutput = (String, ItemEnquiryData);
+pub const VIS: ShowUnocculted = ShowUnocculted::new_visible();
+
#[throws(AE)]
fn preview(items: Vec<ItemForOutput>) {
const BORDER: f64 = 1.;
.context("load")?;
// todo show occulted version too
let mut uos = vec![];
- p.add_ui_operations(&mut uos, &GameState::dummy(), &GPiece::dummy())
+ p.add_ui_operations(VIS, &mut uos, &GameState::dummy(), &GPiece::dummy())
.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>,
+ fn add_ui_operations(&self, _: ShowUnocculted, upd: &mut Vec<UoDescription>,
gs: &GameState, gpc: &GPiece) {
let state: &State = gpc.xdata_exp()?;
}
#[throws(ApiPieceOpError)]
- fn ui_operation(&self, args: ApiPieceOpArgs<'_>,
+ fn ui_operation(&self, _: ShowUnocculted, args: ApiPieceOpArgs<'_>,
opname: &str, _wrc: WhatResponseToClientOp)
-> UpdateFromOpComplex {
let ApiPieceOpArgs { gs,piece,player,ioccults,ipc,ig,.. } = args;
}
#[throws(InternalError)]
- fn add_ui_operations(&self, upd: &mut Vec<UoDescription>,
+ fn add_ui_operations(&self, _: ShowUnocculted, upd: &mut Vec<UoDescription>,
gs: &GameState, gpc: &GPiece) {
let state = self.state(gpc, &gs.occults)?;
if state != Enabled {
}
#[throws(ApiPieceOpError)]
- fn ui_operation(&self, a: ApiPieceOpArgs<'_>,
+ fn ui_operation(&self, _: ShowUnocculted,
+ a: ApiPieceOpArgs<'_>,
opname: &str, wrc: WhatResponseToClientOp)
-> UpdateFromOpComplex {
let ApiPieceOpArgs { gs,player,piece,ipieces,ioccults,to_recalculate,.. } = a;
fn nfaces(&self) -> RawFaceId;
#[throws(InternalError)]
- fn add_ui_operations(&self, _upd: &mut Vec<UoDescription>,
+ fn add_ui_operations(&self, _: ShowUnocculted,
+ _upd: &mut Vec<UoDescription>,
_gs: &GameState, _gpc: &GPiece) { }
- fn ui_operation(&self, _a: ApiPieceOpArgs<'_>,
+ fn ui_operation(&self, _: ShowUnocculted, _a: ApiPieceOpArgs<'_>,
_opname: &str, _wrc: WhatResponseToClientOp)
-> Result<UpdateFromOpComplex, ApiPieceOpError> {
throw!(OE::BadOperation)
}
#[throws(InternalError)]
- fn add_ui_operations(&self, upd: &mut Vec<UoDescription>,
+ fn add_ui_operations(&self, _: ShowUnocculted, upd: &mut Vec<UoDescription>,
_gs: &GameState, gpc: &GPiece) {
upd.push(if_chain! {
if let Some(xdata) = gpc.xdata.get::<HandState>()?;
}
#[throws(ApiPieceOpError)]
- fn ui_operation(&self, mut a: ApiPieceOpArgs<'_>,
+ fn ui_operation(&self, _: ShowUnocculted, mut a: ApiPieceOpArgs<'_>,
opname: &str, wrc: WhatResponseToClientOp)
-> UpdateFromOpComplex {
if let Some(r) = {
desc: Html::lit("flip").into(),
})
}
- ipc.show(y).add_ui_operations(&mut out, gs, gpc)?;
+ ipc.show(y).add_ui_operations(y, &mut out, gs, gpc)?;
out
}
}