-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.lua
More file actions
46 lines (44 loc) · 1.45 KB
/
mod.lua
File metadata and controls
46 lines (44 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function data()
return {
info = {
minorVersion = 0,
severityAdd = "NONE",
severityRemove = "WARNING",
name = _("mod_name"),
description = _("mod_desc"),
authors = {
{
name = "ModWerkstatt",
role = "CREATOR",
},
},
tags = { "europe", "germany", "bahn", "skoday", "dostos", "coach", "nim" },
params = {
{
key = "show_single_cars",
name = _("Show single cars?"),
uiType = "CHECKBOX",
values = { "No", "Yes", },
defaultIndex = 0,
tooltip = _("Show only fixed combination or also cars separately?"),
},
},
},
runFn = function (settings, modParams)
local function SingleCarModifier(fileName, data)
if data.metadata and data.metadata.transportVehicle and data.metadata.transportVehicle.multipleUnitOnly and data.metadata.transportVehicle.groupFileName == "vehicle/waggon/skodapushpull/menu_SkodaDosto.mdl" then
data.metadata.transportVehicle.multipleUnitOnly = false
end
return data
end
if modParams[getCurrentModId()] ~= nil then
local params = modParams[getCurrentModId()]
if params["show_single_cars"] == 1 then
addModifier("loadModel", SingleCarModifier)
end
else
addModifier("loadModel", SingleCarModifier)
end
end
}
end