);
}
- const winner = instance.winner === playerTeam.id ? playerTeam.name : otherTeam.name;
+ const winner = instance.winner === playerTeam.id ? playerTeam : otherTeam;
return (
-
-
{winner} wins
+
)
diff --git a/client/src/components/instance.component.jsx b/client/src/components/instance.component.jsx
index 3d935752..44df54e7 100644
--- a/client/src/components/instance.component.jsx
+++ b/client/src/components/instance.component.jsx
@@ -62,9 +62,9 @@ class Instance extends Component {
if (!instance) return false;
- if (instance.phase !== 'InProgress') {
+ // if (instance.phase !== 'InProgress') {
return
;
- }
+ // }
function instanceClick(e) {
e.stopPropagation();
diff --git a/client/src/components/scoreboard.jsx b/client/src/components/scoreboard.jsx
deleted file mode 100644
index ee2e9e1d..00000000
--- a/client/src/components/scoreboard.jsx
+++ /dev/null
@@ -1,52 +0,0 @@
-const preact = require('preact');
-const { connect } = require('preact-redux');
-
-const addState = connect(
- function receiveState(state) {
- const {
- ws,
- instance
- } = state;
-
- return { instance };
- },
-);
-
-function ScoreBoard(args) {
- const {
- instance,
- } = args;
-
- const players = instance.players.map((p, i) => {
- if (instance.phase === 'Finished') {
- const winner = p.wins > instance.max_rounds / 2;
- return
- | {p.name} |
- {p.wins} / {p.losses} |
- {winner ? 'winner' : ''} |
-
- }
-
- const text = instance.phase === 'Finished'
- ? p.wins > instance.rounds / 2 && 'Winner'
- : '';
-
- return
- | {p.name} |
- {p.wins} / {p.losses} |
- {p.ready ? 'ready' : ''} |
-
- });
-
- return (
-
- );
-}
-
-module.exports = addState(ScoreBoard);
diff --git a/client/src/components/vertical.thresholds.js b/client/src/components/vertical.thresholds.js
deleted file mode 100644
index ab079170..00000000
--- a/client/src/components/vertical.thresholds.js
+++ /dev/null
@@ -1,172 +0,0 @@
-const preact = require('preact');
-const range = require('lodash/range');
-
-const { INFO } = require('./../constants');
-const { convertItem } = require('../utils');
-const shapes = require('./shapes');
-
-const ScoreBoard = require('./scoreboard');
-
-function InfoComponent(args) {
- const {
- itemInfo,
- combiner,
- player,
- instance,
- } = args;
-
- args.info = 'PowerRG';
- const { info } = args;
-
- function Info() {
- if (!info) return false;
- const fullInfo = itemInfo.items.find(i => i.item === info) || INFO[info];
- if (!fullInfo) return false;
- const isSkill = fullInfo.skill;
- const isSpec = fullInfo.spec;
-
- if (isSkill) {
- return (
-
-
{fullInfo.item}
-
{fullInfo.description}
-
- );
- }
-
- if (isSpec) {
- let red = 0;
- let blue = 0;
- let green = 0;
- player.constructs.forEach(construct => {
- red += construct.colours.red;
- blue += construct.colours.blue;
- green += construct.colours.green;
- });
- const teamColours = { red, blue, green };
-
- const colourReqs = fullInfo.values.bonuses || [];
-
- const thresholds = colourReqs.map((bonus, i) => {
- const colours = ['red', 'green', 'blue'];
- const colourGoals = colours.map(c => {
- const colourReq = bonus.req[c];
- if (colourReqs === 0) return false;
-
- const start = i === 0
- ? 0
- : colourReqs[i - 1].req[c];
-
- const dots = range(start, colourReq).map(j => {
- const unmet = teamColours[c] < j + 1;
-
- const reqClass = unmet
- ? 'unmet'
- : '';
-
- return (
-
- {shapes.square([c])}
-
- );
- });
-
- return (
-
- {dots}
-
- );
- });
-
- const reqsMet = colours.every(c => teamColours[c] >= bonus.req[c]);
-
- const reqClass = reqsMet
- ? ''
- : 'unmet';
-
- return (
-
-
- {colourGoals}
-
-
- + {bonus.bonus}
-
-
-
- );
- });
-
- return (
-
-
{info}
-
{fullInfo.description}
-
- {thresholds}
-
-
- );
- }
-
- return (
-
-
{fullInfo.item}
-
{fullInfo.description}
-
- );
- }
-
- function Combos() {
- if (!player) return false;
-
- // show recipe for what's in combiner
- if (combiner.some(u => u !== null)) {
- const filteredCombos = itemInfo.combos
- .filter(combo => combiner.every(u => u === null
- || combo.components.includes(player.vbox.bound[u])));
- if (filteredCombos.length > 6) return false;
- return (
-
-
- {filteredCombos.map((c, i) =>
-
- | {convertItem(c.item)} |
- {c.components.map((u, j) => {convertItem(u)} | )}
-
- )}
-
-
- );
- }
-
- if (!info) return false;
- const vboxCombos = itemInfo.combos.filter(c => c.components.includes(info));
- if (vboxCombos.length > 6) return false;
- return (
-
-
- {vboxCombos.map((c, i) =>
-
- | {convertItem(c.item)} |
- {c.components.map((u, j) => {convertItem(u)} | )}
-
- )}
-
-
- );
- }
-
- const scoreboard = instance.phase === 'Lobby' || info
- ? null
- :
;
-
- return (
-
- {scoreboard}
-
-
-
- );
-}
-
-module.exports = InfoComponent;