unequip specs

This commit is contained in:
ntr
2019-03-15 19:42:38 +11:00
parent 9df24a8f07
commit 0b21a5090d
4 changed files with 19 additions and 6 deletions
+7 -1
View File
@@ -52,6 +52,12 @@ class StatSheet extends Phaser.Scene {
create(cryp) {
this.registry.events.on('changedata', this.updateData, this);
const ws = this.registry.get('ws');
const player = this.registry.get('player');
if (!player) return false;
const { vbox } = player;
this.cryp = cryp;
const del = this.add.existing(new DeleteHitBox(this, X + WIDTH * 0.7, Y + HEIGHT * 0.6));
@@ -116,7 +122,7 @@ class StatSheet extends Phaser.Scene {
if (hitBox) {
hitBox.itemDeselect();
// add socket function for unlearn here
console.log(`delete: ${item.item}`);
ws.sendVboxUnequip(vbox.instance, cryp.id, item.item);
}
return true;
});
+5
View File
@@ -101,6 +101,10 @@ function createSocket(events) {
send({ method: 'player_vbox_apply', params: { instance_id: instanceId, cryp_id: crypId, index } });
}
function sendVboxUnequip(instanceId, crypId, target) {
send({ method: 'player_vbox_unequip', params: { instance_id: instanceId, cryp_id: crypId, target } });
}
function sendVboxDiscard(instanceId) {
send({ method: 'player_vbox_discard', params: { instance_id: instanceId } });
}
@@ -311,6 +315,7 @@ function createSocket(events) {
sendVboxReclaim,
sendVboxCombine,
sendVboxDiscard,
sendVboxUnequip,
connect,
};
}