cleanup old files
This commit is contained in:
parent
84acb58573
commit
cfc1c1ea81
@ -7,7 +7,6 @@ const Hammer = require('hammerjs');
|
||||
const Vbox = require('./vbox.component');
|
||||
const InfoContainer = require('./info.container');
|
||||
const InstanceConstructsContainer = require('./instance.constructs');
|
||||
// const EquipmentContainer = require('./instance.equip');
|
||||
const Faceoff = require('./faceoff');
|
||||
|
||||
const actions = require('../actions');
|
||||
@ -53,6 +52,11 @@ const addState = connect(
|
||||
);
|
||||
|
||||
class Instance extends Component {
|
||||
componentShouldUpdate(newProps) {
|
||||
if (newProps.instance !== this.props.instance) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
render(args) {
|
||||
const {
|
||||
instance,
|
||||
|
||||
@ -1,144 +0,0 @@
|
||||
const { connect } = require('preact-redux');
|
||||
const preact = require('preact');
|
||||
const range = require('lodash/range');
|
||||
|
||||
const actions = require('../actions');
|
||||
const shapes = require('./shapes');
|
||||
const { convertItem } = require('./../utils');
|
||||
|
||||
const addState = connect(
|
||||
function receiveState(state) {
|
||||
const { account, activeConstruct, itemInfo, info, ws, instance, player, itemUnequip } = state;
|
||||
|
||||
function sendUnequip(constructId, item) {
|
||||
return ws.sendVboxUnequip(instance.id, constructId, item);
|
||||
}
|
||||
|
||||
return { player, itemInfo, instance, info, sendUnequip, activeConstruct, itemUnequip };
|
||||
},
|
||||
|
||||
function receiveDispatch(dispatch) {
|
||||
function setInfo(item) {
|
||||
dispatch(actions.setInfo(item));
|
||||
}
|
||||
|
||||
function clearInfo() {
|
||||
return dispatch(actions.setInfo(null));
|
||||
}
|
||||
|
||||
function setItemEquip(v) {
|
||||
return dispatch(actions.setItemEquip(v));
|
||||
}
|
||||
|
||||
function setItemUnequip(v) {
|
||||
return dispatch(actions.setItemUnequip(v));
|
||||
}
|
||||
|
||||
return { setInfo, setItemEquip, setItemUnequip, clearInfo };
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
function Equipment(props) {
|
||||
const {
|
||||
player,
|
||||
instance,
|
||||
|
||||
itemUnequip,
|
||||
setItemEquip,
|
||||
setItemUnequip,
|
||||
activeConstruct,
|
||||
|
||||
itemInfo,
|
||||
sendUnequip,
|
||||
|
||||
setInfo,
|
||||
} = props;
|
||||
|
||||
if (instance.phase === 'Lobby') return false;
|
||||
|
||||
const { vbox } = player;
|
||||
|
||||
const fullInfo = itemInfo.items.find(i => i.item === itemUnequip);
|
||||
const isSkill = fullInfo && fullInfo.skill;
|
||||
const isSpec = fullInfo && fullInfo.spec;
|
||||
|
||||
function skillClick(e, i) {
|
||||
if (itemUnequip && activeConstruct) return false;
|
||||
// const value = vbox.bound[i];
|
||||
setItemEquip(i);
|
||||
return false;
|
||||
}
|
||||
|
||||
function unequipClick(e) {
|
||||
e.stopPropagation();
|
||||
if (!itemUnequip) return false;
|
||||
if (!activeConstruct) return false;
|
||||
setItemUnequip([]);
|
||||
return sendUnequip(activeConstruct.id, itemUnequip);
|
||||
}
|
||||
|
||||
function hoverInfo(e, info) {
|
||||
e.stopPropagation();
|
||||
return setInfo(info);
|
||||
}
|
||||
|
||||
const skillClass = isSkill ? 'skills highlight' : 'skills';
|
||||
const specClass = isSpec ? 'specs highlight' : 'specs';
|
||||
|
||||
const skills = range(0, 9).map(i => {
|
||||
const item = convertItem(vbox.bound[i]);
|
||||
const skillInfo = itemInfo.items.find(i => i.item === item);
|
||||
if (skillInfo && skillInfo.skill) {
|
||||
return (
|
||||
<button key={i} onClick={e => skillClick(e, i)} onMouseOver={e => hoverInfo(e, item)}>
|
||||
{item}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
const specs = range(0, 9).map(i => {
|
||||
const item = convertItem(vbox.bound[i]);
|
||||
const specInfo = itemInfo.items.find(i => i.item === item);
|
||||
if (specInfo && specInfo.spec) {
|
||||
return (
|
||||
<figure key={i} onClick={e => skillClick(e, i)} onMouseOver={e => hoverInfo(e, item)} >
|
||||
{shapes[item]()}
|
||||
<figcaption>{item ? item : '-'}</figcaption>
|
||||
</figure>
|
||||
);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
if (skills.every(s => !s)) skills.push(<button disabled={true}> </button>);
|
||||
if (specs.every(s => !s)) {
|
||||
specs.push(
|
||||
<figure>
|
||||
{shapes.diamond('gray')}
|
||||
<figcaption> </figcaption>
|
||||
</figure>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div class="equip" >
|
||||
<div class={skillClass} onClick={e => unequipClick(e)} onMouseOver={e => hoverInfo(e, 'equipSkills')} >
|
||||
<h3>Skills</h3>
|
||||
<div class ="items">
|
||||
{skills}
|
||||
</div>
|
||||
</div>
|
||||
<div class={specClass} onClick={e => unequipClick(e)} onMouseOver={e => hoverInfo(e, 'equipSpecs')} >
|
||||
<h3>Specs</h3>
|
||||
<div class ="items">
|
||||
{specs}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = addState(Equipment);
|
||||
@ -1,41 +0,0 @@
|
||||
const config = {
|
||||
particles: {
|
||||
number: { value: 300, density: { enable: true, value_area: 800 } },
|
||||
color: { value: '#ffffff' },
|
||||
shape: {
|
||||
type: 'circle',
|
||||
stroke: { width: 0, color: '#000000' },
|
||||
polygon: { nb_sides: 5 },
|
||||
image: { src: 'img/github.svg', width: 100, height: 100 }
|
||||
},
|
||||
opacity: {
|
||||
value: 0.5,
|
||||
random: false,
|
||||
anim: { enable: false, speed: 1, opacity_min: 0.1, sync: false },
|
||||
},
|
||||
size: {
|
||||
value: 3,
|
||||
random: true,
|
||||
anim: { enable: false, speed: 40, size_min: 0.1, sync: false },
|
||||
},
|
||||
line_linked: {
|
||||
enable: true,
|
||||
distance: 150,
|
||||
color: '#ffffff',
|
||||
opacity: 0.4,
|
||||
width: 1,
|
||||
},
|
||||
move: {
|
||||
enable: true,
|
||||
speed: 6,
|
||||
direction: 'none',
|
||||
random: false,
|
||||
straight: false,
|
||||
out_mode: 'out',
|
||||
bounce: false,
|
||||
attract: { enable: false, rotateX: 600, rotateY: 1200 },
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
Loading…
x
Reference in New Issue
Block a user