From: Ian Jackson Date: Sun, 23 Aug 2020 22:19:46 +0000 (+0100) Subject: table size propagates X-Git-Tag: otter-0.2.0~1055 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=1c80fd20e77604bb46df8b34880effbffac90649;p=otter.git table size propagates --- diff --git a/demo/test.game.toml b/demo/test.game.toml index 6c19b27c..770d55b4 100644 --- a/demo/test.game.toml +++ b/demo/test.game.toml @@ -1,4 +1,4 @@ -# table_size = [300, 200] +table_size = [300, 100] [[pieces]] pos = [90,80] diff --git a/save/g-dummy b/save/g-dummy index 70627252..bcaebbd7 100644 Binary files a/save/g-dummy and b/save/g-dummy differ diff --git a/src/gamestate.rs b/src/gamestate.rs index 697a328e..ba5cbb26 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -22,7 +22,7 @@ visible_slotmap_key!{ VisiblePieceId('.') } #[serde(try_from="f64")] pub struct ZCoord(pub f64); -pub const DEFAULT_TABLE_SIZE : Pos = [ 200, 100 ]; +pub const DEFAULT_TABLE_SIZE : Pos = [ 400, 200 ]; // ---------- general data types ---------- diff --git a/src/session.rs b/src/session.rs index c512e931..fdaaa615 100644 --- a/src/session.rs +++ b/src/session.rs @@ -7,6 +7,7 @@ struct SessionRenderContext { ctoken : String, player : PlayerId, gen : Generation, + table_size : Pos, uses : Vec, defs : Vec<(VisiblePieceId,String)>, nick : String, @@ -113,6 +114,7 @@ fn session(form : Json) -> Result { ctoken : ctoken.0, gen : ig.gs.gen, log : ig.gs.log.clone(), + table_size : ig.gs.table_size, player, defs : alldefs, uses, diff --git a/templates/session.tera b/templates/session.tera index 69eba9f3..19e5e5e7 100644 --- a/templates/session.tera +++ b/templates/session.tera @@ -11,10 +11,12 @@

- + {%- for piece in uses %}