forked from OpenWF/SpaceNinjaServer
don't put always available items into datalist
This commit is contained in:
parent
7c4a7d7cf0
commit
32983eae89
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user