fix auto ready and remove activeConstruct reducer
This commit is contained in:
@@ -36,7 +36,6 @@ const addState = connect(
|
||||
dispatch(actions.setCombiner([]));
|
||||
dispatch(actions.setReclaiming(false));
|
||||
dispatch(actions.setActiveSkill(null));
|
||||
dispatch(actions.setActiveConstruct(null));
|
||||
dispatch(actions.setInfo(null));
|
||||
dispatch(actions.setItemEquip(null));
|
||||
dispatch(actions.setItemUnequip([]));
|
||||
|
||||
@@ -14,7 +14,6 @@ const addState = connect(
|
||||
account,
|
||||
animating,
|
||||
activeSkill,
|
||||
activeConstruct,
|
||||
} = state;
|
||||
|
||||
function selectSkillTarget(targetConstructId) {
|
||||
@@ -34,7 +33,6 @@ const addState = connect(
|
||||
account,
|
||||
animating,
|
||||
activeSkill,
|
||||
activeConstruct,
|
||||
selectSkillTarget,
|
||||
};
|
||||
},
|
||||
@@ -44,11 +42,7 @@ const addState = connect(
|
||||
dispatch(actions.setActiveSkill(constructId, skill));
|
||||
}
|
||||
|
||||
function setActiveConstruct(construct) {
|
||||
dispatch(actions.setActiveConstruct(construct));
|
||||
}
|
||||
|
||||
return { setActiveSkill, setActiveConstruct };
|
||||
return { setActiveSkill };
|
||||
}
|
||||
|
||||
);
|
||||
@@ -59,7 +53,6 @@ function Game(props) {
|
||||
account,
|
||||
animating,
|
||||
setActiveSkill,
|
||||
setActiveConstruct,
|
||||
} = props;
|
||||
|
||||
if (!game) return <div>...</div>;
|
||||
@@ -91,7 +84,6 @@ function Game(props) {
|
||||
|
||||
function gameClick(e) {
|
||||
e.stopPropagation();
|
||||
setActiveConstruct(null);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -35,7 +35,6 @@ const addState = connect(
|
||||
dispatch(actions.setCombiner([]));
|
||||
dispatch(actions.setReclaiming(false));
|
||||
dispatch(actions.setActiveSkill(null));
|
||||
dispatch(actions.setActiveConstruct(null));
|
||||
dispatch(actions.setInfo(null));
|
||||
dispatch(actions.setItemEquip(null));
|
||||
dispatch(actions.setItemUnequip([]));
|
||||
|
||||
@@ -66,10 +66,6 @@ const addState = connect(
|
||||
dispatch(actions.setInfo(item));
|
||||
}
|
||||
|
||||
function setActiveConstruct(value) {
|
||||
dispatch(actions.setActiveConstruct(value));
|
||||
}
|
||||
|
||||
function setItemEquip(v) {
|
||||
return dispatch(actions.setItemEquip(v));
|
||||
}
|
||||
@@ -78,7 +74,7 @@ const addState = connect(
|
||||
return dispatch(actions.setItemUnequip(v));
|
||||
}
|
||||
|
||||
return { quit, setInfo, setActiveConstruct, setItemUnequip, setItemEquip };
|
||||
return { quit, setInfo, setItemUnequip, setItemEquip };
|
||||
}
|
||||
|
||||
);
|
||||
@@ -101,7 +97,6 @@ function Construct(props) {
|
||||
sendVboxAcceptEquip,
|
||||
sendVboxUnequipApply,
|
||||
sendUnequip,
|
||||
setActiveConstruct,
|
||||
setItemUnequip,
|
||||
setItemEquip,
|
||||
setInfo,
|
||||
@@ -144,7 +139,6 @@ function Construct(props) {
|
||||
function skillClick(e) {
|
||||
if (!skill) return false;
|
||||
setItemUnequip([construct.id, skill.skill]);
|
||||
setActiveConstruct(construct);
|
||||
e.stopPropagation();
|
||||
return true;
|
||||
}
|
||||
@@ -152,7 +146,6 @@ function Construct(props) {
|
||||
function skillDblClick(e) {
|
||||
if (!skill) return false;
|
||||
sendUnequip(construct.id, skill.skill);
|
||||
setActiveConstruct(null);
|
||||
setItemUnequip([]);
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
@@ -203,12 +196,10 @@ function Construct(props) {
|
||||
function specClick(e) {
|
||||
e.stopPropagation();
|
||||
setItemUnequip([construct.id, s]);
|
||||
setActiveConstruct(construct);
|
||||
}
|
||||
|
||||
function specDblClick(e) {
|
||||
sendUnequip(construct.id, s);
|
||||
setActiveConstruct(null);
|
||||
setItemUnequip([]);
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
@@ -291,7 +282,6 @@ class InstanceConstructs extends preact.Component {
|
||||
itemInfo,
|
||||
// Function calls
|
||||
setInfo,
|
||||
setActiveConstruct,
|
||||
sendVboxApply,
|
||||
sendVboxAcceptEquip,
|
||||
sendVboxUnequipApply,
|
||||
@@ -321,7 +311,6 @@ class InstanceConstructs extends preact.Component {
|
||||
sendVboxAcceptEquip,
|
||||
sendVboxUnequipApply,
|
||||
setInfo,
|
||||
setActiveConstruct,
|
||||
itemInfo,
|
||||
setVboxHighlight,
|
||||
sendUnequip,
|
||||
@@ -331,7 +320,7 @@ class InstanceConstructs extends preact.Component {
|
||||
});
|
||||
|
||||
return (
|
||||
<div class='construct-list' onClick={() => setActiveConstruct(null)}>
|
||||
<div class='construct-list'>
|
||||
{constructs}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -55,15 +55,6 @@ function InstanceCtrlBtns(args) {
|
||||
|
||||
const finished = instance && instance.phase === 'Finished';
|
||||
|
||||
// cheeky to make sure nubs don't just abandon their first game
|
||||
const beingNub = instance.phase_end
|
||||
&& instance.phase === 'Lobby'
|
||||
&& Date.parse(instance.phase_end) - Date.now() < 2000;
|
||||
|
||||
if (beingNub) {
|
||||
sendReady();
|
||||
}
|
||||
|
||||
return (
|
||||
<div class="instance-ctrl-btns">
|
||||
<button disabled={!account.subscribed} onClick={() => setChatShow(!chatShow)}>Chat</button>
|
||||
|
||||
@@ -36,7 +36,6 @@ const addState = connect(
|
||||
dispatch(actions.setCombiner([]));
|
||||
dispatch(actions.setReclaiming(false));
|
||||
dispatch(actions.setActiveSkill(null));
|
||||
dispatch(actions.setActiveConstruct(null));
|
||||
dispatch(actions.setInfo(null));
|
||||
dispatch(actions.setItemEquip(null));
|
||||
dispatch(actions.setItemUnequip([]));
|
||||
|
||||
Reference in New Issue
Block a user