Skip to content

Commit

Permalink
Show quality bar for all items
Browse files Browse the repository at this point in the history
  • Loading branch information
mknzz committed Jan 1, 2022
1 parent ea2db33 commit 5bc5e20
Showing 1 changed file with 72 additions and 72 deletions.
144 changes: 72 additions & 72 deletions html/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1213,14 +1213,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {

var ItemLabel =
'<div class="item-slot-label"><p>' + newData.label + "</p></div>";
if (newData.name.split("_")[0] == "weapon") {
if (!Inventory.IsWeaponBlocked(newData.name)) {
//if (newData.name.split("_")[0] == "weapon") {
//if (!Inventory.IsWeaponBlocked(newData.name)) {
ItemLabel =
'<div class="item-slot-quality"><div class="item-slot-quality-bar"><p>100</p></div></div><div class="item-slot-label"><p>' +
newData.label +
"</p></div>";
}
}
//}
//}

if ($toSlot < 6 && $toInv.attr("data-inventory") == "player") {
$toInv
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -1335,14 +1335,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {

var ItemLabel =
'<div class="item-slot-label"><p>' + newData.label + "</p></div>";
if (newData.name.split("_")[0] == "weapon") {
if (!Inventory.IsWeaponBlocked(newData.name)) {
//if (newData.name.split("_")[0] == "weapon") {
//if (!Inventory.IsWeaponBlocked(newData.name)) {
ItemLabel =
'<div class="item-slot-quality"><div class="item-slot-quality-bar"><p>100</p></div></div><div class="item-slot-label"><p>' +
newData.label +
"</p></div>";
}
}
//}
//}

if ($toSlot < 6 && $toInv.attr("data-inventory") == "player") {
$toInv
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -1423,8 +1423,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
})
.find("p")
.html(qualityLabel);
}
}
//}
//}

$fromInv
.find("[data-slot=" + $fromSlot + "]")
Expand Down Expand Up @@ -1456,14 +1456,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
'<div class="item-slot-label"><p>' +
newDataFrom.label +
"</p></div>";
if (newDataFrom.name.split("_")[0] == "weapon") {
if (!Inventory.IsWeaponBlocked(newDataFrom.name)) {
//if (newDataFrom.name.split("_")[0] == "weapon") {
//if (!Inventory.IsWeaponBlocked(newDataFrom.name)) {
ItemLabel =
'<div class="item-slot-quality"><div class="item-slot-quality-bar"><p>100</p></div></div><div class="item-slot-label"><p>' +
newDataFrom.label +
"</p></div>";
}
}
//}
//}

if ($fromSlot < 6 && $fromInv.attr("data-inventory") == "player") {
$fromInv
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -1556,8 +1556,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
})
.find("p")
.html(qualityLabel);
}
}
//}
//}
}
}
$.post("https://qb-inventory/PlayDropSound", JSON.stringify({}));
Expand Down Expand Up @@ -1610,14 +1610,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {

var ItemLabel =
'<div class="item-slot-label"><p>' + fromData.label + "</p></div>";
if (fromData.name.split("_")[0] == "weapon") {
if (!Inventory.IsWeaponBlocked(fromData.name)) {
//if (fromData.name.split("_")[0] == "weapon") {
// if (!Inventory.IsWeaponBlocked(fromData.name)) {
ItemLabel =
'<div class="item-slot-quality"><div class="item-slot-quality-bar"><p>100</p></div></div><div class="item-slot-label"><p>' +
fromData.label +
"</p></div>";
}
}
//}
//}

if ($toSlot < 6 && $toInv.attr("data-inventory") == "player") {
$toInv
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -1701,8 +1701,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
})
.find("p")
.html(qualityLabel);
}
}
//}
//}

if (toData != undefined) {
toData.slot = parseInt($fromSlot);
Expand All @@ -1716,14 +1716,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {

var ItemLabel =
'<div class="item-slot-label"><p>' + toData.label + "</p></div>";
if (toData.name.split("_")[0] == "weapon") {
if (!Inventory.IsWeaponBlocked(toData.name)) {
//if (toData.name.split("_")[0] == "weapon") {
//if (!Inventory.IsWeaponBlocked(toData.name)) {
ItemLabel =
'<div class="item-slot-quality"><div class="item-slot-quality-bar"><p>100</p></div></div><div class="item-slot-label"><p>' +
toData.label +
"</p></div>";
}
}
//}
//}

if ($fromSlot < 6 && $fromInv.attr("data-inventory") == "player") {
$fromInv
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -1807,8 +1807,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
})
.find("p")
.html(qualityLabel);
}
}
//}
//}

$.post(
"https://qb-inventory/SetInventoryData",
Expand Down Expand Up @@ -1892,14 +1892,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {

var ItemLabel =
'<div class="item-slot-label"><p>' + newDataTo.label + "</p></div>";
if (newDataTo.name.split("_")[0] == "weapon") {
if (!Inventory.IsWeaponBlocked(newDataTo.name)) {
//if (newDataTo.name.split("_")[0] == "weapon") {
//if (!Inventory.IsWeaponBlocked(newDataTo.name)) {
ItemLabel =
'<div class="item-slot-quality"><div class="item-slot-quality-bar"><p>100</p></div></div><div class="item-slot-label"><p>' +
newDataTo.label +
"</p></div>";
}
}
//}
//}

if ($toSlot < 6 && $toInv.attr("data-inventory") == "player") {
$toInv
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -1983,8 +1983,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
})
.find("p")
.html(qualityLabel);
}
}
//}
//}

var newDataFrom = [];
newDataFrom.name = fromData.name;
Expand Down Expand Up @@ -2030,14 +2030,14 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
'<div class="item-slot-label"><p>' +
newDataFrom.label +
"</p></div>";
if (newDataFrom.name.split("_")[0] == "weapon") {
if (!Inventory.IsWeaponBlocked(newDataFrom.name)) {
//if (newDataFrom.name.split("_")[0] == "weapon") {
//if (!Inventory.IsWeaponBlocked(newDataFrom.name)) {
ItemLabel =
'<div class="item-slot-quality"><div class="item-slot-quality-bar"><p>100</p></div></div><div class="item-slot-label"><p>' +
newDataFrom.label +
"</p></div>";
}
}
//}
//}

if ($fromSlot < 6 && $fromInv.attr("data-inventory") == "player") {
$fromInv
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -2130,8 +2130,8 @@ function swap($fromSlot, $toSlot, $fromInv, $toInv, $toAmount) {
})
.find("p")
.html(qualityLabel);
}
}
//}
//}
}
$.post("https://qb-inventory/PlayDropSound", JSON.stringify({}));
$.post(
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -2294,8 +2294,8 @@ var requiredItemOpen = false;
.html(qualityLabel);
}
}
}
}
//}
//}
};

Inventory.Open = function(data) {
Expand Down Expand Up @@ -2368,14 +2368,14 @@ var requiredItemOpen = false;
totalWeight += item.weight * item.amount;
var ItemLabel =
'<div class="item-slot-label"><p>' + item.label + "</p></div>";
if (item.name.split("_")[0] == "weapon") {
if (!Inventory.IsWeaponBlocked(item.name)) {
//if (item.name.split("_")[0] == "weapon") {
//if (!Inventory.IsWeaponBlocked(item.name)) {
ItemLabel =
'<div class="item-slot-quality"><div class="item-slot-quality-bar"><p>100</p></div></div><div class="item-slot-label"><p>' +
item.label +
"</p></div>";
}
}
//}
//}
if (item.slot < 6) {
$(".player-inventory")
.find("[data-slot=" + item.slot + "]")
Expand Down Expand Up @@ -2457,14 +2457,14 @@ var requiredItemOpen = false;
totalWeightOther += item.weight * item.amount;
var ItemLabel =
'<div class="item-slot-label"><p>' + item.label + "</p></div>";
if (item.name.split("_")[0] == "weapon") {
if (!Inventory.IsWeaponBlocked(item.name)) {
//if (item.name.split("_")[0] == "weapon") {
//if (!Inventory.IsWeaponBlocked(item.name)) {
ItemLabel =
'<div class="item-slot-quality"><div class="item-slot-quality-bar"><p>100</p></div></div><div class="item-slot-label"><p>' +
item.label +
"</p></div>";
}
}
//}
//}
$(".other-inventory")
.find("[data-slot=" + item.slot + "]")
.addClass("item-drag");
Expand Down Expand Up @@ -2725,14 +2725,14 @@ var requiredItemOpen = false;
if (item != null) {
var ItemLabel =
'<div class="item-slot-label"><p>' + item.label + "</p></div>";
if (item.name.split("_")[0] == "weapon") {
if (!Inventory.IsWeaponBlocked(item.name)) {
//if (item.name.split("_")[0] == "weapon") {
//if (!Inventory.IsWeaponBlocked(item.name)) {
ItemLabel =
'<div class="item-slot-quality"><div class="item-slot-quality-bar"><p>100</p></div></div><div class="item-slot-label"><p>' +
item.label +
"</p></div>";
}
}
//}
//}
if (item.slot == 41) {
$(".z-hotbar-inventory")
.find("[data-zhotbarslot=" + item.slot + "]")
Expand Down

0 comments on commit 5bc5e20

Please sign in to comment.