init.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. local S
  2. if minetest.get_modpath("intllib") then
  3. S = (intllib.make_gettext_pair and intllib.make_gettext_pair()) or intllib.Getter()
  4. else
  5. S = function(s) return s end
  6. end
  7. local mod_name = "tfl_s7_stock_generic_livery_pack"
  8. local default_seat_alpha = 192
  9. -- The following variables may need to be overriden per template based on
  10. -- future contributions. Currently, these values are the same for all livery
  11. -- templates defined in this mod.
  12. local template_designer = "Marnack"
  13. local texture_license = "CC-BY-SA-3.0"
  14. local texture_creator = "Marnack, with portions based on original texture by Mainote Plants Lab"
  15. -- Define all of the livery tempalte names. These will be used when creating
  16. -- livery templates for each of the wagon types.
  17. local livery_template_names = {
  18. [1] = {name = S("Generic - Triple Stripe"), notes = "This a fictional variation of the original livery of the London Underground's S7 and S8 stock in which three wide stripes span the length of each unit."},
  19. [2] = {name = S("Generic - Middle Stripe"), notes = "This a fictional variation of the original livery of the London Underground's S7 and S8 stock in which the stripe is located mid-wall instead of at its base."},
  20. [3] = {name = S("Generic - Two Color Stripe"), notes = "This a fictional variation of the original livery of the London Underground's S7 and S8 stock in which a two color stripe wraps around the end of the train."},
  21. [4] = {name = S("Generic - Upper Lower Split"), notes = "This a fictional variation of the original livery of the London Underground's S7 and S8 stock in which the upper and lower side walls can have different colors."},
  22. [5] = {name = S("Generic - Window Band"), notes = "This a fictional variation of the original livery of the London Underground's S7 and S8 stock in which a horozontal band of color surrounds the side windows."},
  23. }
  24. local livery_templates = {
  25. ["advtrains:under_s7dm"] = {
  26. [1] = {
  27. base_texture = mod_name.."_s7dm_01.png",
  28. overlays = {
  29. [1] = {name = S("Exterior Walls"), texture = mod_name.."_s7dm_01_exterior_walls.png"},
  30. [2] = {name = S("Side Doors"), texture = "advtrains_london_s7dm_common_doors.png"},
  31. [3] = {name = S("Upper Stripe"), texture = mod_name.."_s7dm_01_upper_stripe.png"},
  32. [4] = {name = S("Middle Stripe"), texture = mod_name.."_s7dm_01_middle_stripe.png"},
  33. [5] = {name = S("Lower Stripe"), texture = mod_name.."_s7dm_01_lower_stripe.png"},
  34. [6] = {name = S("Roof"), texture = "advtrains_london_s7dm_common_roof.png"},
  35. },
  36. },
  37. [2] = {
  38. base_texture = mod_name.."_s7dm_02.png",
  39. overlays = {
  40. [1] = {name = S("Cab End"), texture = "advtrains_london_s7dm_common_cab_end.png"},
  41. [2] = {name = S("Side Doors"), texture = "advtrains_london_s7dm_common_doors.png"},
  42. [3] = {name = S("Stripe"), texture = mod_name.."_s7dm_02_stripe.png"},
  43. [4] = {name = S("Side Walls"), texture = mod_name.."_s7dm_02_side_walls.png"},
  44. [5] = {name = S("Roof"), texture = "advtrains_london_s7dm_common_roof.png"},
  45. [6] = {name = S("Seats"), texture = mod_name.."_s7dm_02_seats.png", alpha = default_seat_alpha},
  46. },
  47. },
  48. [3] = {
  49. base_texture = mod_name.."_s7dm_03.png",
  50. overlays = {
  51. [1] = {name = S("Cab End"), texture = mod_name.."_s7dm_03_cab_end.png"},
  52. [2] = {name = S("Side Doors"), texture = mod_name.."_s7dm_03_doors.png"},
  53. [3] = {name = S("Stripe"), texture = mod_name.."_s7dm_03_stripe.png"},
  54. [4] = {name = S("Side Walls"), texture = mod_name.."_s7dm_03_side_walls.png"},
  55. [5] = {name = S("Roof"), texture = mod_name.."_s7dm_03_roof.png"},
  56. [6] = {name = S("Stripe Inset"), texture = mod_name.."_s7dm_03_stripe_inset.png"},
  57. },
  58. },
  59. [4] = {
  60. base_texture = mod_name.."_s7dm_04.png",
  61. overlays = {
  62. [1] = {name = S("Cab End"), texture = "advtrains_london_s7dm_common_cab_end.png"},
  63. [2] = {name = S("Side Doors"), texture = "advtrains_london_s7dm_common_doors.png"},
  64. [3] = {name = S("Upper Walls"), texture = mod_name.."_s7dm_04_upper_walls.png"},
  65. [4] = {name = S("Stripe"), texture = mod_name.."_s7dm_04_stripe.png"},
  66. [5] = {name = S("Lower Walls"), texture = mod_name.."_s7dm_04_lower_walls.png"},
  67. [6] = {name = S("Seats"), texture = mod_name.."_s7dm_04_seats.png", alpha = default_seat_alpha},
  68. },
  69. },
  70. [5] = {
  71. base_texture = mod_name.."_s7dm_05.png",
  72. overlays = {
  73. [1] = {name = S("Cab End"), texture = "advtrains_london_s7dm_common_cab_end.png"},
  74. [2] = {name = S("Side Doors"), texture = "advtrains_london_s7dm_common_doors.png"},
  75. [3] = {name = S("Window Band"), texture = mod_name.."_s7dm_05_window_band.png"},
  76. [4] = {name = S("Window Band Edges"), texture = mod_name.."_s7dm_05_window_band_edges.png"},
  77. [5] = {name = S("Side Walls"), texture = mod_name.."_s7dm_05_side_walls.png"},
  78. [6] = {name = S("Seats"), texture = mod_name.."_s7dm_05_seats.png", alpha = default_seat_alpha},
  79. },
  80. },
  81. },
  82. ["advtrains:under_s7ndm"] = {
  83. [1] = {
  84. base_texture = mod_name.."_s7ndm_01.png",
  85. overlays = {
  86. [1] = {name = S("Exterior Walls"), texture = mod_name.."_s7ndm_01_exterior_walls.png"},
  87. [2] = {name = S("Side Doors"), texture = "advtrains_london_s7ndm_common_doors.png"},
  88. [3] = {name = S("Upper Stripe"), texture = mod_name.."_s7ndm_01_upper_stripe.png"},
  89. [4] = {name = S("Middle Stripe"), texture = mod_name.."_s7ndm_01_middle_stripe.png"},
  90. [5] = {name = S("Lower Stripe"), texture = mod_name.."_s7ndm_01_lower_stripe.png"},
  91. [6] = {name = S("Roof"), texture = "advtrains_london_s7ndm_common_roof.png"},
  92. },
  93. },
  94. [2] = {
  95. base_texture = mod_name.."_s7ndm_02.png",
  96. overlays = {
  97. [1] = {name = S("Side Doors"), texture = "advtrains_london_s7ndm_common_doors.png"},
  98. [2] = {name = S("Stripe"), texture = mod_name.."_s7ndm_02_stripe.png"},
  99. [3] = {name = S("Side Walls"), texture = mod_name.."_s7ndm_02_side_walls.png"},
  100. [4] = {name = S("Roof"), texture = "advtrains_london_s7ndm_common_roof.png"},
  101. [5] = {name = S("Seats"), texture = mod_name.."_s7ndm_02_seats.png", alpha = default_seat_alpha},
  102. },
  103. },
  104. [3] = {
  105. base_texture = mod_name.."_s7ndm_03.png",
  106. overlays = {
  107. [1] = {name = S("Side Doors"), texture = mod_name.."_s7ndm_03_doors.png"},
  108. [2] = {name = S("Stripe"), texture = mod_name.."_s7ndm_03_stripe.png"},
  109. [3] = {name = S("Side Walls"), texture = mod_name.."_s7ndm_03_side_walls.png"},
  110. [4] = {name = S("Roof"), texture = "advtrains_london_s7ndm_common_roof.png"},
  111. [5] = {name = S("Stripe Inset"), texture = mod_name.."_s7ndm_03_stripe_inset.png"},
  112. },
  113. },
  114. [4] = {
  115. base_texture = mod_name.."_s7ndm_04.png",
  116. overlays = {
  117. [1] = {name = S("Side Doors"), texture = "advtrains_london_s7ndm_common_doors.png"},
  118. [2] = {name = S("Upper Walls"), texture = mod_name.."_s7ndm_04_upper_walls.png"},
  119. [3] = {name = S("Stripe"), texture = mod_name.."_s7ndm_04_stripe.png"},
  120. [4] = {name = S("Lower Walls"), texture = mod_name.."_s7ndm_04_lower_walls.png"},
  121. [5] = {name = S("Seats"), texture = mod_name.."_s7ndm_04_seats.png", alpha = default_seat_alpha},
  122. },
  123. },
  124. [5] = {
  125. base_texture = mod_name.."_s7ndm_05.png",
  126. overlays = {
  127. [1] = {name = S("Side Doors"), texture = "advtrains_london_s7ndm_common_doors.png"},
  128. [2] = {name = S("Window Band"), texture = mod_name.."_s7ndm_05_window_band.png"},
  129. [3] = {name = S("Window Band Edges"), texture = mod_name.."_s7ndm_05_window_band_edges.png"},
  130. [4] = {name = S("Side Walls"), texture = mod_name.."_s7ndm_05_side_walls.png"},
  131. [5] = {name = S("Seats"), texture = mod_name.."_s7ndm_05_seats.png", alpha = default_seat_alpha},
  132. },
  133. },
  134. },
  135. }
  136. local predefined_liveries = {
  137. {
  138. name = "Generic - Village Green",
  139. notes = "",
  140. livery_design = {
  141. wagon_type = "advtrains:under_s7dm",
  142. livery_template_name = "Generic - Triple Stripe",
  143. overlays = {
  144. [1] = {id = 1, color = "#006400"}, -- Exterior Walls
  145. [2] = {id = 2, color = "#F2F2F2"}, -- Side Doors
  146. [3] = {id = 3, color = "#006400"}, -- Upper Stripe
  147. [4] = {id = 4, color = "#F2F2F2"}, -- Middle Stripe
  148. [5] = {id = 5, color = "#333333"}, -- Lower Stripe
  149. -- [6] = {id = 6, color = "#000000"}, -- Roof
  150. },
  151. },
  152. },
  153. {
  154. name = "Generic - Village Green",
  155. notes = "",
  156. livery_design = {
  157. wagon_type = "advtrains:under_s7ndm",
  158. livery_template_name = "Generic - Triple Stripe",
  159. overlays = {
  160. [1] = {id = 1, color = "#006400"}, -- Exterior Walls
  161. [2] = {id = 2, color = "#F2F2F2"}, -- Side Doors
  162. [3] = {id = 3, color = "#006400"}, -- Upper Stripe
  163. [4] = {id = 4, color = "#F2F2F2"}, -- Middle Stripe
  164. [5] = {id = 5, color = "#333333"}, -- Lower Stripe
  165. -- [6] = {id = 6, color = "#000000"}, -- Roof
  166. },
  167. },
  168. },
  169. {
  170. name = "Generic - Orange Appeal",
  171. notes = "",
  172. livery_design = {
  173. wagon_type = "advtrains:under_s7dm",
  174. livery_template_name = "Generic - Triple Stripe",
  175. overlays = {
  176. [1] = {id = 1, color = "#CD3E00"}, -- Exterior Walls
  177. [2] = {id = 2, color = "#DAA520"}, -- Side Doors
  178. [3] = {id = 3, color = "#333333"}, -- Upper Stripe
  179. [4] = {id = 4, color = "#333333"}, -- Middle Stripe
  180. [5] = {id = 5, color = "#CD3E00"}, -- Lower Stripe
  181. [6] = {id = 6, color = "#CD3E00"}, -- Roof
  182. },
  183. },
  184. },
  185. {
  186. name = "Generic - Orange Appeal",
  187. notes = "",
  188. livery_design = {
  189. wagon_type = "advtrains:under_s7ndm",
  190. livery_template_name = "Generic - Triple Stripe",
  191. overlays = {
  192. [1] = {id = 1, color = "#CD3E00"}, -- Exterior Walls
  193. [2] = {id = 2, color = "#DAA520"}, -- Side Doors
  194. [3] = {id = 3, color = "#333333"}, -- Upper Stripe
  195. [4] = {id = 4, color = "#333333"}, -- Middle Stripe
  196. [5] = {id = 5, color = "#CD3E00"}, -- Lower Stripe
  197. [6] = {id = 6, color = "#CD3E00"}, -- Roof
  198. },
  199. },
  200. },
  201. {
  202. name = "Generic - Fly Away Blue",
  203. notes = "",
  204. livery_design = {
  205. wagon_type = "advtrains:under_s7dm",
  206. livery_template_name = "Generic - Triple Stripe",
  207. overlays = {
  208. [1] = {id = 1, color = "#3737FF"}, -- Exterior Walls
  209. [2] = {id = 2, color = "#F2F2F2"}, -- Side Doors
  210. [3] = {id = 3, color = "#3737FF"}, -- Upper Stripe
  211. [4] = {id = 4, color = "#333333"}, -- Middle Stripe
  212. [5] = {id = 5, color = "#3737FF"}, -- Lower Stripe
  213. -- [6] = {id = 6, color = "#000000"}, -- Roof
  214. },
  215. },
  216. },
  217. {
  218. name = "Generic - Fly Away Blue",
  219. notes = "",
  220. livery_design = {
  221. wagon_type = "advtrains:under_s7ndm",
  222. livery_template_name = "Generic - Triple Stripe",
  223. overlays = {
  224. [1] = {id = 1, color = "#3737FF"}, -- Exterior Walls
  225. [2] = {id = 2, color = "#F2F2F2"}, -- Side Doors
  226. [3] = {id = 3, color = "#3737FF"}, -- Upper Stripe
  227. [4] = {id = 4, color = "#333333"}, -- Middle Stripe
  228. [5] = {id = 5, color = "#3737FF"}, -- Lower Stripe
  229. -- [6] = {id = 6, color = "#000000"}, -- Roof
  230. },
  231. },
  232. },
  233. {
  234. name = "Generic - Nordic Dreams",
  235. notes = "",
  236. livery_design = {
  237. wagon_type = "advtrains:under_s7dm",
  238. livery_template_name = "Generic - Middle Stripe",
  239. overlays = {
  240. [1] = {id = 1, color = "#87CEEB"}, -- Cab End
  241. [2] = {id = 2, color = "#4169E1"}, -- Side Doors
  242. -- [3] = {id = 3, color = "#000000"}, -- Stripe
  243. [4] = {id = 4, color = "#87CEEB"}, -- Side Walls
  244. -- [5] = {id = 5, color = "#000000"}, -- Roof
  245. [6] = {id = 6, color = "#4169E1"}, -- Seats
  246. },
  247. },
  248. },
  249. {
  250. name = "Generic - Nordic Dreams",
  251. notes = "",
  252. livery_design = {
  253. wagon_type = "advtrains:under_s7ndm",
  254. livery_template_name = "Generic - Middle Stripe",
  255. overlays = {
  256. [1] = {id = 1, color = "#4169E1"}, -- Side Doors
  257. -- [2] = {id = 2, color = "#000000"}, -- Stripe
  258. [3] = {id = 3, color = "#87CEEB"}, -- Side Walls
  259. -- [4] = {id = 4, color = "#000000"}, -- Roof
  260. [5] = {id = 5, color = "#4169E1"}, -- Seats
  261. },
  262. },
  263. },
  264. {
  265. name = "Generic - Blue Bayou",
  266. notes = "",
  267. livery_design = {
  268. wagon_type = "advtrains:under_s7dm",
  269. livery_template_name = "Generic - Two Color Stripe",
  270. overlays = {
  271. [1] = {id = 1, color = "#007E99"}, -- Cab End
  272. [2] = {id = 2, color = "#007E99"}, -- Side Doors
  273. [3] = {id = 3, color = "#007E99"}, -- Stripe
  274. [4] = {id = 4, color = "#F2F2F2"}, -- Side Walls
  275. -- [5] = {id = 5, color = "#000000"}, -- Roof
  276. [6] = {id = 6, color = "#007E99"}, -- Stripe Inset
  277. },
  278. },
  279. },
  280. {
  281. name = "Generic - Blue Bayou",
  282. notes = "",
  283. livery_design = {
  284. wagon_type = "advtrains:under_s7ndm",
  285. livery_template_name = "Generic - Two Color Stripe",
  286. overlays = {
  287. [1] = {id = 1, color = "#007E99"}, -- Side Doors
  288. [2] = {id = 2, color = "#007E99"}, -- Stripe
  289. [3] = {id = 3, color = "#F2F2F2"}, -- Side Walls
  290. -- [4] = {id = 4, color = "#000000"}, -- Roof
  291. [5] = {id = 5, color = "#007E99"}, -- Stripe Inset
  292. },
  293. },
  294. },
  295. {
  296. name = "Generic - Union Jack",
  297. notes = "",
  298. livery_design = {
  299. wagon_type = "advtrains:under_s7dm",
  300. livery_template_name = "Generic - Two Color Stripe",
  301. overlays = {
  302. [1] = {id = 1, color = "#F2F2F2"}, -- Cab End
  303. [2] = {id = 2, color = "#C8102E"}, -- Side Doors
  304. [3] = {id = 3, color = "#C8102E"}, -- Stripe
  305. [4] = {id = 4, color = "#012169"}, -- Side Walls
  306. -- [5] = {id = 5, color = "#000000"}, -- Roof
  307. [6] = {id = 6, color = "#F2F2F2"}, -- Stripe Inset
  308. },
  309. },
  310. },
  311. {
  312. name = "Generic - Union Jack",
  313. notes = "",
  314. livery_design = {
  315. wagon_type = "advtrains:under_s7ndm",
  316. livery_template_name = "Generic - Two Color Stripe",
  317. overlays = {
  318. [1] = {id = 1, color = "#C8102E"}, -- Side Doors
  319. [2] = {id = 2, color = "#C8102E"}, -- Stripe
  320. [3] = {id = 3, color = "#012169"}, -- Side Walls
  321. -- [4] = {id = 4, color = "#000000"}, -- Roof
  322. [5] = {id = 5, color = "#F2F2F2"}, -- Stripe Inset
  323. },
  324. },
  325. },
  326. {
  327. name = "Generic - Falling Leaves",
  328. notes = "",
  329. livery_design = {
  330. wagon_type = "advtrains:under_s7dm",
  331. livery_template_name = "Generic - Upper Lower Split",
  332. overlays = {
  333. [1] = {id = 1, color = "#E73300"}, -- Cab End
  334. [2] = {id = 2, color = "#FFD700"}, -- Side Doors
  335. [3] = {id = 3, color = "#FF8818"}, -- Upper Walls
  336. [4] = {id = 4, color = "#141414"}, -- Stripe
  337. [5] = {id = 5, color = "#E73300"}, -- Lower Walls
  338. [6] = {id = 6, color = "#A52A2A"}, -- Seats
  339. },
  340. },
  341. },
  342. {
  343. name = "Generic - Falling Leaves",
  344. notes = "",
  345. livery_design = {
  346. wagon_type = "advtrains:under_s7ndm",
  347. livery_template_name = "Generic - Upper Lower Split",
  348. overlays = {
  349. [1] = {id = 1, color = "#FFD700"}, -- Side Doors
  350. [2] = {id = 2, color = "#FF8818"}, -- Upper Walls
  351. [3] = {id = 3, color = "#141414"}, -- Stripe
  352. [4] = {id = 4, color = "#E73300"}, -- Lower Walls
  353. [5] = {id = 5, color = "#A52A2A"}, -- Seats
  354. },
  355. },
  356. },
  357. {
  358. name = "Generic - Marooned",
  359. notes = "",
  360. livery_design = {
  361. wagon_type = "advtrains:under_s7dm",
  362. livery_template_name = "Generic - Window Band",
  363. overlays = {
  364. [1] = {id = 1, color = "#800000"}, -- Cab End
  365. [2] = {id = 2, color = "#800000"}, -- Side Doors
  366. [3] = {id = 3, color = "#646464"}, -- Window Band
  367. [4] = {id = 4, color = "#AEAEAE"}, -- Window Band Edges
  368. [5] = {id = 5, color = "#F2F2F2"}, -- Side Walls
  369. [6] = {id = 6, color = "#800000"}, -- Seats
  370. },
  371. },
  372. },
  373. {
  374. name = "Generic - Marooned",
  375. notes = "",
  376. livery_design = {
  377. wagon_type = "advtrains:under_s7ndm",
  378. livery_template_name = "Generic - Window Band",
  379. overlays = {
  380. [1] = {id = 1, color = "#800000"}, -- Side Doors
  381. [2] = {id = 2, color = "#646464"}, -- Window Band
  382. [3] = {id = 3, color = "#AEAEAE"}, -- Window Band Edges
  383. [4] = {id = 4, color = "#F2F2F2"}, -- Side Walls
  384. [5] = {id = 5, color = "#800000"}, -- Seats
  385. },
  386. },
  387. },
  388. {
  389. name = "Generic - That 70's Vibe",
  390. notes = "",
  391. livery_design = {
  392. wagon_type = "advtrains:under_s7dm",
  393. livery_template_name = "Generic - Window Band",
  394. overlays = {
  395. [1] = {id = 1, color = "#8B4513"}, -- Cab End
  396. [2] = {id = 2, color = "#FFA500"}, -- Side Doors
  397. [3] = {id = 3, color = "#F5DEB3"}, -- Window Band
  398. [4] = {id = 4, color = "#FFA500"}, -- Window Band Edges
  399. [5] = {id = 5, color = "#8B4513"}, -- Side Walls
  400. [6] = {id = 6, color = "#8B4513"}, -- Seats
  401. },
  402. },
  403. },
  404. {
  405. name = "Generic - That 70's Vibe",
  406. notes = "",
  407. livery_design = {
  408. wagon_type = "advtrains:under_s7ndm",
  409. livery_template_name = "Generic - Window Band",
  410. overlays = {
  411. [1] = {id = 1, color = "#FFA500"}, -- Side Doors
  412. [2] = {id = 2, color = "#F5DEB3"}, -- Window Band
  413. [3] = {id = 3, color = "#FFA500"}, -- Window Band Edges
  414. [4] = {id = 4, color = "#8B4513"}, -- Side Walls
  415. [5] = {id = 5, color = "#8B4513"}, -- Seats
  416. },
  417. },
  418. },
  419. }
  420. -- This mod needs to register itself with the livery database in order to be
  421. -- allowed to add livery templates and predefined liveries. It does not need
  422. -- to register itself with the livery designer tool, however, since it will
  423. -- not be registering any wagons.
  424. advtrains_livery_database.register_mod(mod_name)
  425. -- The following is "boilerplate" code for registering the preceding livery
  426. -- template information with the livery database. It is suitable for basic
  427. -- livery templates such as those defined in this mod. Using some of the more
  428. -- advanced features that are possible with livery templates will likely
  429. -- require modifications to this code. Such advanced features include adding
  430. -- support for models that use multiple texture slots or liveries that require
  431. -- callback function in support of more complex visual features.
  432. -- Register this mod's livery templates with the livery database.
  433. for wagon_type, wagon_livery_templates in pairs(livery_templates) do
  434. for livery_template_id, livery_template in pairs(wagon_livery_templates) do
  435. local livery_template_name = livery_template_names[livery_template_id].name
  436. if livery_template_name then
  437. advtrains_livery_database.add_livery_template(
  438. wagon_type,
  439. livery_template_name,
  440. {livery_template.base_texture},
  441. mod_name,
  442. (livery_template.overlays and #livery_template.overlays) or 0,
  443. livery_template.designer or template_designer,
  444. livery_template.texture_license or texture_license,
  445. livery_template.texture_creator or texture_creator,
  446. livery_template_names[livery_template_id].notes
  447. )
  448. if livery_template.overlays then
  449. for overlay_id, overlay in ipairs(livery_template.overlays) do
  450. advtrains_livery_database.add_livery_template_overlay(
  451. wagon_type,
  452. livery_template_name,
  453. overlay_id,
  454. overlay.name,
  455. 1, -- Texture slot index
  456. overlay.texture,
  457. overlay.alpha
  458. )
  459. end
  460. end
  461. end
  462. end
  463. end
  464. -- Register this mod's predefined wagon liveries.
  465. for _, predefined_livery in pairs(predefined_liveries) do
  466. local livery_design = predefined_livery.livery_design
  467. advtrains_livery_database.add_predefined_livery(
  468. predefined_livery.name,
  469. livery_design,
  470. mod_name,
  471. predefined_livery.notes
  472. )
  473. end