This commit is contained in:
ntr 2019-05-06 20:21:28 +10:00
parent 24ffae70fc
commit bedd6814a7
4 changed files with 10 additions and 21 deletions

View File

@ -4,11 +4,8 @@ const range = require('lodash/range');
const { STATS, eventClasses, getCombatText, crypAvatar } = require('../utils'); const { STATS, eventClasses, getCombatText, crypAvatar } = require('../utils');
const GameCryp = require('./game.cryp'); const GameCryp = require('./game.cryp');
const SkillBtn = require('./skill.btn');
const TargetingArrows = require('./targeting.arrows'); const TargetingArrows = require('./targeting.arrows');
// const SKILL_HOT_KEYS = ['Q', 'W', 'E', 'R'];
function GamePanel(props) { function GamePanel(props) {
const { const {
game, game,
@ -19,22 +16,23 @@ function GamePanel(props) {
selectSkillTarget, selectSkillTarget,
sendInstanceState, sendInstanceState,
sendGameReady, sendGameReady,
activeCryp,
account, account,
showAlt, showLog,
toggleLog, toggleLog,
quit, quit,
} = props; } = props;
if (!game) return <div>...</div>; if (!game) return <div>...</div>;
if (showAlt) {
console.log(showLog);
if (showLog) {
const logs = game.log.map((l, i) => (<div key={i}>{l}</div>)).reverse(); const logs = game.log.map((l, i) => (<div key={i}>{l}</div>)).reverse();
return ( return (
<main className="game"> <main className="game">
<div className="instance-hdr"> <div className="instance-hdr">
<button <button
className="game-btn instance-btn instance-ui-btn left" className="game-btn instance-btn instance-ui-btn left"
onClick={() => toggleLog(!showAlt)}> onClick={() => toggleLog(!showLog)}>
Game Game
</button> </button>
<div className="spacer"> <div className="spacer">
@ -62,7 +60,7 @@ function GamePanel(props) {
</button> </button>
<button <button
className="game-btn instance-btn instance-ui-btn left" className="game-btn instance-btn instance-ui-btn left"
onClick={() => toggleLog(!showAlt)}> onClick={() => toggleLog(!showLog)}>
Log Log
</button> </button>
<div className="spacer"> <div className="spacer">

View File

@ -11,7 +11,7 @@ const addState = connect(
game, game,
account, account,
resolution, resolution,
showAlt, showLog,
activeSkill, activeSkill,
activeCryp, activeCryp,
} = state; } = state;
@ -39,7 +39,7 @@ const addState = connect(
return { return {
game, game,
showAlt, showLog,
account, account,
resolution, resolution,
activeSkill, activeSkill,

View File

@ -60,17 +60,7 @@ function Vbox(args) {
return true; return true;
} }
const freeHighlight = () => { const freeShouldHighlight = info[0] && info[0] === 'highlight';
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 freeRows = free.map((row, i) => { const freeRows = free.map((row, i) => {
const cells = row.map((c, j) => { const cells = row.map((c, j) => {

View File

@ -36,6 +36,7 @@ const store = createStoreWithMiddleware(
selectedCryps: reducers.selectedCrypsReducer, selectedCryps: reducers.selectedCrypsReducer,
vboxInfo: reducers.vboxInfoReducer, vboxInfo: reducers.vboxInfoReducer,
vboxHidden: reducers.vboxHiddenReducer, vboxHidden: reducers.vboxHiddenReducer,
showLog: reducers.showLogReducer,
ws: reducers.wsReducer, ws: reducers.wsReducer,
}) })
); );