From ee21d7ee069742913177a4a2b12d0b366cccc93e Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 20 Sep 2019 12:16:37 +1000 Subject: [PATCH 01/16] boxes wit msgs --- client/assets/styles/controls.less | 2 +- client/assets/styles/instance.less | 9 ------ client/assets/styles/player.less | 32 ++++++++++++++------ client/assets/styles/styles.less | 9 ++++++ client/src/components/instance.ctrl.btns.jsx | 1 + client/src/components/instance.ctrl.jsx | 2 +- client/src/components/player.box.jsx | 25 ++++++++++----- server/src/skill.rs | 3 -- 8 files changed, 51 insertions(+), 32 deletions(-) diff --git a/client/assets/styles/controls.less b/client/assets/styles/controls.less index 58bc0b9f..bbdecce2 100644 --- a/client/assets/styles/controls.less +++ b/client/assets/styles/controls.less @@ -38,7 +38,7 @@ aside { } div { - text-align: right; + text-align: center; } button { diff --git a/client/assets/styles/instance.less b/client/assets/styles/instance.less index 9d3ea05a..151443c1 100644 --- a/client/assets/styles/instance.less +++ b/client/assets/styles/instance.less @@ -195,15 +195,6 @@ } .construct-list { - .avatar { - grid-area: avatar; - object-fit: contain; - background-size: contain; - background-repeat: no-repeat; - background-position: center; - // pointer-events: none; - } - .name { grid-area: name; margin-bottom: 0.5em; diff --git a/client/assets/styles/player.less b/client/assets/styles/player.less index 3dd302b9..03465f16 100644 --- a/client/assets/styles/player.less +++ b/client/assets/styles/player.less @@ -2,29 +2,35 @@ .player-box { display: grid; - grid-template-areas: - "score" + "msg" "img" + "name" + "score" "ctrl"; + grid-template-rows: min-content 1fr min-content min-content min-content; + &.top { grid-template-areas: "ctrl" + "score" + "name" "img" - "score"; + "msg"; - .img { - display: flex; - flex-flow: column; - justify-content: flex-end; - } + grid-template-rows: min-content min-content min-content 1fr min-content; } - grid-template-rows: min-content 1fr min-content; - .score { grid-area: score; + display: flex; + justify-content: space-around; + text-align: center; + + span { + flex: 1; + } } .img { @@ -34,4 +40,10 @@ .ctrl { grid-area: ctrl; } + + .msg { + grid-area: msg; + color: @white; + } + } diff --git a/client/assets/styles/styles.less b/client/assets/styles/styles.less index 2eb724cd..6b5aa562 100644 --- a/client/assets/styles/styles.less +++ b/client/assets/styles/styles.less @@ -299,6 +299,15 @@ li { background-position: center; } +.avatar { + grid-area: avatar; + object-fit: contain; + background-size: contain; + background-repeat: no-repeat; + background-position: center; + // pointer-events: none; +} + #clipboard { width: 1px; height: 1px; diff --git a/client/src/components/instance.ctrl.btns.jsx b/client/src/components/instance.ctrl.btns.jsx index 828dc3a9..0c162966 100644 --- a/client/src/components/instance.ctrl.btns.jsx +++ b/client/src/components/instance.ctrl.btns.jsx @@ -67,6 +67,7 @@ function InstanceCtrlBtns(args) { return (
+ {game ? : null}
diff --git a/client/src/components/instance.ctrl.jsx b/client/src/components/instance.ctrl.jsx index 329eea45..afb4c52a 100644 --- a/client/src/components/instance.ctrl.jsx +++ b/client/src/components/instance.ctrl.jsx @@ -95,8 +95,8 @@ function Controls(args) { {timer}
- {ready} + {ready}
diff --git a/client/src/components/player.box.jsx b/client/src/components/player.box.jsx index 322dbdde..0ecd149f 100644 --- a/client/src/components/player.box.jsx +++ b/client/src/components/player.box.jsx @@ -10,12 +10,13 @@ function Scoreboard(args) { } = args; const scoreText = () => { - if (player.score === 'Zero') return '▫▫▫'; - if (player.score === 'One') return '■▫▫'; - if (player.score === 'Two') return '■■▫'; - if (player.score === 'Win') return '■■■'; + if (player.score === 'Zero') return [, , ]; + if (player.score === 'One') return [, , ]; + if (player.score === 'Two') return [, , ]; + if (player.score === 'Win') return [, , ]; return ''; }; + /* let scoreText = () => { if (player.score === 'Zero') return '▫▫▫▫'; @@ -33,18 +34,26 @@ function Scoreboard(args) {
 
{scoreText()}
-
-
{player.name}
+
{player.name}
+
+  
+
lucker noob
); } return (
+
reported
{scoreText()}
-
-
{player.name}
+
{player.name}
+
+  
{leave ? : null} diff --git a/server/src/skill.rs b/server/src/skill.rs index e66ab6a4..66cceb66 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -1237,9 +1237,6 @@ impl Skill { Skill::Reflect| Skill::ReflectPlus | Skill::ReflectPlusPlus | - Skill::Link| - Skill::LinkPlus | - Skill::LinkPlusPlus | Skill::Triage| Skill::TriagePlus | Skill::TriagePlusPlus => true, From c34958d000273b338798d0b74e08cc2a22f8ad64 Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 20 Sep 2019 14:08:31 +1000 Subject: [PATCH 02/16] logo cleanout --- client/assets/styles/styles.less | 2 +- .../svgs/{mnml.2.svg => menu.logo.svg} | 0 client/src/components/svgs/mnml.3.svg | 177 ---------------- client/src/components/svgs/mnml.4.svg | 177 ---------------- .../src/components/svgs/mnml.horizontal.svg | 191 ------------------ client/src/components/svgs/mnml.line.svg | 98 --------- client/src/components/svgs/mnml.plain.svg | 181 ----------------- client/src/components/svgs/mnml.svg | 190 ----------------- 8 files changed, 1 insertion(+), 1015 deletions(-) rename client/src/components/svgs/{mnml.2.svg => menu.logo.svg} (100%) delete mode 100644 client/src/components/svgs/mnml.3.svg delete mode 100644 client/src/components/svgs/mnml.4.svg delete mode 100644 client/src/components/svgs/mnml.horizontal.svg delete mode 100644 client/src/components/svgs/mnml.line.svg delete mode 100644 client/src/components/svgs/mnml.plain.svg delete mode 100644 client/src/components/svgs/mnml.svg diff --git a/client/assets/styles/styles.less b/client/assets/styles/styles.less index 6b5aa562..c512bf0f 100644 --- a/client/assets/styles/styles.less +++ b/client/assets/styles/styles.less @@ -286,7 +286,7 @@ li { .logo { height: 2em; - background-image: url("../../src/components/svgs/mnml.2.svg"); + background-image: url("../../src/components/svgs/menu.logo.svg"); background-size: contain; background-repeat: no-repeat; background-position: left; diff --git a/client/src/components/svgs/mnml.2.svg b/client/src/components/svgs/menu.logo.svg similarity index 100% rename from client/src/components/svgs/mnml.2.svg rename to client/src/components/svgs/menu.logo.svg diff --git a/client/src/components/svgs/mnml.3.svg b/client/src/components/svgs/mnml.3.svg deleted file mode 100644 index 7411fc7f..00000000 --- a/client/src/components/svgs/mnml.3.svg +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - mnml.gg - - - - - - - - - - - - - - - - - - - - - - - diff --git a/client/src/components/svgs/mnml.4.svg b/client/src/components/svgs/mnml.4.svg deleted file mode 100644 index 801d6215..00000000 --- a/client/src/components/svgs/mnml.4.svg +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - mnml.gg - - - - - - - - - - - - - - - - - - - - - - - diff --git a/client/src/components/svgs/mnml.horizontal.svg b/client/src/components/svgs/mnml.horizontal.svg deleted file mode 100644 index 5b0aa973..00000000 --- a/client/src/components/svgs/mnml.horizontal.svg +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - mnml.gg - - - - - - - - - - - - - - - - - - - - - - diff --git a/client/src/components/svgs/mnml.line.svg b/client/src/components/svgs/mnml.line.svg deleted file mode 100644 index d2591da5..00000000 --- a/client/src/components/svgs/mnml.line.svg +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - - - mnml.gg - - - - diff --git a/client/src/components/svgs/mnml.plain.svg b/client/src/components/svgs/mnml.plain.svg deleted file mode 100644 index 65379683..00000000 --- a/client/src/components/svgs/mnml.plain.svg +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - - mnml.gg - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/client/src/components/svgs/mnml.svg b/client/src/components/svgs/mnml.svg deleted file mode 100644 index 0e5af50f..00000000 --- a/client/src/components/svgs/mnml.svg +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - - - mnml.gg - - - - - - - - - - - - - - - - - abstract strategy v - - - - - - From bec7685f7b8afa011ae3b1c36c40dc3b869d3015 Mon Sep 17 00:00:00 2001 From: ntr Date: Sat, 21 Sep 2019 17:22:38 +1000 Subject: [PATCH 03/16] solidify controls --- client/src/components/game.ctrl.btns.jsx | 96 ++++++++++++++++++++ client/src/components/game.ctrl.jsx | 70 +------------- client/src/components/instance.ctrl.btns.jsx | 48 +++++----- client/src/components/instance.ctrl.jsx | 46 ++-------- 4 files changed, 128 insertions(+), 132 deletions(-) create mode 100644 client/src/components/game.ctrl.btns.jsx diff --git a/client/src/components/game.ctrl.btns.jsx b/client/src/components/game.ctrl.btns.jsx new file mode 100644 index 00000000..c990d2df --- /dev/null +++ b/client/src/components/game.ctrl.btns.jsx @@ -0,0 +1,96 @@ +const preact = require('preact'); +const { connect } = require('preact-redux'); + +const actions = require('../actions'); + +const addState = connect( + function receiveState(state) { + const { + ws, + game, + animating, + } = state; + + function sendReady() { + document.activeElement.blur(); + return ws.sendGameReady(game.id); + } + + function getInstanceState() { + return ws.sendInstanceState(game.instance); + } + + function sendGameSkillClear() { + return ws.sendGameSkillClear(game.id); + } + + function sendAbandon() { + return ws.sendInstanceAbandon(game.instance); + } + + return { + game, + sendAbandon, + sendGameSkillClear, + sendReady, + getInstanceState, + animating, + }; + }, + + function receiveDispatch(dispatch) { + function quit() { + dispatch(actions.setNav('transition')); + dispatch(actions.setGame(null)); + dispatch(actions.setInstance(null)); + } + + return { quit }; + } +); + +function InstanceCtrlBtns(args) { + const { + game, + animating, + + getInstanceState, + sendAbandon, + sendGameSkillClear, + sendReady, + quit, + } = args; + + if (!game) return false; + + const finished = game.phase === 'Finish'; + const { abandonState } = this.state; + + const abandonStateTrue = e => { + e.stopPropagation(); + this.setState({ abandonState: true }); + setTimeout(() => this.setState({ abandonState: false }), 2000); + }; + + const abandonClasses = `abandon ${abandonState ? 'confirming' : ''}`; + const abandonAction = abandonState ? sendAbandon : abandonStateTrue; + + function quitClick() { + getInstanceState(); + quit(); + } + + const readyBtn = ; + const quitBtn = ; + + return ( +
+ {finished ? quitBtn : readyBtn} + + + +
+ ); +} + +module.exports = addState(InstanceCtrlBtns); diff --git a/client/src/components/game.ctrl.jsx b/client/src/components/game.ctrl.jsx index 0aa4220f..696d67bc 100644 --- a/client/src/components/game.ctrl.jsx +++ b/client/src/components/game.ctrl.jsx @@ -4,80 +4,33 @@ const { connect } = require('preact-redux'); const actions = require('../actions'); const PlayerBox = require('./player.box'); -const InstanceCtrlBtns = require('./instance.ctrl.btns'); +const GameCtrlButtons = require('./game.ctrl.btns'); const addState = connect( function receiveState(state) { const { - ws, game, account, - animating, } = state; - function sendReady() { - document.activeElement.blur(); - return ws.sendGameReady(game.id); - } - - function getInstanceState() { - return ws.sendInstanceState(game.instance); - } - - function sendGameSkillClear() { - return ws.sendGameSkillClear(game.id); - } - - function sendAbandon() { - return ws.sendInstanceAbandon(game.instance); - } - return { game, - sendAbandon, - sendGameSkillClear, - sendReady, account, - getInstanceState, - animating, }; }, - - function receiveDispatch(dispatch) { - function quit() { - dispatch(actions.setNav('transition')); - dispatch(actions.setGame(null)); - dispatch(actions.setInstance(null)); - } - - return { quit }; - } ); function Controls(args) { const { account, - sendAbandon, game, - animating, - sendGameSkillClear, - sendReady, - getInstanceState, - quit, } = args; if (!game) return false; - const { abandonState } = this.state; - const opponent = game.players.find(t => t.id !== account.id); const player = game.players.find(t => t.id === account.id); - function quitClick() { - getInstanceState(); - quit(); - } - const zero = Date.parse(game.phase_start); const now = Date.now(); const end = Date.parse(game.phase_end); @@ -104,30 +57,13 @@ function Controls(args) {
); - const readyBtn = ; - const quitBtn = ; - - const cancelAbandon = e => { - e.stopPropagation(); - return this.setState({ abandonState: false }); - }; - - const abandonStateTrue = e => { - e.stopPropagation(); - this.setState({ abandonState: true }); - }; - - const abandonClasses = `abandon ${abandonState ? 'confirming' : ''}`; - const abandonAction = abandonState ? sendAbandon : abandonStateTrue; - return ( -
-
lucker noob
+
glhf
); } return (
-
reported
+
hfhf
{scoreText()}
{player.name}
Date: Sun, 22 Sep 2019 13:16:59 +1000 Subject: [PATCH 05/16] move abandon btn --- client/assets/styles/controls.less | 17 +++-- client/src/components/game.ctrl.btns.jsx | 30 +-------- client/src/components/game.ctrl.btns.top.jsx | 64 +++++++++++++++++++ client/src/components/game.ctrl.jsx | 2 + client/src/components/instance.ctrl.btns.jsx | 30 +-------- client/src/components/instance.ctrl.jsx | 2 + .../src/components/instance.ctrl.top.btns.jsx | 64 +++++++++++++++++++ client/src/components/player.box.jsx | 9 --- 8 files changed, 148 insertions(+), 70 deletions(-) create mode 100644 client/src/components/game.ctrl.btns.top.jsx create mode 100644 client/src/components/instance.ctrl.top.btns.jsx diff --git a/client/assets/styles/controls.less b/client/assets/styles/controls.less index e00c633a..25d7538d 100644 --- a/client/assets/styles/controls.less +++ b/client/assets/styles/controls.less @@ -22,7 +22,14 @@ aside { grid-area: controls; display: grid; - grid-auto-rows: 1fr; + + grid-template-areas: + "top" + "p0" + "p1" + "bottom"; + + grid-template-rows: min-content 3fr 3fr 1fr; grid-gap: 0.5em 0; } @@ -107,11 +114,11 @@ aside { button { flex: 0; + } - &:first-child { - flex: 1; - font-size: 200%; - } + .ready { + flex: 1; + font-size: 200%; } } diff --git a/client/src/components/game.ctrl.btns.jsx b/client/src/components/game.ctrl.btns.jsx index c990d2df..1b091c3c 100644 --- a/client/src/components/game.ctrl.btns.jsx +++ b/client/src/components/game.ctrl.btns.jsx @@ -49,48 +49,24 @@ const addState = connect( } ); -function InstanceCtrlBtns(args) { +function GameCtrlBtns(args) { const { game, animating, - getInstanceState, - sendAbandon, sendGameSkillClear, sendReady, - quit, } = args; if (!game) return false; - const finished = game.phase === 'Finish'; - const { abandonState } = this.state; - - const abandonStateTrue = e => { - e.stopPropagation(); - this.setState({ abandonState: true }); - setTimeout(() => this.setState({ abandonState: false }), 2000); - }; - - const abandonClasses = `abandon ${abandonState ? 'confirming' : ''}`; - const abandonAction = abandonState ? sendAbandon : abandonStateTrue; - - function quitClick() { - getInstanceState(); - quit(); - } - - const readyBtn = ; - const quitBtn = ; - return (
- {finished ? quitBtn : readyBtn} - +
); } -module.exports = addState(InstanceCtrlBtns); +module.exports = addState(GameCtrlBtns); diff --git a/client/src/components/game.ctrl.btns.top.jsx b/client/src/components/game.ctrl.btns.top.jsx new file mode 100644 index 00000000..5abcdcae --- /dev/null +++ b/client/src/components/game.ctrl.btns.top.jsx @@ -0,0 +1,64 @@ +const preact = require('preact'); +const { connect } = require('preact-redux'); + +const actions = require('../actions'); + +const addState = connect( + function receiveState(state) { + const { + ws, + game, + } = state; + + function sendAbandon() { + return ws.sendInstanceAbandon(game.instance); + } + + return { + game, + + sendAbandon, + }; + }, + function receiveDispatch(dispatch) { + function leave() { + dispatch(actions.setNav('play')); + dispatch(actions.setGame(null)); + dispatch(actions.setInstance(null)); + } + + return { leave }; + } +); + +function GameCtrlTopBtns(args) { + const { + game, + + leave, + sendAbandon, + } = args; + + const finished = game && game.phase === 'Finished'; + const { abandonState } = this.state; + + const abandonStateTrue = e => { + e.stopPropagation(); + this.setState({ abandonState: true }); + setTimeout(() => this.setState({ abandonState: false }), 2000); + }; + + const abandonClasses = `abandon ${abandonState ? 'confirming' : ''}`; + const abandonAction = abandonState ? sendAbandon : abandonStateTrue; + + const abandonBtn = ; + const leaveBtn = ; + + return ( +
+ {finished ? leaveBtn : abandonBtn} +
+ ); +} + +module.exports = addState(GameCtrlTopBtns); diff --git a/client/src/components/game.ctrl.jsx b/client/src/components/game.ctrl.jsx index 696d67bc..12c308a5 100644 --- a/client/src/components/game.ctrl.jsx +++ b/client/src/components/game.ctrl.jsx @@ -5,6 +5,7 @@ const actions = require('../actions'); const PlayerBox = require('./player.box'); const GameCtrlButtons = require('./game.ctrl.btns'); +const GameCtrlTopButtons = require('./game.ctrl.btns.top'); const addState = connect( function receiveState(state) { @@ -61,6 +62,7 @@ function Controls(args) {