Skip to content

Commit

Permalink
add grids for new backpacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzmatazzz committed Feb 28, 2024
1 parent b2b6d1a commit a8af508
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 4 deletions.
78 changes: 78 additions & 0 deletions src/data/item-grids.json
Original file line number Diff line number Diff line change
Expand Up @@ -2920,5 +2920,83 @@
"width": 1,
"height": 1
}
],
"656ddcf0f02d7bcea90bf395": [
{
"row": 0,
"col": 0,
"width": 1,
"height": 3
},
{
"row": 0,
"col": 1,
"width": 3,
"height": 3
},
{
"row": 0,
"col": 4,
"width": 1,
"height": 3
},
{
"row": 3,
"col": 0,
"width": 1,
"height": 2
},
{
"row": 3,
"col": 1,
"width": 3,
"height": 2
},
{
"row": 3,
"col": 4,
"width": 1,
"height": 2
}
],
"656f198fb27298d6fd005466": [
{
"row": 0,
"col": 0,
"width": 5,
"height": 3
},
{
"row": 3,
"col": 0,
"width": 2,
"height": 2
},
{
"row": 3,
"col": 2,
"width": 3,
"height": 2
}
],
"656e0436d44a1bb4220303a0": [
{
"row": 0,
"col": 0,
"width": 3,
"height": 4
},
{
"row": 0,
"col": 3,
"width": 3,
"height": 4
},
{
"row": 4,
"col": 0,
"width": 6,
"height": 2
}
]
}
16 changes: 12 additions & 4 deletions src/features/items/do-fetch-items.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -484,14 +484,22 @@ class ItemsQuery extends APIQuery {

if (rawItem.properties?.grids) {
let gridPockets = [];
for (const grid of rawItem.properties.grids) {
if (rawItem.properties.grids.length === 1) {
gridPockets.push({
row: 0,
col: 0,
width: rawItem.properties.grids[0].width,
height: rawItem.properties.grids[0].height,
});
}
/*for (const grid of rawItem.properties.grids) {
gridPockets.push({
row: gridPockets.length,
col: 0,
width: grid.width,
height: grid.height,
});
}
}*/
/*let gridPockets = [
{
row: 0,
Expand Down Expand Up @@ -521,9 +529,9 @@ class ItemsQuery extends APIQuery {
}

// Rigs we haven't configured shouldn't break
if (!itemGrids[rawItem.id] && !rawItem.types.includes('backpack')) {
/*if (!itemGrids[rawItem.id] && !rawItem.types.includes('backpack')) {
grid = false;
}
}*/
}

const container = rawItem.properties?.slots || rawItem.properties?.grids;
Expand Down

0 comments on commit a8af508

Please sign in to comment.