I’m trying to make a mod, but I can’t seem to get it to add to the drop-down menu (context menu). Beneath is some of my code which seems flawless to me after I compared it to other mods.
var OriginalContextMenu = UI.showContextMenu;
var NewContextMenu = function (b, c, d, h) {
c.push({
label: "National Stock Exchange...",
action: function () {
Sound.click();
GameManager.resume(true);
var div = $("#NatStockEx");
div.scrollTop()
div.gdDialog({
popout: !0,
close: !0
})
}
//var shareValue = GameManager.company.cash / 500000000 * 20;
var maxValue = math.floor(GameManager.company.cash / (GameManager.company.cash / 500000000 * 20)); // line 107
div.find(".SAS").slider({
min: 1,
max: maxValue,
range: "min",
value: Math.floor(shareAmount),
animate: !1,
slide: function (a, b) {
var c = b.value;
totalShares(c);
}
});
});
totalShares(shareAmount);
OriginalContextMenu(b, c, d, h);
};
UI.showContextMenu = NewContextMenu;
Well that definitely did something, because I’m now getting a new error which I’m guessing is related my divs, which I’ll probably be able to sort out. Thanks though!
And just for the record, I admit to comparing your code to mine to see where I went wrong and tried to adjust things to fix it, but I did not flat-out copy/paste it.
EDIT: Can’t seem to figure out whether the error is related to the divs itself or the attributes Has anyone experienced this before and know what’s up? I’ve put everything on pastebin so that you can actually provide help.