diff --git a/client/assets/styles/instance.css b/client/assets/styles/instance.css index 51f5889b..5fbf5a80 100644 --- a/client/assets/styles/instance.css +++ b/client/assets/styles/instance.css @@ -41,6 +41,7 @@ display: flex; flex-flow: column; justify-content: center; + white-space: pre-wrap; } .instance .cryps { diff --git a/client/src/components/info.component.jsx b/client/src/components/info.component.jsx index 2fc43b63..b8d55256 100644 --- a/client/src/components/info.component.jsx +++ b/client/src/components/info.component.jsx @@ -1,7 +1,7 @@ const preact = require('preact'); const range = require('lodash/range'); -const { ITEMS: { SPECS: SPEC_CONSTANT } } = require('./../constants'); +const { ITEMS: { SPECS: SPEC_CONSTANT }, INFO } = require('./../constants'); const { COLOUR_ICONS, convertItem } = require('../utils'); function Info(args) { @@ -16,7 +16,8 @@ function Info(args) { function Info() { if (!info) return false; - const fullInfo = itemInfo.items.find(i => i.item === info); + const fullInfo = itemInfo.items.find(i => i.item === info) || INFO[info]; + console.log(INFO); if (!fullInfo) return false; const isSkill = fullInfo.skill; const isSpec = fullInfo.spec; @@ -34,7 +35,7 @@ function Info(args) { if (isSkill) { return (
-
{fullInfo.item}
+

{fullInfo.item}

{fullInfo.description}
); @@ -84,7 +85,8 @@ function Info(args) { return (
- {fullInfo.item} - {fullInfo.description} +

{fullInfo.item}

+
{fullInfo.description}
); } diff --git a/client/src/components/instance.container.jsx b/client/src/components/instance.container.jsx deleted file mode 100644 index 736fe6a5..00000000 --- a/client/src/components/instance.container.jsx +++ /dev/null @@ -1,29 +0,0 @@ -const { connect } = require('preact-redux'); - -const actions = require('../actions'); - -const Instance = require('./instance.component'); - -const addState = connect( - function receiveState(state) { - const { ws, instance, player } = state; - - function sendInstanceReady() { - return ws.sendInstanceReady(instance.id); - } - - return { instance, player, sendInstanceReady }; - }, - - function receiveDispatch(dispatch) { - function setInfo(c) { - return dispatch(actions.setInfo(c)); - } - - return { - setInfo, - }; - } -); - -module.exports = addState(Instance); diff --git a/client/src/components/instance.equip.jsx b/client/src/components/instance.equip.jsx index 78ba675c..04350de0 100644 --- a/client/src/components/instance.equip.jsx +++ b/client/src/components/instance.equip.jsx @@ -49,6 +49,8 @@ function Equipment(props) { itemInfo, sendUnequip, + + setInfo, } = props; const { vbox } = player; @@ -101,15 +103,20 @@ function Equipment(props) { } return false; }); + function hoverInfo(e, info) { + e.stopPropagation(); + return setInfo(info); + } + return (
-
unequipClick(e)}> +
unequipClick(e)} onMouseOver={e => hoverInfo(e, 'equipSkills')} >

Skills

{skills}
-
unequipClick(e)}> +
unequipClick(e)} onMouseOver={e => hoverInfo(e, 'equipSpecs')} >

Specs

{specs} diff --git a/client/src/components/nav.jsx b/client/src/components/nav.jsx index c2f24989..731176da 100644 --- a/client/src/components/nav.jsx +++ b/client/src/components/nav.jsx @@ -63,7 +63,7 @@ function Nav(args) { setTestInstance, } = args; - const joined = instances.map((i, j) => ( + const joined = instances.map(i => ( )); diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index fd2abc58..90410ab6 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -169,7 +169,7 @@ function Vbox(args) { // onClick={freeClick} onDblClick={() => sendVboxAccept(j, i) } - onMouseOver={(e) => vboxHover(e, c)} + onMouseOver={e => vboxHover(e, c)} > {convertItem(c)} ; @@ -273,18 +273,24 @@ function Vbox(args) { return setReclaiming(!reclaiming); } + function hoverInfo(e, info) { + e.stopPropagation(); + return setInfo(info); + } + const classes = `vbox`; const reclaimClass = `instance-btn instance-ui-btn vbox-btn reclaim ${reclaiming ? 'reclaiming' : ''}`; return (
-
setReclaiming(false)} > +
setReclaiming(false)} onMouseOver={e => hoverInfo(e, 'vbox')} >

e.target.scrollIntoView(true)}>VBOX

{vbox.bits}b
@@ -294,10 +300,11 @@ function Vbox(args) {
-
setReclaiming(false)} > +
setReclaiming(false)} onMouseOver={e => hoverInfo(e, 'inventory')} >

e.target.scrollIntoView(true)}>INVENTORY

@@ -307,10 +314,11 @@ function Vbox(args) {
-
+
hoverInfo(e, 'combiner')} >

e.target.scrollIntoView(true)}>I-COMBINATOR

diff --git a/client/src/constants.jsx b/client/src/constants.jsx index 4624cebd..b5066f2f 100644 --- a/client/src/constants.jsx +++ b/client/src/constants.jsx @@ -6,6 +6,41 @@ module.exports = { POST_SKILL: 500, }, + INFO: { + vbox: { + item: 'VBOX', + description: 'Contains items that are available for you to buy.\nDouble-click to purchase.', + }, + inventory: { + item: 'INVENTORY', + description: 'Holds purchased items.', + }, + combiner: { + item: 'I-COMBINATOR', + description: 'Combines purchased items into more powerful variants. Hover over an item to see recipes.', + }, + reclaim: { + item: 'RECLAIM', + description: 'Reclaim items for half the purchase cost of their combined items.\nClick to enable and click item to reclaim.', + }, + refine: { + item: 'REFINE', + description: 'Refine items currently in I-COMBINATOR into more powerful variants', + }, + reroll: { + item: 'REROLL', + description: 'Refill the VBOX with new items.\nCosts 5b.', + }, + equipSkills: { + item: 'QUICK ACCESS - SKILLS', + description: 'Click to select \nClick target Cryp to equip', + }, + equipSpecs: { + item: 'QUICK ACCESS - SPECS', + description: 'Click to select \nClick target Cryp to equip', + }, + }, + ITEMS: { SKILLS: { Amplify: { @@ -21,7 +56,6 @@ module.exports = { Banish: { description: 'target cryp is prevented from casting any skills and taking any damage', colours: '1 Red 1 Green', - }, Blast: {