diff --git a/client/src/components/construct.jsx b/client/src/components/construct.jsx index 34453f9e..57b221ab 100644 --- a/client/src/components/construct.jsx +++ b/client/src/components/construct.jsx @@ -96,16 +96,13 @@ class ConstructAvatar extends Component { } } -function ConstructText(props) { +function ConstructName(props) { const { construct } = props; if (!construct) return false; - - const text = construct.name; - - return

{text}

; + return

{construct.name}

; } module.exports = { ConstructAvatar: addState(ConstructAvatar), - ConstructText, + ConstructName, }; diff --git a/client/src/components/game.construct.jsx b/client/src/components/game.construct.jsx index 7642b014..253b4af6 100644 --- a/client/src/components/game.construct.jsx +++ b/client/src/components/game.construct.jsx @@ -2,7 +2,7 @@ const preact = require('preact'); const { connect } = require('preact-redux'); const range = require('lodash/range'); -const { ConstructAvatar, ConstructText } = require('./construct'); +const { ConstructAvatar, ConstructName } = require('./construct'); const SkillBtn = require('./game.construct.skill.btn'); const ConstructAnimationText = require('./game.construct.anim.text'); @@ -82,7 +82,7 @@ class GameConstruct extends preact.Component {
- +
diff --git a/client/src/components/targeting.arrows.jsx b/client/src/components/targeting.arrows.jsx index bed48261..3b4b2476 100644 --- a/client/src/components/targeting.arrows.jsx +++ b/client/src/components/targeting.arrows.jsx @@ -31,7 +31,6 @@ class TargetSvg extends Component { if (newProps.game !== this.props.game) return true; if (newProps.account !== this.props.account) return true; if (newProps.animating !== this.props.animating) return true; - if (newProps.animSkill !== this.props.animSkill) return true; if (newProps.gameEffectInfo !== this.props.gameEffectInfo) return true; if (newProps.tutorialGame !== this.props.tutorialGame) return true; if (newState.width !== this.state.width) return true; @@ -44,12 +43,9 @@ class TargetSvg extends Component { // Changing State Variables account, animating, - animSkill, game, gameEffectInfo, tutorialGame, - // Static - itemInfo, } = props; const { width, height } = state; @@ -87,14 +83,14 @@ class TargetSvg extends Component { const otherTeam = game.players.find(t => t.id !== account.id); const playerTeamIds = playerTeam.constructs.map(c => c.id); - const outgoing = game.stack.filter(stack => playerTeamIds.includes(stack.source_construct_id)); + const outgoing = game.stack.filter(stack => stack.player === account.id); function getPath(cast) { - const source = playerTeam.constructs.findIndex(c => c.id === cast.source_construct_id); - const defensive = playerTeamIds.includes(cast.target_construct_id); + const source = playerTeam.constructs.findIndex(c => c.id === cast.source); + const defensive = playerTeamIds.includes(cast.target); const target = defensive - ? playerTeam.constructs.findIndex(c => c.id === cast.target_construct_id) - : otherTeam.constructs.findIndex(c => c.id === cast.target_construct_id); + ? playerTeam.constructs.findIndex(c => c.id === cast.target) + : otherTeam.constructs.findIndex(c => c.id === cast.target); const skillNumber = window.innerWidth <= 800 // mobile styling trigger ? playerTeam.constructs[source].skills.findIndex(s => s.skill === cast.skill) diff --git a/client/src/events.jsx b/client/src/events.jsx index b10442ba..a6469389 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -83,11 +83,11 @@ function registerEvents(store) { if (animating) return false; if (game && currentGame) { - if (game.resolved.length !== currentGame.resolved.length) { + if (game.events.length !== currentGame.events.length) { store.dispatch(actions.setAnimating(true)); store.dispatch(actions.setGameSkillInfo(null)); // stop fetching the game state til animations are done - const newRes = game.resolved.slice(currentGame.resolved.length); + const newRes = game.events[currentGame.events.length]; return eachSeries(newRes, (r, cb) => { if (!r.event) return cb(); let timeout = animations.getTime(r.stages);