-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod.lua
207 lines (196 loc) · 6.04 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
function data()
return {
info = {
minorVersion = 1,
severityAdd = "NONE",
severityRemove = "WARNING",
name = _("mod_name"),
description = _("mod_desc"),
authors = {
{
name = "ModWerkstatt",
role = "CREATOR",
},
},
tags = { "europe", "train", "siemens", "vectron", "smartron", "electric", "multi-system", "universal" },
minGameVersion = 0,
dependencies = { },
url = { "" },
params = {
{
key = "br193_vorspann",
name = _("Vorspann_br193"),
values = { "No", "Yes", },
tooltip = _("option_vorspann_br193_desc"),
defaultIndex = 0,
},
{
key = "br193_fake",
name = _("Fake_br193"),
values = { "No", "Yes", },
tooltip = _("option_fake_br193_desc"),
defaultIndex = 0,
},
{
key = "br193_ms",
name = _("Ms_br193"),
values = { "No", "Yes", },
tooltip = _("option_ms_br193_desc"),
defaultIndex = 1,
},
{
key = "br193_ac",
name = _("Ac_br193"),
values = { "No", "Yes", },
tooltip = _("option_ac_br193_desc"),
defaultIndex = 1,
},
{
key = "br193_dc",
name = _("dc_br193"),
values = { "No", "Yes", },
tooltip = _("option_dc_br193_desc"),
defaultIndex = 1,
},
{
key = "br193_sm",
name = _("Sm_br193"),
values = { "No", "Yes", },
tooltip = _("option_sm_br193_desc"),
defaultIndex = 1,
},
{
key = "br193_dachinl",
name = _("dachinl_br193"),
values = { "No", "Yes", },
tooltip = _("option_dachinal_br193_desc"),
defaultIndex = 1,
},
{
key = "br193_osteuropa",
name = _("osteuropa_br193"),
values = { "No", "Yes", },
tooltip = _("option_osteuropa_br193_desc"),
defaultIndex = 1,
},
{
key = "br193_skandinavien",
name = _("skandinavien_br193"),
values = { "No", "Yes", },
tooltip = _("option_skandinavien_br193_desc"),
defaultIndex = 1,
},
},
},
options = {
},
runFn = function (settings, modParams)
local vorspannFilter = function(fileName, data)
if data.metadata.transportVehicle and data.metadata.vectron and data.metadata.vectron.vorspann == true then
data.metadata.availability.yearFrom = 1
data.metadata.availability.yearTo = 2
--return false
end
--return true
return data
end
local fakeFilter = function(fileName, data)
if data.metadata.transportVehicle and data.metadata.vectron and data.metadata.vectron.fake == true then
data.metadata.availability.yearFrom = 1
data.metadata.availability.yearTo = 2
end
return data
end
local msFilter = function(fileName, data)
if data.metadata.transportVehicle and data.metadata.vectron and data.metadata.vectron.ms == true then
data.metadata.availability.yearFrom = 1
data.metadata.availability.yearTo = 2
end
return data
end
local acFilter = function(fileName, data)
if data.metadata.transportVehicle and data.metadata.vectron and data.metadata.vectron.ac == true then
data.metadata.availability.yearFrom = 1
data.metadata.availability.yearTo = 2
end
return data
end
local dcFilter = function(fileName, data)
if data.metadata.transportVehicle and data.metadata.vectron and data.metadata.vectron.dc == true then
data.metadata.availability.yearFrom = 1
data.metadata.availability.yearTo = 2
end
return data
end
local smFilter = function(fileName, data)
if data.metadata.transportVehicle and data.metadata.vectron and data.metadata.vectron.sm == true then
data.metadata.availability.yearFrom = 1
data.metadata.availability.yearTo = 2
end
return data
end
local dachFilter = function(fileName, data)
if data.metadata.transportVehicle and data.metadata.vectron and data.metadata.vectron.dach == true then
data.metadata.availability.yearFrom = 1
data.metadata.availability.yearTo = 2
end
return data
end
local ostFilter = function(fileName, data)
if data.metadata.transportVehicle and data.metadata.vectron and data.metadata.vectron.ost == true then
data.metadata.availability.yearFrom = 1
data.metadata.availability.yearTo = 2
end
return data
end
local skandiFilter = function(fileName, data)
if data.metadata.transportVehicle and data.metadata.vectron and data.metadata.vectron.skandi == true then
data.metadata.availability.yearFrom = 1
data.metadata.availability.yearTo = 2
end
return data
end
if modParams[getCurrentModId()] ~= nil then
local params = modParams[getCurrentModId()]
if params["br193_vorspann"] == 0 then
--addFileFilter("model/transportVehicle", vorspannFilter)
addModifier("loadModel", vorspannFilter)
end
if params["br193_fake"] == 0 then
addModifier("loadModel", fakeFilter)
end
if params["br193_ms"] == 0 then
addModifier("loadModel", msFilter)
end
if params["br193_ac"] == 0 then
addModifier("loadModel", acFilter)
end
if params["br193_dc"] == 0 then
addModifier("loadModel", acFilter)
end
if params["br193_sm"] == 0 then
addModifier("loadModel", smFilter)
end
if params["br193_dachinl"] == 0 then
addModifier("loadModel", dachFilter)
end
if params["br193_osteuropa"] == 0 then
addModifier("loadModel", ostFilter)
end
if params["br193_skandinavien"] == 0 then
addModifier("loadModel", skandiFilter)
end
else
--addFileFilter("model/transportVehicle", vorspannFilter)
addModifier("loadModel", fakeFilter)
addModifier("loadModel", msFilter)
addModifier("loadModel", acFilter)
addModifier("loadModel", dcFilter)
addModifier("loadModel", smFilter)
addModifier("loadModel", dachFilter)
addModifier("loadModel", ostFilter)
addModifier("loadModel", skandiFilter)
end
end
}
end