Limit parsed plugin cell displays to plugins for Skyrim.esm

In-case someone drag and drops a fallout 4 folder onto the page, it should not display any selected cells.
This commit is contained in:
Tyler Hallada 2022-03-19 15:28:10 -04:00
parent 21eaa5cb11
commit 7df5cbb324
3 changed files with 7 additions and 3 deletions

View File

@ -307,6 +307,7 @@ const Map: React.FC = () => {
cell.x !== undefined &&
cell.y !== undefined &&
cell.world_form_id === 60 &&
plugin.parsed.header.masters[0] === "Skyrim.esm" &&
cellSet.has(cell.x + cell.y * 1000) === false
) {
cells.push({ x: cell.x, y: cell.y });
@ -336,7 +337,8 @@ const Map: React.FC = () => {
if (
cell.x !== undefined &&
cell.y !== undefined &&
cell.world_form_id === 60
cell.world_form_id === 60 &&
plugin.parsed.header.masters[0] === "Skyrim.esm"
) {
newCells.push({ x: cell.x, y: cell.y });
}

View File

@ -90,7 +90,8 @@ const PluginDetail: React.FC<Props> = ({ hash, counts }) => {
(cell) =>
cell.x !== undefined &&
cell.y !== undefined &&
cell.world_form_id === 60
cell.world_form_id === 60 &&
plugin.parsed?.header.masters[0] === "Skyrim.esm"
) as CellCoord[]) ||
data?.cells ||
[]

View File

@ -24,7 +24,8 @@ const PluginsList: React.FC<Props> = ({ selectedCell }) => {
cell.x === selectedCell.x &&
cell.y === selectedCell.y &&
// TODO: support other worlds
cell.world_form_id === 60
cell.world_form_id === 60 &&
plugin.parsed?.header.masters[0] === "Skyrim.esm"
)
)
: state.plugins.plugins