From bedd6814a79eecf6a8bc8e64f761cc8091762eb6 Mon Sep 17 00:00:00 2001 From: ntr Date: Mon, 6 May 2019 20:21:28 +1000 Subject: [PATCH] log fix --- client/src/components/game.component.jsx | 14 ++++++-------- client/src/components/game.container.jsx | 4 ++-- client/src/components/vbox.component.jsx | 12 +----------- client/src/main.jsx | 1 + 4 files changed, 10 insertions(+), 21 deletions(-) diff --git a/client/src/components/game.component.jsx b/client/src/components/game.component.jsx index f44a447a..57cc223f 100644 --- a/client/src/components/game.component.jsx +++ b/client/src/components/game.component.jsx @@ -4,11 +4,8 @@ const range = require('lodash/range'); const { STATS, eventClasses, getCombatText, crypAvatar } = require('../utils'); const GameCryp = require('./game.cryp'); -const SkillBtn = require('./skill.btn'); const TargetingArrows = require('./targeting.arrows'); -// const SKILL_HOT_KEYS = ['Q', 'W', 'E', 'R']; - function GamePanel(props) { const { game, @@ -19,22 +16,23 @@ function GamePanel(props) { selectSkillTarget, sendInstanceState, sendGameReady, - activeCryp, account, - showAlt, + showLog, toggleLog, quit, } = props; if (!game) return
...
; - if (showAlt) { + + console.log(showLog); + if (showLog) { const logs = game.log.map((l, i) => (
{l}
)).reverse(); return (
@@ -62,7 +60,7 @@ function GamePanel(props) {
diff --git a/client/src/components/game.container.jsx b/client/src/components/game.container.jsx index bed2a16f..473782f5 100644 --- a/client/src/components/game.container.jsx +++ b/client/src/components/game.container.jsx @@ -11,7 +11,7 @@ const addState = connect( game, account, resolution, - showAlt, + showLog, activeSkill, activeCryp, } = state; @@ -39,7 +39,7 @@ const addState = connect( return { game, - showAlt, + showLog, account, resolution, activeSkill, diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index 2ebf8209..81cecd30 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -60,17 +60,7 @@ function Vbox(args) { return true; } - const freeHighlight = () => { - if (!info[0] || info[0] !== 'highlight') return false; - return vbox.bound.some(b => { - const v = vboxInfo.vars.find(vi => vi.v === b); - if (info[1] === 'skill') return v.skill; - if (info[1] === 'spec') return v.spec; - return false; - }); - }; - - const freeShouldHighlight = freeHighlight(); + const freeShouldHighlight = info[0] && info[0] === 'highlight'; const freeRows = free.map((row, i) => { const cells = row.map((c, j) => { diff --git a/client/src/main.jsx b/client/src/main.jsx index 45a443f0..b7e4cef9 100644 --- a/client/src/main.jsx +++ b/client/src/main.jsx @@ -36,6 +36,7 @@ const store = createStoreWithMiddleware( selectedCryps: reducers.selectedCrypsReducer, vboxInfo: reducers.vboxInfoReducer, vboxHidden: reducers.vboxHiddenReducer, + showLog: reducers.showLogReducer, ws: reducers.wsReducer, }) );