Try fix
This commit is contained in:
@@ -30,13 +30,15 @@ export default function customNametags() {
|
|||||||
mp.nametags.enabled = false;
|
mp.nametags.enabled = false;
|
||||||
var color = [255, 255, 255, alpha];
|
var color = [255, 255, 255, alpha];
|
||||||
|
|
||||||
|
|
||||||
mp.events.addDataHandler("nameTagColor", (entity, value) => {
|
mp.events.addDataHandler("nameTagColor", (entity: EntityMp, value) => {
|
||||||
if (entity.type === "player") {
|
if (entity.type === "player") {
|
||||||
let temp = colors.find(c => c.id === value);
|
let temp = colors.find(c => c.id === value);
|
||||||
if (!temp)
|
if (!temp) {
|
||||||
|
entity.setVariable("nametagColor", [255, 255, 255, alpha]);
|
||||||
return;
|
return;
|
||||||
color = temp.color;
|
}
|
||||||
|
entity.setVariable("nametagColor", temp.color);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -62,6 +64,7 @@ export default function customNametags() {
|
|||||||
var armour = player.getArmour() / 100;
|
var armour = player.getArmour() / 100;
|
||||||
|
|
||||||
y -= scale * (0.005 * (screenRes.y / 1080));
|
y -= scale * (0.005 * (screenRes.y / 1080));
|
||||||
|
let color = player.data.nametagColor;
|
||||||
mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y],
|
mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y],
|
||||||
{
|
{
|
||||||
font: 4,
|
font: 4,
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
let categoryMenu = null;
|
let categoryMenu = null;
|
||||||
|
|
||||||
let clotheMenus = [];
|
let clotheMenus = [];
|
||||||
|
let categorysMenus = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let clothingData = [];
|
let clothingData = [];
|
||||||
@@ -188,6 +190,7 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
categoryMenu.AddItem(new UIMenuItem(mp.game.ui.getLabelText(txData[0].data[0].GXT), ""));
|
categoryMenu.AddItem(new UIMenuItem(mp.game.ui.getLabelText(txData[0].data[0].GXT), ""));
|
||||||
clotheSubMenu = new UIMenu(" ", mp.game.ui.getLabelText(txData[0].data[0].GXT), new Point(0, 0), bannerSprite.library, bannerSprite.texture);
|
clotheSubMenu = new UIMenu(" ", mp.game.ui.getLabelText(txData[0].data[0].GXT), new Point(0, 0), bannerSprite.library, bannerSprite.texture);
|
||||||
clotheSubMenu.Visible = false;
|
clotheSubMenu.Visible = false;
|
||||||
|
categorysMenus.push(categoryMenu);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,16 +210,17 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
cloth.push(item);
|
cloth.push(item);
|
||||||
tx.push(x);
|
tx.push(x);
|
||||||
}
|
}
|
||||||
|
clotheMenus.push({
|
||||||
|
menu: clotheSubMenu,
|
||||||
|
type: type,
|
||||||
|
slotIdx: Number(key),
|
||||||
|
item: cloth,
|
||||||
|
texture: tx
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clotheMenus.push({
|
|
||||||
menu: clotheSubMenu,
|
|
||||||
type: type,
|
|
||||||
slotIdx: Number(key),
|
|
||||||
item: cloth,
|
|
||||||
texture: tx
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,6 +322,7 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
|
|
||||||
// Reset some variables
|
// Reset some variables
|
||||||
clotheMenus = [];
|
clotheMenus = [];
|
||||||
|
categorysMenus = [];
|
||||||
currentMenuIdx = -1;
|
currentMenuIdx = -1;
|
||||||
menuTransition = false;
|
menuTransition = false;
|
||||||
lastClothing = null;
|
lastClothing = null;
|
||||||
@@ -382,9 +387,22 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const item of categorysMenus) {
|
||||||
|
// Preview hovering item
|
||||||
|
item.menu.IndexChange.on(submenuItemChangeHandler);
|
||||||
|
|
||||||
|
// Reset preview when player backs out of category menu
|
||||||
|
item.menu.MenuClose.on(() => {
|
||||||
|
resetPreview();
|
||||||
|
|
||||||
|
currentMenuIdx = -1;
|
||||||
|
mainMenu.Visible = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Main menu events
|
// Main menu events
|
||||||
mainMenu.ItemSelect.on((selectedItem, itemIndex) => {
|
mainMenu.ItemSelect.on((selectedItem, itemIndex) => {
|
||||||
const nextMenu = clotheMenus[itemIndex];
|
const nextMenu = categorysMenus[itemIndex];
|
||||||
const slot = Number(nextMenu.slotIdx);
|
const slot = Number(nextMenu.slotIdx);
|
||||||
|
|
||||||
lastClothing = {
|
lastClothing = {
|
||||||
|
|||||||
Reference in New Issue
Block a user