From e56f17013245aca5deb8de1853ec4551c3e90960 Mon Sep 17 00:00:00 2001 From: Mashy Date: Tue, 14 May 2019 10:58:37 +1000 Subject: [PATCH] highlight empty skill slots, bug fixes --- client/instance.css | 19 ++++++++++++++++- client/src/components/info.component.jsx | 6 ++++-- client/src/components/instance.cryps.jsx | 26 +++++++++++++++--------- server/src/vbox.rs | 3 ++- 4 files changed, 40 insertions(+), 14 deletions(-) diff --git a/client/instance.css b/client/instance.css index b7d4f604..d2064c61 100644 --- a/client/instance.css +++ b/client/instance.css @@ -320,6 +320,7 @@ .instance-equip .items { display: flex; justify-content: center; + flex: 1 1 100%; } .instance-equip .label { @@ -331,7 +332,6 @@ } .instance-equip .skills { display: flex; - min-height: 100px; flex-direction: column; } @@ -349,6 +349,23 @@ } +button.equip { + animation: equip-skill 1s infinite ease-in-out alternate; +} + +@keyframes equip-skill { + 0% { + background-color: black; + box-shadow: inset 0 0 0 0 whitesmoke; + } + + 100% { + background-color: #181818; + box-shadow: inset 0.5em 0 0 0 whitesmoke; + } +} + + .instance-equip .specs { display: flex; padding-left: 50px; diff --git a/client/src/components/info.component.jsx b/client/src/components/info.component.jsx index b8c19918..3b5b07ba 100644 --- a/client/src/components/info.component.jsx +++ b/client/src/components/info.component.jsx @@ -55,10 +55,12 @@ function Info(args) { } if (type === 'skill') { + const skillInfo = SKILLS[value.skill]; + const description = skillInfo ? skillInfo.description : '?????'; return (
{value.skill}
-
{SKILLS[value.skill].description}
+
{description}
@@ -165,7 +167,7 @@ function Info(args) { if (activeCryp) return false; if (!player) return false; - if (combiner[0] !== null) { + if (!(combiner.every(u => u === null))) { const filteredCombos = vboxInfo.combos .filter(combo => combiner.every(u => u === null || combo.units.includes(player.vbox.bound[u]))); diff --git a/client/src/components/instance.cryps.jsx b/client/src/components/instance.cryps.jsx index 94307376..c2c18ae3 100644 --- a/client/src/components/instance.cryps.jsx +++ b/client/src/components/instance.cryps.jsx @@ -51,6 +51,7 @@ function Cryp(props) { const { activeVar, cryp, + player, sendVboxApply, setInfo, setActiveCryp, @@ -64,12 +65,22 @@ function Cryp(props) { return false; } + function onClick(e) { + e.stopPropagation(); + e.preventDefault(); + if (activeVar !== null) return sendVboxApply(cryp.id, activeVar); + return setActiveCryp(cryp); + } + + const { vbox } = player; + const skillList = vboxInfo.vars.filter(v => v.skill).map(v => v.v); + const specList = vboxInfo.vars.filter(v => v.spec).map(v => v.v); + const skills = range(0, 3).map(i => { const skill = cryp.skills[i]; const s = skill ? skill.skill : ( ); - function skillClick(e) { if (!skill && activeVar !== null) return sendVboxApply(cryp.id, activeVar); if (!skill) setHighlight('skill'); @@ -78,19 +89,14 @@ function Cryp(props) { return setActiveCryp(cryp); } - const classes = `right ${skill ? '' : 'action'}`; + const action = skill ? '' : 'action'; + const equip = skillList.includes(vbox.bound[activeVar]) && !skill ? 'equip' : ''; + const classes = `right ${action} ${equip}`; return ( ); }); - function onClick(e) { - e.stopPropagation(); - e.preventDefault(); - if (activeVar !== null) return sendVboxApply(cryp.id, activeVar); - return setActiveCryp(cryp); - } - const specs = range(0, 6).map(i => { const s = cryp.specs[i]; @@ -215,7 +221,7 @@ function InstanceCryps(props) { if (instance.phase === 'Lobby') return false; const cryps = player.cryps.map((c, i) => Cryp({ - activeVar, cryp: c, sendVboxApply, setInfo, setActiveCryp, vboxInfo, setVboxHighlight, + activeVar, cryp: c, player, sendVboxApply, setInfo, setActiveCryp, vboxInfo, setVboxHighlight, })); const classes = `instance-cryp-list ${vboxHidden ? '' : 'hidden'}`; diff --git a/server/src/vbox.rs b/server/src/vbox.rs index 9433cc96..609cacc8 100644 --- a/server/src/vbox.rs +++ b/server/src/vbox.rs @@ -272,6 +272,7 @@ impl From for Var { Skill::Curse => Var::Curse, Skill::Clutch => Var::Clutch, Skill::Decay => Var::Decay, + Skill::Debuff => Var::Debuff, Skill::Haste => Var::Haste, Skill::Hostility => Var::Hostility, Skill::Heal => Var::Heal, @@ -551,7 +552,7 @@ impl Vbox { // actually move self.bound.push(self.free[i].remove(j)); - self.bound.sort_unstable(); + // self.bound.sort_unstable(); Ok(self) }