init.lua 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. local mod_name = "classic_coaches_generic_livery_pack"
  2. local S = minetest.get_translator(mod_name)
  3. local default_seat_alpha = 245
  4. local default_wall_alpha = 253
  5. -- The following variables may need to be overriden per template based on
  6. -- future contributions. Currently, these values are the same for all livery
  7. -- templates defined in this mod.
  8. local template_designer = "Marnack"
  9. local texture_license = "CC-BY-SA-3.0"
  10. local texture_creator = "Marnack"
  11. -- Define all of the livery tempalte names. These will be used when creating
  12. -- livery templates for each of the wagon types.
  13. local livery_template_names = {
  14. [1] = {name = S("Generic - Stripe"), notes = "The livery features a medium width stripe. A narrow divider stripe can be added."},
  15. [2] = {name = S("Generic - Intercity Stripe"), notes = "The livery features a medium width stripe with the word, 'intercity'. The side doors are colored differently by default."},
  16. [3] = {name = S("Generic - Edged Stripe"), notes = "The livery features a medium width stripe. The stripe's edges are colored differently by default."},
  17. [4] = {name = S("Generic - Tricolor"), notes = "The livery can have different colors for the upper and lower halves of it sides and well as a window band. The window band can also be trimmed in a different color."},
  18. [5] = {name = S("Generic - Double Bands and Stripe"), notes = "This livery features color trim along the top and bottom of the sides, a window band, a wide band along the bottom half of the sides and a stripe separating the upper and lower halves of the sides."},
  19. [6] = {name = S("Generic - Window Band and Stripe"), notes = "This livery features independent colors for the upper and lower halves of the sides, a window band and a narrow stripe near the middle."},
  20. [7] = {name = S("Generic - Window Stripes"), notes = "In addition to a window band, the livery features a narrow strips above the windows and two adjacent stripes just below the windows."},
  21. }
  22. local livery_templates = {
  23. ["classic_coaches:corridor_coach_class1"] = {
  24. [1] = {
  25. base_texture = mod_name.."_corridor_coach_class1_001.png",
  26. overlays = {
  27. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_001_class1_side_walls.png", alpha = default_wall_alpha},
  28. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_001_stripe.png", alpha = default_wall_alpha},
  29. [3] = {name = S("Stripe Divider"), texture = mod_name.."_overlay_001_stripe_divider.png"},
  30. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  31. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  32. },
  33. },
  34. [2] = {
  35. base_texture = mod_name.."_corridor_coach_class1_002.png",
  36. overlays = {
  37. [1] = {name = S("Exterior Walls"), texture = mod_name.."_overlay_002_class1_exterior_walls.png", alpha = default_wall_alpha},
  38. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_002_stripe.png", alpha = default_wall_alpha},
  39. [3] = {name = S("Service Stripe"), texture = "classic_coaches_overlay_service_stripe.png"},
  40. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  41. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  42. },
  43. },
  44. [3] = {
  45. base_texture = mod_name.."_corridor_coach_class1_003.png",
  46. overlays = {
  47. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_003_side_walls.png", alpha = default_wall_alpha},
  48. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_003_stripe.png", alpha = default_wall_alpha},
  49. [3] = {name = S("Stripe Edges"), texture = mod_name.."_overlay_003_stripe_edges.png"},
  50. [4] = {name = S("Seats"), texture = "classic_coaches_overlay_seats.png", alpha = default_seat_alpha},
  51. [5] = {name = S("End Doors"), texture = "classic_coaches_overlay_end_doors.png"},
  52. },
  53. },
  54. [4] = {
  55. base_texture = mod_name.."_corridor_coach_class1_004.png",
  56. overlays = {
  57. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_004_upper_side_walls.png", alpha = default_wall_alpha},
  58. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_004_lower_side_walls.png", alpha = default_wall_alpha},
  59. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_004_class1_window_band.png", alpha = default_wall_alpha},
  60. [4] = {name = S("Window Band Trim"), texture = mod_name.."_overlay_004_window_band_trim.png"},
  61. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  62. },
  63. },
  64. [5] = {
  65. base_texture = mod_name.."_corridor_coach_class1_005.png",
  66. overlays = {
  67. [1] = {name = S("Upper Trim"), texture = mod_name.."_overlay_005_upper_trim.png", alpha = default_wall_alpha},
  68. [2] = {name = S("Window Band"), texture = mod_name.."_overlay_005_class1_window_band.png", alpha = default_wall_alpha},
  69. [3] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_005_middle_stripe.png", alpha = default_wall_alpha},
  70. [4] = {name = S("Lower Band"), texture = mod_name.."_overlay_005_lower_band.png", alpha = default_wall_alpha},
  71. [5] = {name = S("Lower Trim"), texture = mod_name.."_overlay_005_lower_trim.png", alpha = default_wall_alpha},
  72. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  73. },
  74. },
  75. [6] = {
  76. base_texture = mod_name.."_corridor_coach_class1_006.png",
  77. overlays = {
  78. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_006_upper_side_walls.png", alpha = default_wall_alpha},
  79. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_006_lower_side_walls.png", alpha = default_wall_alpha},
  80. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_006_class1_window_band.png", alpha = default_wall_alpha},
  81. [4] = {name = S("Stripe"), texture = mod_name.."_overlay_006_stripe.png", alpha = default_wall_alpha},
  82. [5] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  83. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  84. },
  85. },
  86. [7] = {
  87. base_texture = mod_name.."_corridor_coach_class1_007.png",
  88. overlays = {
  89. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_007_side_walls.png", alpha = default_wall_alpha},
  90. [2] = {name = S("Upper Stripe"), texture = mod_name.."_overlay_007_upper_stripe.png"},
  91. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_007_class1_window_band.png", alpha = default_wall_alpha},
  92. [4] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_007_middle_stripe.png", alpha = default_wall_alpha},
  93. [5] = {name = S("Lower Stripe"), texture = mod_name.."_overlay_007_lower_stripe.png", alpha = default_wall_alpha},
  94. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  95. },
  96. },
  97. },
  98. ["classic_coaches:corridor_coach_class2"] = {
  99. [1] = {
  100. base_texture = mod_name.."_corridor_coach_class2_001.png",
  101. overlays = {
  102. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_001_class2_side_walls.png", alpha = default_wall_alpha},
  103. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_001_stripe.png", alpha = default_wall_alpha},
  104. [3] = {name = S("Stripe Divider"), texture = mod_name.."_overlay_001_stripe_divider.png"},
  105. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  106. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  107. },
  108. },
  109. [2] = {
  110. base_texture = mod_name.."_corridor_coach_class2_002.png",
  111. overlays = {
  112. [1] = {name = S("Exterior Walls"), texture = mod_name.."_overlay_002_class2_exterior_walls.png", alpha = default_wall_alpha},
  113. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_002_stripe.png", alpha = default_wall_alpha},
  114. [3] = {name = S("Service Stripe"), texture = "classic_coaches_overlay_service_stripe.png"},
  115. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  116. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  117. },
  118. },
  119. [3] = {
  120. base_texture = mod_name.."_corridor_coach_class2_003.png",
  121. overlays = {
  122. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_003_side_walls.png", alpha = default_wall_alpha},
  123. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_003_stripe.png", alpha = default_wall_alpha},
  124. [3] = {name = S("Stripe Edges"), texture = mod_name.."_overlay_003_stripe_edges.png"},
  125. [4] = {name = S("Seats"), texture = "classic_coaches_overlay_seats.png", alpha = default_seat_alpha},
  126. [5] = {name = S("End Doors"), texture = "classic_coaches_overlay_end_doors.png"},
  127. },
  128. },
  129. [4] = {
  130. base_texture = mod_name.."_corridor_coach_class2_004.png",
  131. overlays = {
  132. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_004_upper_side_walls.png", alpha = default_wall_alpha},
  133. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_004_lower_side_walls.png", alpha = default_wall_alpha},
  134. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_004_class2_window_band.png", alpha = default_wall_alpha},
  135. [4] = {name = S("Window Band Trim"), texture = mod_name.."_overlay_004_window_band_trim.png"},
  136. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  137. },
  138. },
  139. [5] = {
  140. base_texture = mod_name.."_corridor_coach_class2_005.png",
  141. overlays = {
  142. [1] = {name = S("Upper Trim"), texture = mod_name.."_overlay_005_upper_trim.png", alpha = default_wall_alpha},
  143. [2] = {name = S("Window Band"), texture = mod_name.."_overlay_005_class2_window_band.png", alpha = default_wall_alpha},
  144. [3] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_005_middle_stripe.png", alpha = default_wall_alpha},
  145. [4] = {name = S("Lower Band"), texture = mod_name.."_overlay_005_lower_band.png", alpha = default_wall_alpha},
  146. [5] = {name = S("Lower Trim"), texture = mod_name.."_overlay_005_lower_trim.png", alpha = default_wall_alpha},
  147. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  148. },
  149. },
  150. [6] = {
  151. base_texture = mod_name.."_corridor_coach_class2_006.png",
  152. overlays = {
  153. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_006_upper_side_walls.png", alpha = default_wall_alpha},
  154. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_006_lower_side_walls.png", alpha = default_wall_alpha},
  155. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_006_class2_window_band.png", alpha = default_wall_alpha},
  156. [4] = {name = S("Stripe"), texture = mod_name.."_overlay_006_stripe.png", alpha = default_wall_alpha},
  157. [5] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  158. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  159. },
  160. },
  161. [7] = {
  162. base_texture = mod_name.."_corridor_coach_class2_007.png",
  163. overlays = {
  164. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_007_side_walls.png", alpha = default_wall_alpha},
  165. [2] = {name = S("Upper Stripe"), texture = mod_name.."_overlay_007_upper_stripe.png"},
  166. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_007_class2_window_band.png", alpha = default_wall_alpha},
  167. [4] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_007_middle_stripe.png", alpha = default_wall_alpha},
  168. [5] = {name = S("Lower Stripe"), texture = mod_name.."_overlay_007_lower_stripe.png", alpha = default_wall_alpha},
  169. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  170. },
  171. },
  172. },
  173. ["classic_coaches:open_coach_class1"] = {
  174. [1] = {
  175. base_texture = mod_name.."_open_coach_class1_001.png",
  176. overlays = {
  177. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_001_class1_side_walls.png", alpha = default_wall_alpha},
  178. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_001_stripe.png", alpha = default_wall_alpha},
  179. [3] = {name = S("Stripe Divider"), texture = mod_name.."_overlay_001_stripe_divider.png"},
  180. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  181. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  182. },
  183. },
  184. [2] = {
  185. base_texture = mod_name.."_open_coach_class1_002.png",
  186. overlays = {
  187. [1] = {name = S("Exterior Walls"), texture = mod_name.."_overlay_002_class1_exterior_walls.png", alpha = default_wall_alpha},
  188. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_002_stripe.png", alpha = default_wall_alpha},
  189. [3] = {name = S("Service Stripe"), texture = "classic_coaches_overlay_service_stripe.png"},
  190. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  191. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  192. },
  193. },
  194. [3] = {
  195. base_texture = mod_name.."_open_coach_class1_003.png",
  196. overlays = {
  197. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_003_side_walls.png", alpha = default_wall_alpha},
  198. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_003_stripe.png", alpha = default_wall_alpha},
  199. [3] = {name = S("Stripe Edges"), texture = mod_name.."_overlay_003_stripe_edges.png"},
  200. [4] = {name = S("Seats"), texture = "classic_coaches_overlay_seats.png", alpha = default_seat_alpha},
  201. [5] = {name = S("End Doors"), texture = "classic_coaches_overlay_end_doors.png"},
  202. },
  203. },
  204. [4] = {
  205. base_texture = mod_name.."_open_coach_class1_004.png",
  206. overlays = {
  207. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_004_upper_side_walls.png", alpha = default_wall_alpha},
  208. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_004_lower_side_walls.png", alpha = default_wall_alpha},
  209. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_004_class1_window_band.png", alpha = default_wall_alpha},
  210. [4] = {name = S("Window Band Trim"), texture = mod_name.."_overlay_004_window_band_trim.png"},
  211. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  212. },
  213. },
  214. [5] = {
  215. base_texture = mod_name.."_open_coach_class1_005.png",
  216. overlays = {
  217. [1] = {name = S("Upper Trim"), texture = mod_name.."_overlay_005_upper_trim.png", alpha = default_wall_alpha},
  218. [2] = {name = S("Window Band"), texture = mod_name.."_overlay_005_class1_window_band.png", alpha = default_wall_alpha},
  219. [3] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_005_middle_stripe.png", alpha = default_wall_alpha},
  220. [4] = {name = S("Lower Band"), texture = mod_name.."_overlay_005_lower_band.png", alpha = default_wall_alpha},
  221. [5] = {name = S("Lower Trim"), texture = mod_name.."_overlay_005_lower_trim.png", alpha = default_wall_alpha},
  222. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  223. },
  224. },
  225. [6] = {
  226. base_texture = mod_name.."_open_coach_class1_006.png",
  227. overlays = {
  228. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_006_upper_side_walls.png", alpha = default_wall_alpha},
  229. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_006_lower_side_walls.png", alpha = default_wall_alpha},
  230. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_006_class1_window_band.png", alpha = default_wall_alpha},
  231. [4] = {name = S("Stripe"), texture = mod_name.."_overlay_006_stripe.png", alpha = default_wall_alpha},
  232. [5] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  233. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  234. },
  235. },
  236. [7] = {
  237. base_texture = mod_name.."_open_coach_class1_007.png",
  238. overlays = {
  239. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_007_side_walls.png", alpha = default_wall_alpha},
  240. [2] = {name = S("Upper Stripe"), texture = mod_name.."_overlay_007_upper_stripe.png"},
  241. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_007_class1_window_band.png", alpha = default_wall_alpha},
  242. [4] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_007_middle_stripe.png", alpha = default_wall_alpha},
  243. [5] = {name = S("Lower Stripe"), texture = mod_name.."_overlay_007_lower_stripe.png", alpha = default_wall_alpha},
  244. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  245. },
  246. },
  247. },
  248. ["classic_coaches:open_coach_class2"] = {
  249. [1] = {
  250. base_texture = mod_name.."_open_coach_class2_001.png",
  251. overlays = {
  252. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_001_class2_side_walls.png", alpha = default_wall_alpha},
  253. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_001_stripe.png", alpha = default_wall_alpha},
  254. [3] = {name = S("Stripe Divider"), texture = mod_name.."_overlay_001_stripe_divider.png"},
  255. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  256. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  257. },
  258. },
  259. [2] = {
  260. base_texture = mod_name.."_open_coach_class2_002.png",
  261. overlays = {
  262. [1] = {name = S("Exterior Walls"), texture = mod_name.."_overlay_002_class2_exterior_walls.png", alpha = default_wall_alpha},
  263. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_002_stripe.png", alpha = default_wall_alpha},
  264. [3] = {name = S("Service Stripe"), texture = "classic_coaches_overlay_service_stripe.png"},
  265. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  266. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  267. },
  268. },
  269. [3] = {
  270. base_texture = mod_name.."_open_coach_class2_003.png",
  271. overlays = {
  272. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_003_side_walls.png", alpha = default_wall_alpha},
  273. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_003_stripe.png", alpha = default_wall_alpha},
  274. [3] = {name = S("Stripe Edges"), texture = mod_name.."_overlay_003_stripe_edges.png"},
  275. [4] = {name = S("Seats"), texture = "classic_coaches_overlay_seats.png", alpha = default_seat_alpha},
  276. [5] = {name = S("End Doors"), texture = "classic_coaches_overlay_end_doors.png"},
  277. },
  278. },
  279. [4] = {
  280. base_texture = mod_name.."_open_coach_class2_004.png",
  281. overlays = {
  282. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_004_upper_side_walls.png", alpha = default_wall_alpha},
  283. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_004_lower_side_walls.png", alpha = default_wall_alpha},
  284. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_004_class2_window_band.png", alpha = default_wall_alpha},
  285. [4] = {name = S("Window Band Trim"), texture = mod_name.."_overlay_004_window_band_trim.png"},
  286. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  287. },
  288. },
  289. [5] = {
  290. base_texture = mod_name.."_open_coach_class2_005.png",
  291. overlays = {
  292. [1] = {name = S("Upper Trim"), texture = mod_name.."_overlay_005_upper_trim.png", alpha = default_wall_alpha},
  293. [2] = {name = S("Window Band"), texture = mod_name.."_overlay_005_class2_window_band.png", alpha = default_wall_alpha},
  294. [3] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_005_middle_stripe.png", alpha = default_wall_alpha},
  295. [4] = {name = S("Lower Band"), texture = mod_name.."_overlay_005_lower_band.png", alpha = default_wall_alpha},
  296. [5] = {name = S("Lower Trim"), texture = mod_name.."_overlay_005_lower_trim.png", alpha = default_wall_alpha},
  297. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  298. },
  299. },
  300. [6] = {
  301. base_texture = mod_name.."_open_coach_class2_006.png",
  302. overlays = {
  303. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_006_upper_side_walls.png", alpha = default_wall_alpha},
  304. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_006_lower_side_walls.png", alpha = default_wall_alpha},
  305. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_006_class2_window_band.png", alpha = default_wall_alpha},
  306. [4] = {name = S("Stripe"), texture = mod_name.."_overlay_006_stripe.png", alpha = default_wall_alpha},
  307. [5] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  308. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  309. },
  310. },
  311. [7] = {
  312. base_texture = mod_name.."_open_coach_class2_007.png",
  313. overlays = {
  314. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_007_side_walls.png", alpha = default_wall_alpha},
  315. [2] = {name = S("Upper Stripe"), texture = mod_name.."_overlay_007_upper_stripe.png"},
  316. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_007_class2_window_band.png", alpha = default_wall_alpha},
  317. [4] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_007_middle_stripe.png", alpha = default_wall_alpha},
  318. [5] = {name = S("Lower Stripe"), texture = mod_name.."_overlay_007_lower_stripe.png", alpha = default_wall_alpha},
  319. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  320. },
  321. },
  322. },
  323. }
  324. local predefined_liveries = {
  325. {
  326. name = S("Generic - Ocean View"),
  327. notes = "",
  328. livery_design = {
  329. livery_template_name = S("Generic - Double Bands and Stripe"),
  330. overlays = {
  331. [1] = {id = 1, color = "#000040"}, -- "Upper Trim"
  332. [2] = {id = 2, color = "#87CEEB"}, -- "Window Band"
  333. [3] = {id = 3, color = "#4682B4"}, -- "Middle Stripe"
  334. [4] = {id = 4, color = "#4682B4"}, -- "Lower Band"
  335. [5] = {id = 5, color = "#000040"}, -- "Lower Trim"
  336. -- [6] = {id = 6, color = "#000000"}, -- "Class Number"
  337. },
  338. },
  339. },
  340. {
  341. name = S("Generic - Desert Flyer"),
  342. notes = "",
  343. livery_design = {
  344. livery_template_name = S("Generic - Double Bands and Stripe"),
  345. overlays = {
  346. [1] = {id = 1, color = "#F5DEB3"}, -- "Upper Trim"
  347. [2] = {id = 2, color = "#DAA520"}, -- "Window Band"
  348. [3] = {id = 3, color = "#F5DEB3"}, -- "Middle Stripe"
  349. [4] = {id = 4, color = "#F5DEB3"}, -- "Lower Band"
  350. [5] = {id = 5, color = "#DAA520"}, -- "Lower Trim"
  351. [6] = {id = 6, color = "#F5DEB3"}, -- "Class Number"
  352. },
  353. },
  354. },
  355. {
  356. name = S("Generic - Woodland Safari"),
  357. notes = "",
  358. livery_design = {
  359. livery_template_name = S("Generic - Double Bands and Stripe"),
  360. overlays = {
  361. [1] = {id = 1, color = "#003200"}, -- "Upper Trim"
  362. [2] = {id = 2, color = "#006400"}, -- "Window Band"
  363. [3] = {id = 3, color = "#7EA24E"}, -- "Middle Stripe"
  364. [4] = {id = 4, color = "#006400"}, -- "Lower Band"
  365. [5] = {id = 5, color = "#003200"}, -- "Lower Trim"
  366. [6] = {id = 6, color = "#7EA24E"}, -- "Class Number"
  367. },
  368. },
  369. },
  370. {
  371. name = S("Generic - Artic Dawn"),
  372. notes = "",
  373. livery_design = {
  374. livery_template_name = S("Generic - Window Band and Stripe"),
  375. overlays = {
  376. [1] = {id = 1, color = "#C0C0C0"}, -- "Upper Side Walls"
  377. [2] = {id = 2, color = "#C0C0C0"}, -- "Lower Side Walls"
  378. [3] = {id = 3, color = "#800000"}, -- "Window Band"
  379. [4] = {id = 4, color = "#323232"}, -- "Stripe"
  380. [5] = {id = 5, color = "#C0C0C0"}, -- "Side Doors"
  381. [6] = {id = 6, color = "#C0C0C0"}, -- "Class Number"
  382. },
  383. },
  384. },
  385. {
  386. name = S("Generic - Savanna Zepher"),
  387. notes = "",
  388. livery_design = {
  389. livery_template_name = S("Generic - Window Band and Stripe"),
  390. overlays = {
  391. [1] = {id = 1, color = "#F5DEB3"}, -- "Upper Side Walls"
  392. [2] = {id = 2, color = "#D2B48C"}, -- "Lower Side Walls"
  393. [3] = {id = 3, color = "#DAA520"}, -- "Window Band"
  394. [4] = {id = 4, color = "#006400"}, -- "Stripe"
  395. -- [5] = {id = 5, color = "#000000"}, -- "Side Doors"
  396. -- [6] = {id = 6, color = "#000000"}, -- "Class Number"
  397. },
  398. },
  399. },
  400. {
  401. name = S("Generic - Autum Sunrise"),
  402. notes = "",
  403. livery_design = {
  404. livery_template_name = S("Generic - Window Stripes"),
  405. overlays = {
  406. [1] = {id = 1, color = "#D2691E"}, -- "Side Walls"
  407. [2] = {id = 2, color = "#D2B48C"}, -- "Upper Stripe"
  408. [3] = {id = 3, color = "#4B4B4B"}, -- "Window Band"
  409. [4] = {id = 4, color = "#D2B48C"}, -- "Middle Stripe"
  410. [5] = {id = 5, color = "#DAA520"}, -- "Lower Stripe"
  411. -- [6] = {id = 6, color = "#000000"}, -- "Class Number"
  412. },
  413. },
  414. },}
  415. -- This mod needs to register itself with the livery database in order to be
  416. -- allowed to add livery templates and predefined liveries. It does not need
  417. -- to register itself with the livery designer tool, however, since it is will
  418. -- not be registering any wagons.
  419. advtrains_livery_database.register_mod(mod_name)
  420. -- The following is "boilerplate" code for registering the preceding livery
  421. -- template information with the livery database. It is suitable for basic
  422. -- livery templates such as those defined in this mod. Using some of the more
  423. -- advanced features that are possible with livery templates will likely
  424. -- require modifications to this code. Such advanced features include adding
  425. -- support for models that use multiple texture slots or liveries that require
  426. -- callback function in support of more complex visual features.
  427. -- Register this mod's livery templates with the livery database.
  428. for wagon_type, wagon_livery_templates in pairs(livery_templates) do
  429. for livery_template_id, livery_template in pairs(wagon_livery_templates) do
  430. local livery_template_name = livery_template_names[livery_template_id].name
  431. if livery_template_name then
  432. advtrains_livery_database.add_livery_template(
  433. wagon_type,
  434. livery_template_name,
  435. {livery_template.base_texture},
  436. mod_name,
  437. (livery_template.overlays and #livery_template.overlays) or 0,
  438. livery_template.designer or template_designer,
  439. livery_template.texture_license or texture_license,
  440. livery_template.texture_creator or texture_creator,
  441. livery_template_names[livery_template_id].notes
  442. )
  443. if livery_template.overlays then
  444. for overlay_id, overlay in ipairs(livery_template.overlays) do
  445. advtrains_livery_database.add_livery_template_overlay(
  446. wagon_type,
  447. livery_template_name,
  448. overlay_id,
  449. overlay.name,
  450. 1, -- Texture slot index
  451. overlay.texture,
  452. overlay.alpha
  453. )
  454. end
  455. end
  456. end
  457. end
  458. end
  459. -- Register this mod's predefined wagon liveries with the advtrains_livery_designer tool.
  460. for _, predefined_livery in pairs(predefined_liveries) do
  461. -- Each predefined livery will be defined for each wagon type. This may not be true in the future.
  462. for wagon_type, _ in pairs(livery_templates) do
  463. if wagon_type then
  464. local livery_design = predefined_livery.livery_design
  465. livery_design.wagon_type = wagon_type
  466. advtrains_livery_database.add_predefined_livery(predefined_livery.name, livery_design, mod_name, predefined_livery.notes)
  467. end
  468. end
  469. end