Fixed varibox for new structure
This commit is contained in:
parent
b4cf3f4eb4
commit
c8b19d2875
@ -197,17 +197,18 @@ class ItemList extends Phaser.Scene {
|
||||
this.add.existing(itemBox);
|
||||
});
|
||||
|
||||
vbox.free.forEach((item, i) => {
|
||||
const ITEM_X = ITEM_WIDTH * 1.1 * (i % BOX_COLUMNS) + BOX_X + ITEM_WIDTH * 0.5;
|
||||
const ITEM_Y = ITEM_HEIGHT * 1.1 * Math.floor(i / BOX_COLUMNS) + BOX_Y + ITEM_HEIGHT * 0.5;
|
||||
const clickFn = () => {
|
||||
this.registry.set('itemInfo', item);
|
||||
ws.sendVboxAccept(vbox.instance, i);
|
||||
};
|
||||
const itemBox = new Item(this, item, i, ITEM_X, ITEM_Y, ITEM_WIDTH, ITEM_HEIGHT);
|
||||
itemBox.on('pointerdown', clickFn);
|
||||
|
||||
this.add.existing(itemBox);
|
||||
vbox.free.forEach((type, i) => {
|
||||
type.forEach((item, j) => {
|
||||
const ITEM_X = ITEM_WIDTH * 1.1 * j + BOX_X + ITEM_WIDTH * 0.5;
|
||||
const ITEM_Y = ITEM_HEIGHT * 1.1 * i + BOX_Y + ITEM_HEIGHT * 0.5;
|
||||
const clickFn = () => {
|
||||
this.registry.set('itemInfo', item);
|
||||
ws.sendVboxAccept(vbox.instance, i, j);
|
||||
};
|
||||
const itemBox = new Item(this, item, i, ITEM_X, ITEM_Y, ITEM_WIDTH, ITEM_HEIGHT);
|
||||
itemBox.on('pointerdown', clickFn);
|
||||
this.add.existing(itemBox);
|
||||
});
|
||||
});
|
||||
|
||||
// Restore previous combiner item slots
|
||||
|
||||
@ -93,8 +93,8 @@ function createSocket(events) {
|
||||
send({ method: 'player_state', params: { instance_id: instanceId } });
|
||||
}
|
||||
|
||||
function sendVboxAccept(instanceId, i) {
|
||||
send({ method: 'player_vbox_accept', params: { instance_id: instanceId, index: i } });
|
||||
function sendVboxAccept(instanceId, i, j) {
|
||||
send({ method: 'player_vbox_accept', params: { instance_id: instanceId, group: i, index: j } });
|
||||
}
|
||||
|
||||
function sendVboxApply(instanceId, crypId, index) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user