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