Skip to content

Commit

Permalink
Merge pull request #863 from the-hideout/new-grids
Browse files Browse the repository at this point in the history
add grids for new backpacks
  • Loading branch information
Razzmatazzz authored Feb 28, 2024
2 parents b2b6d1a + ff7fd2b commit 0d2e5a2
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/item-search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function ItemSearch({
if (nameFilter.length === 0) {
return true;
}
return task.name.toLowerCase().includes(nameFilter.toLowerCase());
return task.name.toLowerCase().includes(nameFilter.toLowerCase()) || task.id === nameFilter;
}).map(task => {
return {
...task,
Expand Down
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
4 changes: 4 additions & 0 deletions src/modules/item-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const itemSearch = (items, searchString) => {
{
name: 'normalizedName',
weight: 0.9
},
{
name: 'id',
weight: 1
}
],
threshold: 0.3,
Expand Down

0 comments on commit 0d2e5a2

Please sign in to comment.