From 5bc5e2016e2b44d18fb2568d108b874c5e208e47 Mon Sep 17 00:00:00 2001
From: mknzz <85302866+mknzz@users.noreply.github.com>
Date: Sat, 1 Jan 2022 06:02:09 +0000
Subject: [PATCH] Show quality bar for all items
---
html/js/app.js | 144 ++++++++++++++++++++++++-------------------------
1 file changed, 72 insertions(+), 72 deletions(-)
diff --git a/html/js/app.js b/html/js/app.js
index 8473cf3e4..2f01d34aa 100644
--- a/html/js/app.js
+++ b/html/js/app.js
@@ -1213,14 +1213,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
var ItemLabel =
'
";
- if (newData.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(newData.name)) {
+ //if (newData.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(newData.name)) {
ItemLabel =
'";
- }
- }
+ //}
+ //}
if ($toSlot < 6 && $toInv.attr("data-inventory") == "player") {
$toInv
@@ -1271,8 +1271,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
);
}
- if (newData.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(newData.name)) {
+ //if (newData.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(newData.name)) {
if (newData.info.quality == undefined) {
newData.info.quality = 100.0;
}
@@ -1301,8 +1301,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
})
.find("p")
.html(qualityLabel);
- }
- }
+ //}
+ //}
$fromInv.find("[data-slot=" + $fromSlot + "]").removeClass("item-drag");
$fromInv.find("[data-slot=" + $fromSlot + "]").addClass("item-nodrag");
@@ -1335,14 +1335,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
var ItemLabel =
'";
- if (newData.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(newData.name)) {
+ //if (newData.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(newData.name)) {
ItemLabel =
'";
- }
- }
+ //}
+ //}
if ($toSlot < 6 && $toInv.attr("data-inventory") == "player") {
$toInv
@@ -1393,8 +1393,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
);
}
- if (newData.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(newData.name)) {
+ //if (newData.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(newData.name)) {
if (newData.info.quality == undefined) {
newData.info.quality = 100.0;
}
@@ -1423,8 +1423,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
})
.find("p")
.html(qualityLabel);
- }
- }
+ //}
+ //}
$fromInv
.find("[data-slot=" + $fromSlot + "]")
@@ -1456,14 +1456,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
'' +
newDataFrom.label +
"
";
- if (newDataFrom.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(newDataFrom.name)) {
+ //if (newDataFrom.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(newDataFrom.name)) {
ItemLabel =
'' +
newDataFrom.label +
"
";
- }
- }
+ //}
+ //}
if ($fromSlot < 6 && $fromInv.attr("data-inventory") == "player") {
$fromInv
@@ -1523,8 +1523,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
);
}
- if (newDataFrom.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(newDataFrom.name)) {
+ //if (newDataFrom.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(newDataFrom.name)) {
if (newDataFrom.info.quality == undefined) {
newDataFrom.info.quality = 100.0;
}
@@ -1556,8 +1556,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
})
.find("p")
.html(qualityLabel);
- }
- }
+ //}
+ //}
}
}
$.post("https://qb-inventory/PlayDropSound", JSON.stringify({}));
@@ -1610,14 +1610,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
var ItemLabel =
'";
- if (fromData.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(fromData.name)) {
+ //if (fromData.name.split("_")[0] == "weapon") {
+ // if (!Inventory.IsWeaponBlocked(fromData.name)) {
ItemLabel =
'";
- }
- }
+ //}
+ //}
if ($toSlot < 6 && $toInv.attr("data-inventory") == "player") {
$toInv
@@ -1668,8 +1668,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
);
}
- if (fromData.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(fromData.name)) {
+ //if (fromData.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(fromData.name)) {
if (fromData.info.quality == undefined) {
fromData.info.quality = 100.0;
}
@@ -1701,8 +1701,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
})
.find("p")
.html(qualityLabel);
- }
- }
+ //}
+ //}
if (toData != undefined) {
toData.slot = parseInt($fromSlot);
@@ -1716,14 +1716,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
var ItemLabel =
'";
- if (toData.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(toData.name)) {
+ //if (toData.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(toData.name)) {
ItemLabel =
'";
- }
- }
+ //}
+ //}
if ($fromSlot < 6 && $fromInv.attr("data-inventory") == "player") {
$fromInv
@@ -1777,8 +1777,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
);
}
- if (toData.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(toData.name)) {
+ //if (toData.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(toData.name)) {
if (toData.info.quality == undefined) {
toData.info.quality = 100.0;
}
@@ -1807,8 +1807,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
})
.find("p")
.html(qualityLabel);
- }
- }
+ //}
+ //}
$.post(
"https://qb-inventory/SetInventoryData",
@@ -1892,14 +1892,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
var ItemLabel =
'";
- if (newDataTo.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(newDataTo.name)) {
+ //if (newDataTo.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(newDataTo.name)) {
ItemLabel =
'";
- }
- }
+ //}
+ //}
if ($toSlot < 6 && $toInv.attr("data-inventory") == "player") {
$toInv
@@ -1950,8 +1950,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
);
}
- if (newDataTo.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(newDataTo.name)) {
+ //if (newDataTo.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(newDataTo.name)) {
if (newDataTo.info.quality == undefined) {
newDataTo.info.quality = 100.0;
}
@@ -1983,8 +1983,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
})
.find("p")
.html(qualityLabel);
- }
- }
+ //}
+ //}
var newDataFrom = [];
newDataFrom.name = fromData.name;
@@ -2030,14 +2030,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
'' +
newDataFrom.label +
"
";
- if (newDataFrom.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(newDataFrom.name)) {
+ //if (newDataFrom.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(newDataFrom.name)) {
ItemLabel =
'' +
newDataFrom.label +
"
";
- }
- }
+ //}
+ //}
if ($fromSlot < 6 && $fromInv.attr("data-inventory") == "player") {
$fromInv
@@ -2097,8 +2097,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
);
}
- if (newDataFrom.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(newDataFrom.name)) {
+ //if (newDataFrom.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(newDataFrom.name)) {
if (newDataFrom.info.quality == undefined) {
newDataFrom.info.quality = 100.0;
}
@@ -2130,8 +2130,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
})
.find("p")
.html(qualityLabel);
- }
- }
+ //}
+ //}
}
$.post("https://qb-inventory/PlayDropSound", JSON.stringify({}));
$.post(
@@ -2206,8 +2206,8 @@ var requiredItemOpen = false;
};
Inventory.QualityCheck = function(item, IsHotbar, IsOtherInventory) {
- if (!Inventory.IsWeaponBlocked(item.name)) {
- if (item.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(item.name)) {
+ //if (item.name.split("_")[0] == "weapon") {
if (item.info.quality == undefined) {
item.info.quality = 100;
}
@@ -2294,8 +2294,8 @@ var requiredItemOpen = false;
.html(qualityLabel);
}
}
- }
- }
+ //}
+ //}
};
Inventory.Open = function(data) {
@@ -2368,14 +2368,14 @@ var requiredItemOpen = false;
totalWeight += item.weight * item.amount;
var ItemLabel =
'";
- if (item.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(item.name)) {
+ //if (item.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(item.name)) {
ItemLabel =
'";
- }
- }
+ //}
+ //}
if (item.slot < 6) {
$(".player-inventory")
.find("[data-slot=" + item.slot + "]")
@@ -2457,14 +2457,14 @@ var requiredItemOpen = false;
totalWeightOther += item.weight * item.amount;
var ItemLabel =
'";
- if (item.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(item.name)) {
+ //if (item.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(item.name)) {
ItemLabel =
'";
- }
- }
+ //}
+ //}
$(".other-inventory")
.find("[data-slot=" + item.slot + "]")
.addClass("item-drag");
@@ -2725,14 +2725,14 @@ var requiredItemOpen = false;
if (item != null) {
var ItemLabel =
'";
- if (item.name.split("_")[0] == "weapon") {
- if (!Inventory.IsWeaponBlocked(item.name)) {
+ //if (item.name.split("_")[0] == "weapon") {
+ //if (!Inventory.IsWeaponBlocked(item.name)) {
ItemLabel =
'";
- }
- }
+ //}
+ //}
if (item.slot == 41) {
$(".z-hotbar-inventory")
.find("[data-zhotbarslot=" + item.slot + "]")