From 6fffddd15c0adda5d24e272d7a393357d959d459 Mon Sep 17 00:00:00 2001 From: ntr Date: Thu, 30 May 2019 12:51:12 +1000 Subject: [PATCH] fix team --- WORKLOG.md | 2 ++ client/assets/styles/styles.css | 38 +++++++++++++++---------- client/src/components/spawn.button.jsx | 39 ++++++++++++-------------- client/src/components/team.jsx | 13 ++++----- server/src/game.rs | 7 +++-- 5 files changed, 53 insertions(+), 46 deletions(-) diff --git a/WORKLOG.md b/WORKLOG.md index 601e950b..f57bc9f7 100644 --- a/WORKLOG.md +++ b/WORKLOG.md @@ -49,6 +49,8 @@ * warden * set upkeep_at timestamp for games and instances +* log game results for analysis + ## SOON * push events diff --git a/client/assets/styles/styles.css b/client/assets/styles/styles.css index b07add5f..6bd4ee34 100644 --- a/client/assets/styles/styles.css +++ b/client/assets/styles/styles.css @@ -352,7 +352,7 @@ header { } /* - MENU + TEAM */ .menu-constructs { @@ -365,22 +365,40 @@ header { } .menu-constructs .list { + margin-top: 0.5em; grid-area: list; display: grid; grid-template-columns: repeat(3, 1fr); + grid-auto-rows: 1fr; + grid-gap: 0.5em; } -.menu-construct-ctr { - /*flex: 0 0 30%;*/ +.menu-construct { + height: 100%; + box-sizing: border-box; + border: 1px solid black; display: flex; flex-flow: column; text-align: center; justify-content: center; + + transition-property: border; + transition-duration: 0.5s; + transition-delay: 0; + transition-timing-function: ease; } -.spawn-btn .menu-construct { +.menu-construct:nth-child(3n) { + margin-right: 0; +} + +.menu-construct:first-child, .menu-construct:nth-child(4n) { + margin-left: 0; +} + +.spawn-btn.menu-construct { border: 1px solid #333; color: #333; display: flex; @@ -405,17 +423,7 @@ header { opacity: 0 } -.menu-construct { - height: 100%; - margin: 0.5em; - box-sizing: border-box; - border: 1px solid black; - - transition-property: border; - transition-duration: 0.5s; - transition-delay: 0; - transition-timing-function: ease; -} +/* INSTANCE LIST */ .menu-instance-list { flex: 1; diff --git a/client/src/components/spawn.button.jsx b/client/src/components/spawn.button.jsx index ace05224..65924d77 100644 --- a/client/src/components/spawn.button.jsx +++ b/client/src/components/spawn.button.jsx @@ -17,27 +17,24 @@ function SpawnButton({ spawn }) { return (
-
enabledToggle(e)} > -

+

- nameInput(e)} - /> - -
+ className="menu-construct spawn-btn" + onClick={e => enabledToggle(e)} > +

+

+ nameInput(e)} + /> +
); } diff --git a/client/src/components/team.jsx b/client/src/components/team.jsx index 2d7a9878..c089a272 100644 --- a/client/src/components/team.jsx +++ b/client/src/components/team.jsx @@ -89,14 +89,11 @@ function Team(args) { return (
-
selectConstruct(construct.id)} > - {constructAvatar(construct.name, construct.id)} -

{construct.name}

-
+ className="menu-construct" + style={ { 'border-color': borderColour || 'whitesmoke' } } + onClick={() => selectConstruct(construct.id)} > + {constructAvatar(construct.name, construct.id)} +

{construct.name}

); }); diff --git a/server/src/game.rs b/server/src/game.rs index 5cbf6120..12c5ba26 100644 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -166,8 +166,11 @@ impl Game { } fn skill_phase_start(mut self, num_resolutions: usize) -> Game { - let phase_add_time_ms = 60000 + num_resolutions * 2500; - self.phase_start = Utc::now(); + let resolution_animation_ms = num_resolutions * 2500; + let phase_add_time_ms = 60000 + resolution_animation_ms; + self.phase_start = Utc::now() + .checked_add_signed(Duration::milliseconds(resolution_animation_ms as i64)) + .expect("could not set phase start"); self.phase_end = Utc::now() .checked_add_signed(Duration::milliseconds(phase_add_time_ms as i64)) .expect("could not set phase end");