diff --git a/html/js/app.js b/html/js/app.js
index bb7534308..b0797b699 100644
--- a/html/js/app.js
+++ b/html/js/app.js
@@ -395,7 +395,9 @@ function generateDescription(itemData) {
case "labkey":
return `
Lab: ${itemData.info.lab}
`;
default:
- return itemData.description;
+ let itemDescr = itemData.description;
+ if (itemData.info.costs != undefined && itemData.info.costs != null) itemDescr += `ITEMS NEEDED: ${itemData.info.costs}
`;
+ return itemDescr;
}
}
@@ -648,7 +650,7 @@ function updateweights($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
return true;
}
- if (($fromInv.attr("data-inventory").split("-")[0] == "itemshop" && $toInv.attr("data-inventory").split("-")[0] == "itemshop") || ($fromInv.attr("data-inventory") == "crafting" && $toInv.attr("data-inventory") == "crafting")) {
+ if (($fromInv.attr("data-inventory").split("-")[0] == "itemshop" && $toInv.attr("data-inventory").split("-")[0] == "itemshop") || ($fromInv.attr("data-inventory") == "crafting" && $toInv.attr("data-inventory") == "crafting") || ($fromInv.attr("data-inventory") == "attachment_crafting" && $toInv.attr("data-inventory") == "attachment_crafting")) {
itemData = $fromInv.find("[data-slot=" + $fromSlot + "]").data("item");
if ($fromInv.attr("data-inventory").split("-")[0] == "itemshop") {
$fromInv.find("[data-slot=" + $fromSlot + "]").html('(' + itemData.amount + ") $" + itemData.price + '
");
@@ -660,7 +662,7 @@ function updateweights($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
return false;
}
- if ($toAmount == 0 && ($fromInv.attr("data-inventory").split("-")[0] == "itemshop" || $fromInv.attr("data-inventory") == "crafting")) {
+ if ($toAmount == 0 && ($fromInv.attr("data-inventory").split("-")[0] == "itemshop" || $fromInv.attr("data-inventory") == "crafting" || $fromInv.attr("data-inventory") == "attachment_crafting")) {
itemData = $fromInv.find("[data-slot=" + $fromSlot + "]").data("item");
if ($fromInv.attr("data-inventory").split("-")[0] == "itemshop") {
$fromInv.find("[data-slot=" + $fromSlot + "]").html('(' + itemData.amount + ") $" + itemData.price + '
");
@@ -672,7 +674,7 @@ function updateweights($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
return false;
}
- if ($toInv.attr("data-inventory").split("-")[0] == "itemshop" || $toInv.attr("data-inventory") == "crafting") {
+ if ($toInv.attr("data-inventory").split("-")[0] == "itemshop" || $toInv.attr("data-inventory") == "crafting" || $toInv.attr("data-inventory") == "attachment_crafting") {
itemData = $toInv.find("[data-slot=" + $toSlot + "]").data("item");
if ($toInv.attr("data-inventory").split("-")[0] == "itemshop") {
$toInv.find("[data-slot=" + $toSlot + "]").html('(' + itemData.amount + ") $" + itemData.price + '
");
@@ -715,12 +717,12 @@ function updateweights($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
}
}
- if (totalWeight > playerMaxWeight || (totalWeightOther > otherMaxWeight && $fromInv.attr("data-inventory").split("-")[0] != "itemshop" && $fromInv.attr("data-inventory") != "crafting")) {
+ if (totalWeight > playerMaxWeight || (totalWeightOther > otherMaxWeight && $fromInv.attr("data-inventory").split("-")[0] != "itemshop" && $fromInv.attr("data-inventory") != "crafting" && $fromInv.attr("data-inventory") != "attachment_crafting")) {
InventoryError($fromInv, $fromSlot);
return false;
}
updateProgressBar(parseInt(totalWeight), playerMaxWeight);
- if ($fromInv.attr("data-inventory").split("-")[0] != "itemshop" && $toInv.attr("data-inventory").split("-")[0] != "itemshop" && $fromInv.attr("data-inventory") != "crafting" && $toInv.attr("data-inventory") != "crafting") {
+ if ($fromInv.attr("data-inventory").split("-")[0] != "itemshop" && $toInv.attr("data-inventory").split("-")[0] != "itemshop" && $fromInv.attr("data-inventory") != "crafting" && $toInv.attr("data-inventory") != "attachment_crafting") {
$("#other-inv-label").html(otherLabel);
updateOtherProgressBar(parseInt(totalWeightOther), otherMaxWeight);
}
diff --git a/server/main.lua b/server/main.lua
index 3a5e0b025..9e0d7fcc6 100644
--- a/server/main.lua
+++ b/server/main.lua
@@ -2156,7 +2156,7 @@ RegisterNetEvent('inventory:server:SetInventoryData', function(fromInventory, to
QBCore.Functions.Notify(src, Lang:t('notify.noitem'), 'error')
end
elseif fromInventory == 'attachment_crafting' then
- local itemData = Config.AttachmentCrafting['items'][fromSlot]
+ local itemData = Config.AttachmentCrafting[fromSlot]
if hasCraftItems(src, itemData.costs, fromAmount) then
TriggerClientEvent('inventory:client:CraftAttachment', src, itemData.name, itemData.costs, fromAmount, toSlot, itemData.points)
else