change names

This commit is contained in:
ntr
2019-11-28 16:01:44 +10:00
parent 24951c1442
commit 18126c1b0c
8 changed files with 46 additions and 51 deletions
@@ -24,8 +24,8 @@ const addState = connect(
tutorial,
} = state;
function sendVboxAcceptEquip(constructId) {
return ws.sendVboxAcceptEquip(instance.id, vboxSelected.storeSelect[0][0], vboxSelected.storeSelect[0][1], constructId);
function sendVboxBuyEquip(constructId) {
return ws.sendVboxBuyEquip(instance.id, vboxSelected.storeSelect[0][0], vboxSelected.storeSelect[0][1], constructId);
}
function sendVboxApply(constructId, i) {
@@ -40,7 +40,7 @@ const addState = connect(
instance,
player,
account,
sendVboxAcceptEquip,
sendVboxBuyEquip,
sendVboxUnequipApply,
sendVboxApply,
itemInfo,
@@ -83,7 +83,7 @@ function Construct(props) {
itemInfo,
// Function Calls
sendVboxApply,
sendVboxAcceptEquip,
sendVboxBuyEquip,
sendVboxUnequipApply,
setItemUnequip,
setInfo,
@@ -106,7 +106,7 @@ function Construct(props) {
e.preventDefault();
if (duplicateSkill || tutorialDisableEquip) return true;
if (itemEquip !== -1) return sendVboxApply(construct.id, itemEquip);
if (vboxSelected.storeSelect.length === 1) return sendVboxAcceptEquip(construct.id);
if (vboxSelected.storeSelect.length === 1) return sendVboxBuyEquip(construct.id);
if (itemUnequip.length && itemUnequip[0] !== construct.id) return sendVboxUnequipApply(construct.id);
setItemUnequip([]);
return true;
@@ -261,7 +261,7 @@ class InstanceConstructs extends preact.Component {
// Function calls
setInfo,
sendVboxApply,
sendVboxAcceptEquip,
sendVboxBuyEquip,
sendVboxUnequipApply,
setItemUnequip,
} = props;
@@ -281,7 +281,7 @@ class InstanceConstructs extends preact.Component {
setItemUnequip,
player,
sendVboxApply,
sendVboxAcceptEquip,
sendVboxBuyEquip,
sendVboxUnequipApply,
setInfo,
itemInfo,
+15 -15
View File
@@ -27,22 +27,22 @@ const addState = connect(
return ws.clearTutorial(instance.id);
}
function sendVboxDiscard() {
return ws.sendVboxDiscard(instance.id);
function sendVboxRefill() {
return ws.sendVboxRefill(instance.id);
}
function sendVboxAccept(group, index) {
function sendVboxBuy(group, index) {
if (!(vboxSelected.storeSelect.length === 1 && vboxSelected.stashSelect.length === 0)) return false;
document.activeElement.blur();
return ws.sendVboxAccept(instance.id, group, index);
return ws.sendVboxBuy(instance.id, group, index);
}
function sendVboxCombine() {
return ws.sendVboxCombine(instance.id, vboxSelected.stashSelect, vboxSelected.storeSelect);
}
function sendVboxReclaim(i) {
return ws.sendVboxReclaim(instance.id, i);
function sendVboxRefund(i) {
return ws.sendVboxRefund(instance.id, i);
}
function sendItemUnequip([constructId, item]) {
@@ -60,10 +60,10 @@ const addState = connect(
clearTutorial,
sendItemUnequip,
sendVboxAccept,
sendVboxBuy,
sendVboxCombine,
sendVboxDiscard,
sendVboxReclaim,
sendVboxRefill,
sendVboxRefund,
};
},
@@ -109,10 +109,10 @@ class Vbox extends preact.Component {
clearTutorial,
dispatchVboxSelect,
sendItemUnequip,
sendVboxAccept,
sendVboxBuy,
sendVboxCombine,
sendVboxDiscard,
sendVboxReclaim,
sendVboxRefill,
sendVboxRefund,
setInfo,
} = args;
@@ -122,7 +122,7 @@ class Vbox extends preact.Component {
const setVboxSelected = v => dispatchVboxSelect(v, { itemInfo, itemUnequip, vbox });
const clearVboxSelected = () => setVboxSelected({ storeSelect: [], stashSelect: [] });
const vboxBuySelected = () => sendVboxAccept(storeSelect[0][0], storeSelect[0][1]);
const vboxBuySelected = () => sendVboxBuy(storeSelect[0][0], storeSelect[0][1]);
function vboxHover(e, v) {
if (v) {
@@ -151,7 +151,7 @@ class Vbox extends preact.Component {
&& instance.time_control === 'Practice' && instance.rounds.length === 1)
}
onClick={e => e.stopPropagation()}
onMouseDown={() => sendVboxDiscard()}>
onMouseDown={() => sendVboxRefill()}>
refill <br />
2b
</button>
@@ -172,7 +172,7 @@ class Vbox extends preact.Component {
onClick={e => e.stopPropagation()}
onMouseDown={e => {
e.stopPropagation();
sendVboxReclaim(vboxSelected.stashSelect[0]);
sendVboxRefund(vboxSelected.stashSelect[0]);
}}>
refund <br />
{refund}b