From a8af508dbfd65b7a8356fa26364fb4e4ee6ba4f3 Mon Sep 17 00:00:00 2001 From: Razzmatazz Date: Wed, 28 Feb 2024 15:16:52 -0600 Subject: [PATCH 1/2] add grids for new backpacks --- src/data/item-grids.json | 78 +++++++++++++++++++++++++++ src/features/items/do-fetch-items.mjs | 16 ++++-- 2 files changed, 90 insertions(+), 4 deletions(-) diff --git a/src/data/item-grids.json b/src/data/item-grids.json index 42f8909df..caa3f47e8 100644 --- a/src/data/item-grids.json +++ b/src/data/item-grids.json @@ -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 + } ] } diff --git a/src/features/items/do-fetch-items.mjs b/src/features/items/do-fetch-items.mjs index 8c994b23a..cc4211919 100644 --- a/src/features/items/do-fetch-items.mjs +++ b/src/features/items/do-fetch-items.mjs @@ -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, @@ -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; From ff7fd2b0595fcfc534367ea265ceed6774bd9fcb Mon Sep 17 00:00:00 2001 From: Razzmatazz Date: Wed, 28 Feb 2024 15:24:35 -0600 Subject: [PATCH 2/2] enable searching by item/task id --- src/components/item-search/index.js | 2 +- src/modules/item-search.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/item-search/index.js b/src/components/item-search/index.js index 8d32bf61c..380586d3e 100644 --- a/src/components/item-search/index.js +++ b/src/components/item-search/index.js @@ -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, diff --git a/src/modules/item-search.js b/src/modules/item-search.js index bee445d31..56b577861 100644 --- a/src/modules/item-search.js +++ b/src/modules/item-search.js @@ -30,6 +30,10 @@ const itemSearch = (items, searchString) => { { name: 'normalizedName', weight: 0.9 + }, + { + name: 'id', + weight: 1 } ], threshold: 0.3,