inv deallocate on click
This commit is contained in:
parent
a455b2b1f3
commit
b022845ff7
@ -269,11 +269,13 @@ class ItemList extends Phaser.Scene {
|
||||
// hitbox can only be the combinerhitbox, deletehitbox or cryp avatar
|
||||
hitBox.itemDeselect();
|
||||
if (hitBox instanceof CombinerHitBox) {
|
||||
allocate(item, hitBox);
|
||||
if (hitBox.item === item) deallocate(item);
|
||||
else allocate(item, hitBox);
|
||||
} else if (hitBox instanceof DeleteHitBox) {
|
||||
ws.sendVboxDrop(vbox.instance, item.index);
|
||||
} else {
|
||||
ws.sendVboxApply(vbox.instance, hitBox.cryp.id, item.index);
|
||||
deallocate(item);
|
||||
} return true;
|
||||
}
|
||||
// If not interacting with hitbox and didn't move much try to allocate the item
|
||||
|
||||
@ -36,12 +36,15 @@ class Menu extends Phaser.Scene {
|
||||
|
||||
// When we load the menu request the latest items
|
||||
// Item list will restart when the data comes in
|
||||
|
||||
this.scene.manager.add('MenuCrypList', MenuCrypList, true);
|
||||
this.scene.manager.add('MenuNavigation', MenuNavigation, true);
|
||||
this.scene.manager.add('MenuScore', MenuScore, true);
|
||||
this.scene.manager.add('ItemList', ItemList, true);
|
||||
this.registry.set('inMenu', true);
|
||||
|
||||
// Request the latest player state when we load the scene
|
||||
const { instance } = this.registry.get('player');
|
||||
this.registry.get('ws').sendPlayerState(instance);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user