-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod.lua
96 lines (89 loc) · 2.62 KB
/
mod.lua
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
function data()
return {
info = {
minorVersion = 2,
severityAdd = "NONE",
severityRemove = "WARNING",
name = _("mod_name"),
description = _("mod_desc"),
authors = {
{
name = "ModWerkstatt",
role = "CREATOR",
},
},
tags = { "europe", "waggon", "deutschland", "germany", "db", "goods", },
minGameVersion = 0,
dependencies = { },
url = { "" },
params = {
{
key = "pafake",
name = _("Fake_pa_wagen"),
values = { "No", "Yes", },
tooltip = _("option_pa_fake_desc"),
defaultIndex = 0,
},
{
key = "soundCheckpa",
name = _("sound_check"),
uiType = "CHECKBOX",
values = { "No", "Yes", },
tooltip = _("option_sound_check"),
defaultIndex = 1,
},
},
},
options = {
},
runFn = function (settings, modParams)
local params = modParams[getCurrentModId()]
local hidden = {
["10_fake.mdl"] = true,
["30_fake.mdl"] = true,
["mms51_fake.mdl"] = true,
["mms58_fake.mdl"] = true,
["ms55_fake.mdl"] = true,
["s50_fake.mdl"] = true,
["bkkmms588_fake.mdl"] = true,
["bs588_fake.mdl"] = true,
["ms584_fake.mdl"] = true,
["ms589_Container_1965_fake.mdl"] = true,
["ms589_Container_1982_fake.mdl"] = true,
["ms589_DBAG_Container_fake.mdl"] = true,
["ms589_DBAG_fake.mdl"] = true,
["ms589_fake.mdl"] = true,
["s589_fake.mdl"] = true,
}
local modelFilter = function(fileName, data)
local modelName = fileName:match('/BT([^/]*.mdl)')
or fileName:match('/Laa([^/]*.mdl)')
or fileName:match('/Lb([^/]*.mdl)')
return (modelName==nil or hidden[modelName]~=true)
end
if modParams[getCurrentModId()] ~= nil then
local params = modParams[getCurrentModId()]
if params["pafake"] == 0 then
addFileFilter("model/vehicle", modelFilter)
end
else
addFileFilter("model/vehicle", modelFilter)
end
local function metadataHandler(fileName, data)
if params.soundCheckpa == 0 then
if fileName:match('/vehicle/waggon/Tragwagen/BT([^/]*.mdl)')
or fileName:match('/vehicle/waggon/Tragwagen/Laa([^/]*.mdl)')
or fileName:match('/vehicle/waggon/Tragwagen/Lb([^/]*.mdl)')
or fileName:match('/vehicle/waggon/Tragwagen/fake/BT([^/]*.mdl)')
or fileName:match('/vehicle/waggon/Tragwagen/fake/Laa([^/]*.mdl)')
or fileName:match('/vehicle/waggon/Tragwagen/fake/Lb([^/]*.mdl)')
then
data.metadata.railVehicle.soundSet.name = "waggon_freight_old"
end
end
return data
end
addModifier( "loadModel", metadataHandler )
end
}
end