diff --git a/src/controllers/custom/getItemListsController.ts b/src/controllers/custom/getItemListsController.ts index a8bb3258..65a9bcc5 100644 --- a/src/controllers/custom/getItemListsController.ts +++ b/src/controllers/custom/getItemListsController.ts @@ -36,7 +36,7 @@ interface ListedItem { partType?: string; chainLength?: number; parazon?: boolean; - excludeFromAddMissing?: boolean; + alwaysAvailable?: boolean; } interface ItemLists { @@ -459,7 +459,7 @@ const getItemListsController: RequestHandler = (req, response) => { uniqueName, name: getString(item.name, lang) }; - if (item.alwaysAvailable) flavourItem.excludeFromAddMissing = true; + if (item.alwaysAvailable) flavourItem.alwaysAvailable = true; res.FlavourItems.push(flavourItem); } diff --git a/static/webui/script.js b/static/webui/script.js index b58ed123..129d334b 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -594,11 +594,12 @@ function fetchItemList() { } else if (item.uniqueName.includes("ColourPicker")) { item.name = loc("code_itemColorPalette").split("|ITEM|").join(item.name); } - const option = document.createElement("option"); - option.setAttribute("data-key", item.uniqueName); - option.value = item.name; - document.getElementById("datalist-" + type).appendChild(option); - if (item.excludeFromAddMissing) option.setAttribute("data-exclude-from-add-missing", ""); + if (!item.alwaysAvailable) { + const option = document.createElement("option"); + option.setAttribute("data-key", item.uniqueName); + option.value = item.name; + document.getElementById("datalist-" + type).appendChild(option); + } itemMap[item.uniqueName] = { ...item, type }; }); } else { @@ -2266,10 +2267,7 @@ function addMissingEquipment(categories) { "#" + category + "-list [data-item-type='" + elm.getAttribute("data-key") + "']" ) ) { - if ( - !webUiModularWeapons.includes(elm.getAttribute("data-key")) && - !elm.hasAttribute("data-exclude-from-add-missing") - ) { + if (!webUiModularWeapons.includes(elm.getAttribute("data-key"))) { let ItemCount = 1; if (category == "ShipDecorations") ItemCount = 100; requests.push({ ItemType: elm.getAttribute("data-key"), ItemCount }); @@ -3415,7 +3413,6 @@ function reAddToItemList(itemMap, datalist, itemType) { const option = document.createElement("option"); option.setAttribute("data-key", itemType); option.value = itemMap[itemType]?.name ?? itemType; - if (itemMap[itemType]?.excludeFromAddMissing) option.setAttribute("data-exclude-from-add-missing", ""); document.getElementById("datalist-" + datalist).appendChild(option); }