add clear instance back

This commit is contained in:
Mashy 2019-11-05 11:01:52 +10:00
parent 165c0b82a3
commit 6809e2016b
3 changed files with 12 additions and 3 deletions

View File

@ -120,9 +120,9 @@ function Construct(props) {
e.stopPropagation();
e.preventDefault();
if (duplicateSkill || tutorialDisableEquip) return true;
if (itemEquip !== null) sendVboxApply(construct.id, itemEquip);
if (vboxSelected[0]) sendVboxAcceptEquip(construct.id);
if (itemUnequip.length && itemUnequip[0] !== construct.id) sendVboxUnequipApply(construct.id);
if (itemEquip !== null) return sendVboxApply(construct.id, itemEquip);
if (vboxSelected[0]) return sendVboxAcceptEquip(construct.id);
if (itemUnequip.length && itemUnequip[0] !== construct.id) return sendVboxUnequipApply(construct.id);
setItemEquip(null);
setItemUnequip([]);
return true;

View File

@ -190,6 +190,7 @@ function registerEvents(store) {
store.dispatch(actions.setItemEquip(null));
store.dispatch(actions.setItemUnequip([]));
store.dispatch(actions.setVboxHighlight([]));
store.dispatch(actions.setVboxSelected([]));
}
function setAccountInstances(v) {

View File

@ -79,34 +79,42 @@ function createSocket(events) {
function sendVboxAccept(instanceId, group, index) {
send(['VboxAccept', { instance_id: instanceId, group, index }]);
events.clearInstance();
}
function sendVboxAcceptEquip(instanceId, group, index, constructId) {
send(['VboxAcceptEquip', { instance_id: instanceId, group, index, construct_id: constructId }]);
events.clearInstance();
}
function sendVboxApply(instanceId, constructId, index) {
send(['VboxApply', { instance_id: instanceId, construct_id: constructId, index }]);
events.clearInstance();
}
function sendVboxUnequip(instanceId, constructId, target) {
send(['VboxUnequip', { instance_id: instanceId, construct_id: constructId, target }]);
events.clearInstance();
}
function sendVboxUnequipApply(instanceId, constructId, target, targetConstructId) {
send(['VboxUnequipApply', { instance_id: instanceId, construct_id: constructId, target, target_construct_id: targetConstructId }]);
events.clearInstance();
}
function sendVboxDiscard(instanceId) {
send(['VboxDiscard', { instance_id: instanceId }]);
events.clearInstance();
}
function sendVboxCombine(instanceId, indices) {
send(['VboxCombine', { instance_id: instanceId, indices }]);
events.clearInstance();
}
function sendVboxReclaim(instanceId, index) {
send(['VboxReclaim', { instance_id: instanceId, index }]);
events.clearInstance();
}
function sendItemInfo() {