init.lua 1.2 KB

12345678910111213141516171819202122232425262728
  1. local mod_name = "dlxtrains"
  2. dlxtrains = {}
  3. dlxtrains.S = minetest.get_translator(mod_name)
  4. dlxtrains.use_advtrains_livery_designer = minetest.get_modpath( "advtrains_livery_designer" ) and advtrains_livery_designer
  5. local maximum_wagon_length_enum = minetest.settings:get("dlxtrains_maximum_wagon_length") or "Unlimited"
  6. dlxtrains.max_wagon_length = ({["5m"]=5, ["6m"]=6, ["7m"]=7, ["8m"]=8, ["Unlimited"]=100})[maximum_wagon_length_enum]
  7. local locomotive_sounds_enum = minetest.settings:get("dlxtrains_locomotive_sounds") or "Dynamic"
  8. dlxtrains.locomotive_sounds = ({["Off"]=0, ["Constant"]=1, ["Dynamic"]=2})[locomotive_sounds_enum]
  9. local locomotive_smoke_enum = minetest.settings:get("dlxtrains_locomotive_smoke") or "Dynamic"
  10. dlxtrains.locomotive_smoke = ({["Off"]=0, ["Constant"]=1, ["Dynamic"]=2})[locomotive_smoke_enum]
  11. local use_wagon_sounds = minetest.settings:get_bool("dlxtrains_wagon_sounds")
  12. if use_wagon_sounds == nil then use_wagon_sounds = true end
  13. dlxtrains.wagon_sounds = use_wagon_sounds
  14. advtrains.register_coupler_type("knuckle", dlxtrains.S("Knuckle Coupler"))
  15. local mod_path = minetest.get_modpath(mod_name)
  16. dofile(mod_path.."/materials.lua")
  17. dofile(mod_path.."/items.lua")
  18. dofile(mod_path.."/tools.lua")
  19. dofile(mod_path.."/livery_functions.lua")