Fixed new car mod slots

This commit is contained in:
Lennart Kampshoff
2018-10-28 02:32:47 +01:00
parent 5ea3ae605a
commit 4d02755642

View File

@@ -135,6 +135,8 @@ mp.events.add("showTuningMenu", () => {
if (slotName === undefined) slotName = getSlotName(modType);
}
if (slotName === "undefined") slotName = "Slot " + modType;
var menuItem = new UIMenuItem(slotName);
if(localVehicle.getNumMods(modType) !== 0) mainMenu.AddItem(menuItem);
@@ -146,6 +148,16 @@ mp.events.add("showTuningMenu", () => {
mainMenu.ItemSelect.on(item => {
var modSlot = getSlotId(item.Text);
mp.gui.chat.push(item.Text);
if (item.Text.startsWith("Slot")) {
mp.gui.chat.push("slot item");
restStr = item.Text.substring(5);
mp.gui.chat.push(`restStr = ${restStr}`);
modSlot = parseInt(restStr);
mp.gui.chat.push(`modSlot = ${modSlot}`);
}
var modNum = localVehicle.getNumMods(modSlot);
var modMenu = new Menu(item.Text, "Änderung: " + item.Text, new Point(50, 50));