skill fix"
gp " \
This commit is contained in:
parent
6213bdf421
commit
37be6b633c
@ -477,7 +477,7 @@ header {
|
|||||||
flex-flow: column;
|
flex-flow: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats {
|
.cryp-box .stats {
|
||||||
flex: 0 0 20%;
|
flex: 0 0 20%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
const preact = require('preact');
|
const preact = require('preact');
|
||||||
const range = require('lodash/range');
|
const range = require('lodash/range');
|
||||||
|
|
||||||
const { ITEMS: { SKILLS, COLOURS } } = require('./constants');
|
const { ITEMS: { SKILLS, COLOURS, SPECS: SPEC_CONSTANT } } = require('./constants');
|
||||||
const { COLOUR_ICONS, STATS, SPECS } = require('../utils');
|
const { COLOUR_ICONS, STATS, SPECS } = require('../utils');
|
||||||
|
|
||||||
function Info(args) {
|
function Info(args) {
|
||||||
@ -21,12 +21,13 @@ function Info(args) {
|
|||||||
});
|
});
|
||||||
const teamColours = { red, blue, green };
|
const teamColours = { red, blue, green };
|
||||||
const [type, value] = info;
|
const [type, value] = info;
|
||||||
|
|
||||||
if (type === 'item') {
|
if (type === 'item') {
|
||||||
let itemDetails;
|
let itemDetails;
|
||||||
if (SKILLS[value]) {
|
if (SKILLS[value]) {
|
||||||
itemDetails = SKILLS[value];
|
itemDetails = SKILLS[value];
|
||||||
} else if (SPECS[value]) {
|
} else if (SPEC_CONSTANT[value]) {
|
||||||
itemDetails = SPECS[value];
|
itemDetails = SPEC_CONSTANT[value];
|
||||||
} else if (COLOURS[value]) {
|
} else if (COLOURS[value]) {
|
||||||
itemDetails = COLOURS[value];
|
itemDetails = COLOURS[value];
|
||||||
}
|
}
|
||||||
@ -51,7 +52,7 @@ function Info(args) {
|
|||||||
|
|
||||||
function thresholds(t, spec) {
|
function thresholds(t, spec) {
|
||||||
return (
|
return (
|
||||||
SPECS[spec].colours.map((c, i) => (
|
SPEC_CONSTANT[spec].colours.map((c, i) => (
|
||||||
<figure key={i} alt={c.colour}>
|
<figure key={i} alt={c.colour}>
|
||||||
{COLOUR_ICONS[c].svg(`stat-icon ${COLOUR_ICONS[c].colour}`)}
|
{COLOUR_ICONS[c].svg(`stat-icon ${COLOUR_ICONS[c].colour}`)}
|
||||||
<figcaption>{Math.min(teamColours[c], t)} / {t}</figcaption>
|
<figcaption>{Math.min(teamColours[c], t)} / {t}</figcaption>
|
||||||
@ -60,9 +61,8 @@ function Info(args) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (type === 'spec') {
|
if (type === 'spec') {
|
||||||
const breaks = SPECS[value.spec].thresholds ? SPECS[value.spec].thresholds.map((t, i) => {
|
const breaks = SPEC_CONSTANT[value.spec].thresholds ? SPEC_CONSTANT[value.spec].thresholds.map((t, i) => {
|
||||||
const threshold = thresholds(t, value.spec);
|
const threshold = thresholds(t, value.spec);
|
||||||
return (
|
return (
|
||||||
<div className="thresholds" key={i} alt={t}>
|
<div className="thresholds" key={i} alt={t}>
|
||||||
@ -74,7 +74,7 @@ function Info(args) {
|
|||||||
<div className="info-spec">
|
<div className="info-spec">
|
||||||
<div>
|
<div>
|
||||||
<div> {value.spec} </div>
|
<div> {value.spec} </div>
|
||||||
<div> {SPECS[value.spec].description} </div>
|
<div> {SPEC_CONSTANT[value.spec].description} </div>
|
||||||
{breaks}
|
{breaks}
|
||||||
</div>
|
</div>
|
||||||
<button onClick={() => sendUnequip(value.cryp.id, value.spec)}>
|
<button onClick={() => sendUnequip(value.cryp.id, value.spec)}>
|
||||||
|
|||||||
@ -18,12 +18,14 @@ function Cryp(props) {
|
|||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const skills = range(0, 4).map(i => {
|
const skills = range(0, 4).map(i => {
|
||||||
const s = cryp.skills[i]
|
const skill = cryp.skills[i];
|
||||||
? cryp.skills[i].skill
|
const s = skill
|
||||||
|
? skill.skill
|
||||||
: (<span> </span>);
|
: (<span> </span>);
|
||||||
|
|
||||||
function skillClick() {
|
function skillClick() {
|
||||||
setInfo('skill', { skill: s, cryp });
|
if (!skill) return false;
|
||||||
|
setInfo('skill', { skill, cryp });
|
||||||
setActiveCryp(cryp);
|
setActiveCryp(cryp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,12 +53,18 @@ function Cryp(props) {
|
|||||||
return setActiveCryp(cryp);
|
return setActiveCryp(cryp);
|
||||||
}
|
}
|
||||||
|
|
||||||
const specs = cryp.specs.map((s, i) => (
|
const specs = cryp.specs.map((s, i) => {
|
||||||
<figure key={i} onClick={() => setInfo('spec', { spec: s, cryp })}>
|
function specClick() {
|
||||||
{SPECS[s].svg(`stat-icon ${SPECS[s].colour}`)}
|
setActiveCryp(cryp);
|
||||||
<figcaption>{SPECS[s].caption}</figcaption>
|
setInfo('spec', { spec: s, cryp });
|
||||||
</figure>
|
}
|
||||||
));
|
return (
|
||||||
|
<figure key={i} onClick={specClick}>
|
||||||
|
{SPECS[s].svg(`stat-icon ${SPECS[s].colour}`)}
|
||||||
|
<figcaption>{SPECS[s].caption}</figcaption>
|
||||||
|
</figure>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user