local constructionutil = require "constructionutil" local paramsutil = require "paramsutil" local zPos = 0 function data() local function makeParams() return { type = "ASSET_TRACK", description = { name = _("Industries gates addon"), description = _("Industries Tore Addon"), }, availability = {}, buildMode = "MULTI", categories = { "trackside" }, skipCollision = true, autoRemovable = false, params = { { key = "jmindustries", name = _("Industries"), uiType = "BUTTON", values = { _("Track Closed"), _("Track Open"), _("Street-S Closed"), _("Street-S Open"), _("Street-B Closed"), _("Street-B Open"), }, }, { key = "jmvariante", name = _("Variante"), uiType = "BUTTON", values = { _("Grau"), _("Rot"), _("Blau"), _("GrĂ¼n"), }, }, { key = "jmindustrieshoehe", name = _("High"), uiType = "SLIDER", values = { _(" 0 "), _(" 1 "), _(" 2 "), _(" 3 "), _(" 4 "), _(" 5 "), _(" 6 "), _(" 7 "), _(" 8 "), _(" 9 "), _(" 10 "), _(" 11 "), _(" 12 "), _(" 13 "), }, defaultIndex = 12, tooltip = _("High"), }, { key = "jmindustriesversatz", name = _("Offset"), uiType = "SLIDER", values = { _(" 0 "), _(" 1 "), _(" 2 "), _(" 3 "), _(" 4 "), _(" 5 "), _(" 6 "), _(" 7 "), _(" 8 "), _(" 9 "), _(" 10 "), _(" 11 "), _(" 12 "), _(" 13 "), }, defaultIndex = 7, tooltip = _("Offset"), }, }, updateFn = function(params) local result = { } result.models = { } jmindustrieshoehe = -0.38 + 0.083 * params.jmindustrieshoehe jmindustriesversatz = 0 + 0.05 * params.jmindustriesversatz if params.jmindustries == 0 and params.jmvariante == 0 then result.models = { {id = "asset/a01/jm_gates_closed_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } } elseif params.jmindustries == 0 and params.jmvariante == 1 then result.models = { {id = "asset/a02/jm_gates_closed_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } } elseif params.jmindustries == 0 and params.jmvariante == 2 then result.models = { {id = "asset/a03/jm_gates_closed_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } } elseif params.jmindustries == 0 and params.jmvariante == 3 then result.models = { {id = "asset/a04/jm_gates_closed_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } } end if params.jmindustries == 1 and params.jmvariante == 0 then result.models[#result.models+1] = { id = "asset/a01/jm_gates_open_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ws_sizex, 0, 0.52, 1 } } elseif params.jmindustries == 1 and params.jmvariante == 1 then result.models[#result.models+1] = { id = "asset/a02/jm_gates_open_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ws_sizex, 0, 0.52, 1 } } elseif params.jmindustries == 1 and params.jmvariante == 2 then result.models[#result.models+1] = { id = "asset/a03/jm_gates_open_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ws_sizex, 0, 0.52, 1 } } elseif params.jmindustries == 1 and params.jmvariante == 3 then result.models[#result.models+1] = { id = "asset/a04/jm_gates_open_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ws_sizex, 0, 0.52, 1 } } end if params.jmindustries == 2 and params.jmvariante == 0 then result.models[#result.models+1] = { id = "asset/a01/jm_gates_street_b_closed_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ws_sizex, 0, 0.52, 1 } } elseif params.jmindustries == 2 and params.jmvariante == 1 then result.models[#result.models+1] = { id = "asset/a02/jm_gates_street_b_closed_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ws_sizex, 0, 0.52, 1 } } elseif params.jmindustries == 2 and params.jmvariante == 2 then result.models[#result.models+1] = { id = "asset/a03/jm_gates_street_b_closed_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ws_sizex, 0, 0.52, 1 } } elseif params.jmindustries == 2 and params.jmvariante == 3 then result.models[#result.models+1] = { id = "asset/a04/jm_gates_street_b_closed_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ws_sizex, 0, 0.52, 1 } } end if params.jmindustries == 3 and params.jmvariante == 0 then result.models[#result.models+1] = { id = "asset/a01/jm_gates_street_b_open_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } elseif params.jmindustries == 3 and params.jmvariante == 1 then result.models[#result.models+1] = { id = "asset/a02/jm_gates_street_b_open_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } elseif params.jmindustries == 3 and params.jmvariante == 2 then result.models[#result.models+1] = { id = "asset/a03/jm_gates_street_b_open_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } elseif params.jmindustries == 3 and params.jmvariante == 3 then result.models[#result.models+1] = { id = "asset/a04/jm_gates_street_b_open_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } end if params.jmindustries == 4 and params.jmvariante == 0 then result.models[#result.models+1] = { id = "asset/a01/jm_gates_street_s_closed_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } elseif params.jmindustries == 4 and params.jmvariante == 1 then result.models[#result.models+1] = { id = "asset/a02/jm_gates_street_s_closed_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } elseif params.jmindustries == 4 and params.jmvariante == 2 then result.models[#result.models+1] = { id = "asset/a03/jm_gates_street_s_closed_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } elseif params.jmindustries == 4 and params.jmvariante == 3 then result.models[#result.models+1] = { id = "asset/a04/jm_gates_street_s_closed_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } end if params.jmindustries == 5 and params.jmvariante == 0 then result.models[#result.models+1] = { id = "asset/a01/jm_gates_street_s_open_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } elseif params.jmindustries == 5 and params.jmvariante == 1 then result.models[#result.models+1] = { id = "asset/a02/jm_gates_street_s_open_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } elseif params.jmindustries == 5 and params.jmvariante == 2 then result.models[#result.models+1] = { id = "asset/a03/jm_gates_street_s_open_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } elseif params.jmindustries == 5 and params.jmvariante == 3 then result.models[#result.models+1] = { id = "asset/a04/jm_gates_street_s_open_1.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, jmindustriesversatz, 0, jmindustrieshoehe, 1 }, } end result.terrainAlignmentLists = { { type = "EQUAL", faces = { terrainface } } } return result end } end