From 59bcdd203f800160b2354fde936fa66f39139928 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 23 May 2021 01:52:36 +0100 Subject: [PATCH] docs: wip document shapelibs, move from shapelib-toml Signed-off-by: Ian Jackson --- docs/shapelibs.rst | 9 ++++++++- src/shapelib-toml.rs | 6 +----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/shapelibs.rst b/docs/shapelibs.rst index 390fe081..3d4a9f50 100644 --- a/docs/shapelibs.rst +++ b/docs/shapelibs.rst @@ -195,4 +195,11 @@ Parameters the other face is the same image, but flipped left-to-right. It doesn't make sense to enable this for pieces with a symmetrical appearance. (It is a bad idea to have the game contain state which - is not visible to the players.) + is not visible to the players.) Not compatible with ``back``. + + * ``back``: [_`Piece spec`]. The back of this piece looks like some + other piece (typically, another library item such as a card back). + If specified, the piece will have two faces: the one implied by its + ``files`` entry, and a 2nd face looking like ``back``. If you want + to make the piece be occultable, you must also specify + ``occulted``. ``back`` is not compatible with ``flip``. diff --git a/src/shapelib-toml.rs b/src/shapelib-toml.rs index 7bea1e28..3759e972 100644 --- a/src/shapelib-toml.rs +++ b/src/shapelib-toml.rs @@ -25,11 +25,7 @@ pub struct GroupDetails { #[serde(default)] pub orig_size: Vec, #[serde(default)] pub centre: Option<[f64; 2]>, #[serde(default)] pub flip: bool, - - /// The back of this is some other item. Doesn't make sense - /// with `flip`. - #[serde(default)] - pub back: Option>, + #[serde(default)] pub back: Option>, /// `size` and `centre` are in the SVG's own internal coordinate /// system, not the Otter scaled coordinates which result from -- 2.30.2