change names
This commit is contained in:
parent
24951c1442
commit
18126c1b0c
@ -116,7 +116,7 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
.reclaiming {
|
.Refunding {
|
||||||
button:not([disabled]) {
|
button:not([disabled]) {
|
||||||
&, &:hover, &:active {
|
&, &:hover, &:active {
|
||||||
background: @red;
|
background: @red;
|
||||||
|
|||||||
@ -24,8 +24,8 @@ const addState = connect(
|
|||||||
tutorial,
|
tutorial,
|
||||||
} = state;
|
} = state;
|
||||||
|
|
||||||
function sendVboxAcceptEquip(constructId) {
|
function sendVboxBuyEquip(constructId) {
|
||||||
return ws.sendVboxAcceptEquip(instance.id, vboxSelected.storeSelect[0][0], vboxSelected.storeSelect[0][1], constructId);
|
return ws.sendVboxBuyEquip(instance.id, vboxSelected.storeSelect[0][0], vboxSelected.storeSelect[0][1], constructId);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendVboxApply(constructId, i) {
|
function sendVboxApply(constructId, i) {
|
||||||
@ -40,7 +40,7 @@ const addState = connect(
|
|||||||
instance,
|
instance,
|
||||||
player,
|
player,
|
||||||
account,
|
account,
|
||||||
sendVboxAcceptEquip,
|
sendVboxBuyEquip,
|
||||||
sendVboxUnequipApply,
|
sendVboxUnequipApply,
|
||||||
sendVboxApply,
|
sendVboxApply,
|
||||||
itemInfo,
|
itemInfo,
|
||||||
@ -83,7 +83,7 @@ function Construct(props) {
|
|||||||
itemInfo,
|
itemInfo,
|
||||||
// Function Calls
|
// Function Calls
|
||||||
sendVboxApply,
|
sendVboxApply,
|
||||||
sendVboxAcceptEquip,
|
sendVboxBuyEquip,
|
||||||
sendVboxUnequipApply,
|
sendVboxUnequipApply,
|
||||||
setItemUnequip,
|
setItemUnequip,
|
||||||
setInfo,
|
setInfo,
|
||||||
@ -106,7 +106,7 @@ function Construct(props) {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (duplicateSkill || tutorialDisableEquip) return true;
|
if (duplicateSkill || tutorialDisableEquip) return true;
|
||||||
if (itemEquip !== -1) return sendVboxApply(construct.id, itemEquip);
|
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);
|
if (itemUnequip.length && itemUnequip[0] !== construct.id) return sendVboxUnequipApply(construct.id);
|
||||||
setItemUnequip([]);
|
setItemUnequip([]);
|
||||||
return true;
|
return true;
|
||||||
@ -261,7 +261,7 @@ class InstanceConstructs extends preact.Component {
|
|||||||
// Function calls
|
// Function calls
|
||||||
setInfo,
|
setInfo,
|
||||||
sendVboxApply,
|
sendVboxApply,
|
||||||
sendVboxAcceptEquip,
|
sendVboxBuyEquip,
|
||||||
sendVboxUnequipApply,
|
sendVboxUnequipApply,
|
||||||
setItemUnequip,
|
setItemUnequip,
|
||||||
} = props;
|
} = props;
|
||||||
@ -281,7 +281,7 @@ class InstanceConstructs extends preact.Component {
|
|||||||
setItemUnequip,
|
setItemUnequip,
|
||||||
player,
|
player,
|
||||||
sendVboxApply,
|
sendVboxApply,
|
||||||
sendVboxAcceptEquip,
|
sendVboxBuyEquip,
|
||||||
sendVboxUnequipApply,
|
sendVboxUnequipApply,
|
||||||
setInfo,
|
setInfo,
|
||||||
itemInfo,
|
itemInfo,
|
||||||
|
|||||||
@ -27,22 +27,22 @@ const addState = connect(
|
|||||||
return ws.clearTutorial(instance.id);
|
return ws.clearTutorial(instance.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendVboxDiscard() {
|
function sendVboxRefill() {
|
||||||
return ws.sendVboxDiscard(instance.id);
|
return ws.sendVboxRefill(instance.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendVboxAccept(group, index) {
|
function sendVboxBuy(group, index) {
|
||||||
if (!(vboxSelected.storeSelect.length === 1 && vboxSelected.stashSelect.length === 0)) return false;
|
if (!(vboxSelected.storeSelect.length === 1 && vboxSelected.stashSelect.length === 0)) return false;
|
||||||
document.activeElement.blur();
|
document.activeElement.blur();
|
||||||
return ws.sendVboxAccept(instance.id, group, index);
|
return ws.sendVboxBuy(instance.id, group, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendVboxCombine() {
|
function sendVboxCombine() {
|
||||||
return ws.sendVboxCombine(instance.id, vboxSelected.stashSelect, vboxSelected.storeSelect);
|
return ws.sendVboxCombine(instance.id, vboxSelected.stashSelect, vboxSelected.storeSelect);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendVboxReclaim(i) {
|
function sendVboxRefund(i) {
|
||||||
return ws.sendVboxReclaim(instance.id, i);
|
return ws.sendVboxRefund(instance.id, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendItemUnequip([constructId, item]) {
|
function sendItemUnequip([constructId, item]) {
|
||||||
@ -60,10 +60,10 @@ const addState = connect(
|
|||||||
|
|
||||||
clearTutorial,
|
clearTutorial,
|
||||||
sendItemUnequip,
|
sendItemUnequip,
|
||||||
sendVboxAccept,
|
sendVboxBuy,
|
||||||
sendVboxCombine,
|
sendVboxCombine,
|
||||||
sendVboxDiscard,
|
sendVboxRefill,
|
||||||
sendVboxReclaim,
|
sendVboxRefund,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -109,10 +109,10 @@ class Vbox extends preact.Component {
|
|||||||
clearTutorial,
|
clearTutorial,
|
||||||
dispatchVboxSelect,
|
dispatchVboxSelect,
|
||||||
sendItemUnequip,
|
sendItemUnequip,
|
||||||
sendVboxAccept,
|
sendVboxBuy,
|
||||||
sendVboxCombine,
|
sendVboxCombine,
|
||||||
sendVboxDiscard,
|
sendVboxRefill,
|
||||||
sendVboxReclaim,
|
sendVboxRefund,
|
||||||
setInfo,
|
setInfo,
|
||||||
} = args;
|
} = args;
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ class Vbox extends preact.Component {
|
|||||||
|
|
||||||
const setVboxSelected = v => dispatchVboxSelect(v, { itemInfo, itemUnequip, vbox });
|
const setVboxSelected = v => dispatchVboxSelect(v, { itemInfo, itemUnequip, vbox });
|
||||||
const clearVboxSelected = () => setVboxSelected({ storeSelect: [], stashSelect: [] });
|
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) {
|
function vboxHover(e, v) {
|
||||||
if (v) {
|
if (v) {
|
||||||
@ -151,7 +151,7 @@ class Vbox extends preact.Component {
|
|||||||
&& instance.time_control === 'Practice' && instance.rounds.length === 1)
|
&& instance.time_control === 'Practice' && instance.rounds.length === 1)
|
||||||
}
|
}
|
||||||
onClick={e => e.stopPropagation()}
|
onClick={e => e.stopPropagation()}
|
||||||
onMouseDown={() => sendVboxDiscard()}>
|
onMouseDown={() => sendVboxRefill()}>
|
||||||
refill <br />
|
refill <br />
|
||||||
2b
|
2b
|
||||||
</button>
|
</button>
|
||||||
@ -172,7 +172,7 @@ class Vbox extends preact.Component {
|
|||||||
onClick={e => e.stopPropagation()}
|
onClick={e => e.stopPropagation()}
|
||||||
onMouseDown={e => {
|
onMouseDown={e => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
sendVboxReclaim(vboxSelected.stashSelect[0]);
|
sendVboxRefund(vboxSelected.stashSelect[0]);
|
||||||
}}>
|
}}>
|
||||||
refund <br />
|
refund <br />
|
||||||
{refund}b
|
{refund}b
|
||||||
|
|||||||
@ -45,10 +45,10 @@ module.exports = {
|
|||||||
item: 'READY',
|
item: 'READY',
|
||||||
description: 'Ready for the game to begin. When all players are ready the first VBOX PHASE begins.',
|
description: 'Ready for the game to begin. When all players are ready the first VBOX PHASE begins.',
|
||||||
},
|
},
|
||||||
reclaim: {
|
Refund: {
|
||||||
item: 'RECLAIM',
|
item: 'Refund',
|
||||||
description: <p>Reclaim items refunding the listed cost of the item.<br />
|
description: <p>Refund items refunding the listed cost of the item.<br />
|
||||||
Click to enable and then click the item to reclaim.</p>,
|
Click to enable and then click the item to Refund.</p>,
|
||||||
},
|
},
|
||||||
refill: {
|
refill: {
|
||||||
item: 'REFILL',
|
item: 'REFILL',
|
||||||
|
|||||||
@ -2,6 +2,7 @@ const toast = require('izitoast');
|
|||||||
const cbor = require('borc');
|
const cbor = require('borc');
|
||||||
|
|
||||||
const throttle = require('lodash/throttle');
|
const throttle = require('lodash/throttle');
|
||||||
|
const groupBy = require('lodash/groupBy');
|
||||||
|
|
||||||
const SOCKET_URL =
|
const SOCKET_URL =
|
||||||
`${window.location.protocol === 'https:' ? 'wss://' : 'ws://'}${window.location.host}/api/ws`;
|
`${window.location.protocol === 'https:' ? 'wss://' : 'ws://'}${window.location.host}/api/ws`;
|
||||||
@ -77,13 +78,13 @@ function createSocket(events) {
|
|||||||
send(['InstanceChat', { instance_id: instanceId, index }]);
|
send(['InstanceChat', { instance_id: instanceId, index }]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendVboxAccept(instanceId, group, index) {
|
function sendVboxBuy(instanceId, group, index) {
|
||||||
send(['VboxAccept', { instance_id: instanceId, group, index }]);
|
send(['VboxBuy', { instance_id: instanceId, group, index }]);
|
||||||
events.clearInstance();
|
events.clearInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendVboxAcceptEquip(instanceId, group, index, constructId) {
|
function sendVboxBuyEquip(instanceId, group, index, constructId) {
|
||||||
send(['VboxAcceptEquip', { instance_id: instanceId, group, index, construct_id: constructId }]);
|
send(['VboxBuyEquip', { instance_id: instanceId, group, index, construct_id: constructId }]);
|
||||||
events.clearInstance();
|
events.clearInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,18 +103,20 @@ function createSocket(events) {
|
|||||||
events.clearInstance();
|
events.clearInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendVboxDiscard(instanceId) {
|
function sendVboxRefill(instanceId) {
|
||||||
send(['VboxDiscard', { instance_id: instanceId }]);
|
send(['VboxRefill', { instance_id: instanceId }]);
|
||||||
events.clearInstance();
|
events.clearInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendVboxCombine(instanceId, invIndicies, vboxIndicies) {
|
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();
|
events.clearInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendVboxReclaim(instanceId, index) {
|
function sendVboxRefund(instanceId, index) {
|
||||||
send(['VboxReclaim', { instance_id: instanceId, index }]);
|
send(['VboxRefund', { instance_id: instanceId, index }]);
|
||||||
events.clearInstance();
|
events.clearInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,12 +207,6 @@ function createSocket(events) {
|
|||||||
send(['SubscriptionState', {}]);
|
send(['SubscriptionState', {}]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearTutorial(instanceId) {
|
|
||||||
events.clearTutorial();
|
|
||||||
events.clearInstance();
|
|
||||||
sendInstanceState(instanceId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------
|
// -------------
|
||||||
// Incoming
|
// Incoming
|
||||||
// -------------
|
// -------------
|
||||||
@ -416,12 +413,12 @@ function createSocket(events) {
|
|||||||
sendInstanceChat,
|
sendInstanceChat,
|
||||||
sendInstanceLeave,
|
sendInstanceLeave,
|
||||||
|
|
||||||
sendVboxAccept,
|
sendVboxBuy,
|
||||||
sendVboxAcceptEquip,
|
sendVboxBuyEquip,
|
||||||
sendVboxApply,
|
sendVboxApply,
|
||||||
sendVboxReclaim,
|
sendVboxRefund,
|
||||||
sendVboxCombine,
|
sendVboxCombine,
|
||||||
sendVboxDiscard,
|
sendVboxRefill,
|
||||||
sendVboxUnequip,
|
sendVboxUnequip,
|
||||||
sendVboxUnequipApply,
|
sendVboxUnequipApply,
|
||||||
|
|
||||||
@ -436,8 +433,6 @@ function createSocket(events) {
|
|||||||
sendMtxBuy,
|
sendMtxBuy,
|
||||||
sendMtxConstructSpawn,
|
sendMtxConstructSpawn,
|
||||||
|
|
||||||
clearTutorial,
|
|
||||||
|
|
||||||
connect,
|
connect,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -204,7 +204,7 @@ function tutorialStage(tutorial, clearTutorial, instance) {
|
|||||||
<p>Press <b>READY</b> to progress to the <b>GAME PHASE</b> <br />
|
<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>
|
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 />
|
<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>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -197,7 +197,7 @@ function postData(url = '/', data = {}) {
|
|||||||
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
|
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
|
||||||
credentials: 'include', // include, same-origin, *omit
|
credentials: 'include', // include, same-origin, *omit
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Buy: 'application/json',
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
},
|
},
|
||||||
redirect: 'error', // manual, *follow, error
|
redirect: 'error', // manual, *follow, error
|
||||||
|
|||||||
@ -130,7 +130,7 @@ impl Vbox {
|
|||||||
// check item exists
|
// check item exists
|
||||||
let selection = self.store
|
let selection = self.store
|
||||||
.get_mut(&item).ok_or(format_err!("no item group {:?}", item))?
|
.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())?;
|
self.balance_sub(selection.cost())?;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user