vvvvvvvv wrote: ↑Sat, 26. Apr 25, 12:31
I would try to find a script that controls the button on modding screen. Because wares define their value as items, but you do not carry mods as items.
See... 08.cat/ui/addons/ego_detailmonitor/menu_ship_configuration.lua
function menu.buttonInstallMod, line 1317. Then start untangling the logic from there.
Cool, thanks!
I think that led me to the right place:
menu_ship_configuration.lua -> function menu.displayModBlueprint(...):
line# 6976:
Code: Select all
row[5]:setColSpan(4):createButton({ active = active, mouseOverText = mouseovertext }):setText(text, { halign = "center" })
if (type == "ship") or (type == "engine") then
row[5].handlers.onClick = function () return menu.buttonInstallMod(type, menu.object, moddata.ware, Helper.modQualities[moddata.quality].price, nil, nil, dismantle) end
elseif (type == "turret") and isgroup then
row[5].handlers.onClick = function () return menu.buttonInstallMod(type, menu.object, moddata.ware, Helper.modQualities[moddata.quality].price, slotdata.context, slotdata.group, dismantle) end
elseif type == "shield" then
row[5].handlers.onClick = function () return menu.buttonInstallMod(type, menu.object, moddata.ware, Helper.modQualities[moddata.quality].price, slotdata.context, slotdata.group, dismantle) end
else
row[5].handlers.onClick = function () return menu.buttonInstallMod(type, slotdata.component, moddata.ware, Helper.modQualities[moddata.quality].price, nil, nil, dismantle) end
end
That codeblock looks like it creates the actual button, and it gets the price from this array (using the mod's quality as the index):
Helper.modQualities[moddata.quality].price
... so the price of every mod is simply determined by its quality level, not it's name or anything.
Changing how all that logic works is doable, but it's more complicated than I'd like it to be because it's an array lookup and not function call (so I could put all the needed changes in that one function call). Oh well. If I wanted to go forward with my idea (note to self mostly), I'd need to start with replacing each array lookup for mod price with a function call.