change names
This commit is contained in:
parent
24951c1442
commit
18126c1b0c
@ -116,7 +116,7 @@
|
||||
};
|
||||
}
|
||||
|
||||
.reclaiming {
|
||||
.Refunding {
|
||||
button:not([disabled]) {
|
||||
&, &:hover, &:active {
|
||||
background: @red;
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -45,10 +45,10 @@ module.exports = {
|
||||
item: 'READY',
|
||||
description: 'Ready for the game to begin. When all players are ready the first VBOX PHASE begins.',
|
||||
},
|
||||
reclaim: {
|
||||
item: 'RECLAIM',
|
||||
description: <p>Reclaim items refunding the listed cost of the item.<br />
|
||||
Click to enable and then click the item to reclaim.</p>,
|
||||
Refund: {
|
||||
item: 'Refund',
|
||||
description: <p>Refund items refunding the listed cost of the item.<br />
|
||||
Click to enable and then click the item to Refund.</p>,
|
||||
},
|
||||
refill: {
|
||||
item: 'REFILL',
|
||||
|
||||
@ -2,6 +2,7 @@ const toast = require('izitoast');
|
||||
const cbor = require('borc');
|
||||
|
||||
const throttle = require('lodash/throttle');
|
||||
const groupBy = require('lodash/groupBy');
|
||||
|
||||
const SOCKET_URL =
|
||||
`${window.location.protocol === 'https:' ? 'wss://' : 'ws://'}${window.location.host}/api/ws`;
|
||||
@ -77,13 +78,13 @@ function createSocket(events) {
|
||||
send(['InstanceChat', { instance_id: instanceId, index }]);
|
||||
}
|
||||
|
||||
function sendVboxAccept(instanceId, group, index) {
|
||||
send(['VboxAccept', { instance_id: instanceId, group, index }]);
|
||||
function sendVboxBuy(instanceId, group, index) {
|
||||
send(['VboxBuy', { instance_id: instanceId, group, index }]);
|
||||
events.clearInstance();
|
||||
}
|
||||
|
||||
function sendVboxAcceptEquip(instanceId, group, index, constructId) {
|
||||
send(['VboxAcceptEquip', { instance_id: instanceId, group, index, construct_id: constructId }]);
|
||||
function sendVboxBuyEquip(instanceId, group, index, constructId) {
|
||||
send(['VboxBuyEquip', { instance_id: instanceId, group, index, construct_id: constructId }]);
|
||||
events.clearInstance();
|
||||
}
|
||||
|
||||
@ -102,18 +103,20 @@ function createSocket(events) {
|
||||
events.clearInstance();
|
||||
}
|
||||
|
||||
function sendVboxDiscard(instanceId) {
|
||||
send(['VboxDiscard', { instance_id: instanceId }]);
|
||||
function sendVboxRefill(instanceId) {
|
||||
send(['VboxRefill', { instance_id: instanceId }]);
|
||||
events.clearInstance();
|
||||
}
|
||||
|
||||
function sendVboxCombine(instanceId, invIndicies, vboxIndicies) {
|
||||
send(['VboxCombine', { instance_id: instanceId, inv_indices: invIndicies, vbox_indices: vboxIndicies }]);
|
||||
const formatted = {};
|
||||
vboxIndicies.forEach(p => formatted[p[0]] ? formatted[p[0]].push(p[1]) : formatted[p[0]] = [p[1]]);
|
||||
send(['VboxCombine', { instance_id: instanceId, inv_indices: invIndicies, vbox_indices: formatted }]);
|
||||
events.clearInstance();
|
||||
}
|
||||
|
||||
function sendVboxReclaim(instanceId, index) {
|
||||
send(['VboxReclaim', { instance_id: instanceId, index }]);
|
||||
function sendVboxRefund(instanceId, index) {
|
||||
send(['VboxRefund', { instance_id: instanceId, index }]);
|
||||
events.clearInstance();
|
||||
}
|
||||
|
||||
@ -204,12 +207,6 @@ function createSocket(events) {
|
||||
send(['SubscriptionState', {}]);
|
||||
}
|
||||
|
||||
function clearTutorial(instanceId) {
|
||||
events.clearTutorial();
|
||||
events.clearInstance();
|
||||
sendInstanceState(instanceId);
|
||||
}
|
||||
|
||||
// -------------
|
||||
// Incoming
|
||||
// -------------
|
||||
@ -416,12 +413,12 @@ function createSocket(events) {
|
||||
sendInstanceChat,
|
||||
sendInstanceLeave,
|
||||
|
||||
sendVboxAccept,
|
||||
sendVboxAcceptEquip,
|
||||
sendVboxBuy,
|
||||
sendVboxBuyEquip,
|
||||
sendVboxApply,
|
||||
sendVboxReclaim,
|
||||
sendVboxRefund,
|
||||
sendVboxCombine,
|
||||
sendVboxDiscard,
|
||||
sendVboxRefill,
|
||||
sendVboxUnequip,
|
||||
sendVboxUnequipApply,
|
||||
|
||||
@ -436,8 +433,6 @@ function createSocket(events) {
|
||||
sendMtxBuy,
|
||||
sendMtxConstructSpawn,
|
||||
|
||||
clearTutorial,
|
||||
|
||||
connect,
|
||||
};
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ function tutorialStage(tutorial, clearTutorial, instance) {
|
||||
<p>Press <b>READY</b> to progress to the <b>GAME PHASE</b> <br />
|
||||
or continue creating new items to strengthen your constructs further</p>
|
||||
<p>You can unequip skills and specs back into the inventory by double clicking. <br />
|
||||
Reclaim can be used to refund the cost of items in your inventory. </p>
|
||||
Refund can be used to refund the cost of items in your inventory. </p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -197,7 +197,7 @@ function postData(url = '/', data = {}) {
|
||||
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
|
||||
credentials: 'include', // include, same-origin, *omit
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
Buy: 'application/json',
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
redirect: 'error', // manual, *follow, error
|
||||
|
||||
@ -130,7 +130,7 @@ impl Vbox {
|
||||
// check item exists
|
||||
let selection = self.store
|
||||
.get_mut(&item).ok_or(format_err!("no item group {:?}", item))?
|
||||
.remove(i).ok_or(format_err!("no item at index {:?} {:}", item, i))?;
|
||||
.remove(i).ok_or(format_err!("no item at index {:?} {:}", self, i))?;
|
||||
|
||||
self.balance_sub(selection.cost())?;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user