Add custom Item Images
This commit is contained in:
@@ -61,7 +61,7 @@ mp.events.add("showInventory", (invWeight, itemArr) => {
|
||||
inventoryWeight = invWeight;
|
||||
items = itemArr;
|
||||
show = true;
|
||||
mp.game.graphics.requestStreamedTextureDict("Mprpsymbol", true);
|
||||
mp.game.graphics.requestStreamedTextureDict("ItemImages", true);
|
||||
} else {
|
||||
mp.gui.chat.activate(true);
|
||||
mp.gui.cursor.show(false, false);
|
||||
@@ -109,7 +109,7 @@ mp.events.add("render", () => {
|
||||
//SPRITES + ITEMANZAHL
|
||||
for (var currentItem = 0; currentItem < items.length; currentItem++) {
|
||||
if (items[currentItem][4] !== "null") {
|
||||
mp.game.graphics.drawSprite("Mprpsymbol", "rp", grid[parseInt(items[currentItem][4] - 1)][0], grid[parseInt(items[currentItem][4] - 1)][1], rWidth / 8, rWidth / 5, 0, 255, 255, 255, 255);
|
||||
mp.game.graphics.drawSprite("ItemImages", items[currentItem][0], grid[parseInt(items[currentItem][4] - 1)][0], grid[parseInt(items[currentItem][4] - 1)][1], rWidth / 8, rWidth / 5, 0, 255, 255, 255, 255);
|
||||
mp.game.graphics.drawText("(~y~" + items[currentItem][3] + "~s~)", [grid[parseInt(items[currentItem][4] - 1)][0] + (sizeMul / 2) - 0.008, grid[parseInt(items[currentItem][4] - 1)][1] + 0.05], {
|
||||
font: 0,
|
||||
color: [255, 255, 255, 255],
|
||||
@@ -143,7 +143,7 @@ mp.events.add("render", () => {
|
||||
});
|
||||
|
||||
//EINZELGEWICHT
|
||||
mp.game.graphics.drawText("~y~" + hoverItemP[2] + "g", [pos[0] / screenX, pos[1] / screenY + 0.06], {
|
||||
mp.game.graphics.drawText("~y~" + hoverItemP[2] + "g~s~ * " + hoverItemP[3] + "~s~ = ~y~" + hoverItemP[2] * hoverItemP[3] + "g", [pos[0] / screenX, pos[1] / screenY + 0.06], {
|
||||
font: 4,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.35, 0.35],
|
||||
@@ -151,16 +151,6 @@ mp.events.add("render", () => {
|
||||
});
|
||||
}
|
||||
|
||||
////WENN FREIER SLOT
|
||||
//if (isMouseOverFreeSlot(pos[0], pos[1])) {
|
||||
// mp.game.graphics.drawText("~r~FREE SLOT ~g~" + actFreeSlot, [0.5, 0.05], {
|
||||
// font: 4,
|
||||
// color: [255, 255, 255, 255],
|
||||
// scale: [0.7, 0.7],
|
||||
// outline: true,
|
||||
// });
|
||||
//}
|
||||
|
||||
//WENN MOUSE DOWN
|
||||
if (mouseDown && dragItem !== null) {
|
||||
if (isMouseOverFreeSlot(pos[0], pos[1])) {
|
||||
|
||||
Reference in New Issue
Block a user