init.lua 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  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. [8] = {name = S("Generic - Arrows and Rail"), notes = "This livery features stylized arrow heads and a section of train track on the lower half of the wagon's sides"},
  22. [9] = {name = S("Generic - Arrows and Line"), notes = "This livery features decorative arrows and lines on the lower half of the wagon's sides"},
  23. }
  24. local livery_templates = {
  25. ["classic_coaches:corridor_coach_class1"] = {
  26. [1] = {
  27. base_texture = mod_name.."_corridor_coach_class1_001.png",
  28. overlays = {
  29. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_001_class1_side_walls.png", alpha = default_wall_alpha},
  30. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_001_stripe.png", alpha = default_wall_alpha},
  31. [3] = {name = S("Stripe Divider"), texture = mod_name.."_overlay_001_stripe_divider.png"},
  32. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  33. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  34. },
  35. },
  36. [2] = {
  37. base_texture = mod_name.."_corridor_coach_class1_002.png",
  38. overlays = {
  39. [1] = {name = S("Exterior Walls"), texture = mod_name.."_overlay_002_class1_exterior_walls.png", alpha = default_wall_alpha},
  40. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_002_stripe.png", alpha = default_wall_alpha},
  41. [3] = {name = S("Service Stripe"), texture = "classic_coaches_overlay_service_stripe.png"},
  42. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  43. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  44. },
  45. },
  46. [3] = {
  47. base_texture = mod_name.."_corridor_coach_class1_003.png",
  48. overlays = {
  49. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_003_side_walls.png", alpha = default_wall_alpha},
  50. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_003_stripe.png", alpha = default_wall_alpha},
  51. [3] = {name = S("Stripe Edges"), texture = mod_name.."_overlay_003_stripe_edges.png"},
  52. [4] = {name = S("Seats"), texture = "classic_coaches_overlay_seats.png", alpha = default_seat_alpha},
  53. [5] = {name = S("End Doors"), texture = "classic_coaches_overlay_end_doors.png"},
  54. },
  55. },
  56. [4] = {
  57. base_texture = mod_name.."_corridor_coach_class1_004.png",
  58. overlays = {
  59. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_004_upper_side_walls.png", alpha = default_wall_alpha},
  60. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_004_lower_side_walls.png", alpha = default_wall_alpha},
  61. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_004_class1_window_band.png", alpha = default_wall_alpha},
  62. [4] = {name = S("Window Band Trim"), texture = mod_name.."_overlay_004_window_band_trim.png"},
  63. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  64. },
  65. },
  66. [5] = {
  67. base_texture = mod_name.."_corridor_coach_class1_005.png",
  68. overlays = {
  69. [1] = {name = S("Upper Trim"), texture = mod_name.."_overlay_005_upper_trim.png", alpha = default_wall_alpha},
  70. [2] = {name = S("Window Band"), texture = mod_name.."_overlay_005_class1_window_band.png", alpha = default_wall_alpha},
  71. [3] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_005_middle_stripe.png", alpha = default_wall_alpha},
  72. [4] = {name = S("Lower Band"), texture = mod_name.."_overlay_005_lower_band.png", alpha = default_wall_alpha},
  73. [5] = {name = S("Lower Trim"), texture = mod_name.."_overlay_005_lower_trim.png", alpha = default_wall_alpha},
  74. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  75. },
  76. },
  77. [6] = {
  78. base_texture = mod_name.."_corridor_coach_class1_006.png",
  79. overlays = {
  80. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_006_upper_side_walls.png", alpha = default_wall_alpha},
  81. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_006_lower_side_walls.png", alpha = default_wall_alpha},
  82. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_006_class1_window_band.png", alpha = default_wall_alpha},
  83. [4] = {name = S("Stripe"), texture = mod_name.."_overlay_006_stripe.png", alpha = default_wall_alpha},
  84. [5] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  85. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  86. },
  87. },
  88. [7] = {
  89. base_texture = mod_name.."_corridor_coach_class1_007.png",
  90. overlays = {
  91. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_007_side_walls.png", alpha = default_wall_alpha},
  92. [2] = {name = S("Upper Stripe"), texture = mod_name.."_overlay_007_upper_stripe.png"},
  93. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_007_class1_window_band.png", alpha = default_wall_alpha},
  94. [4] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_007_middle_stripe.png", alpha = default_wall_alpha},
  95. [5] = {name = S("Lower Stripe"), texture = mod_name.."_overlay_007_lower_stripe.png", alpha = default_wall_alpha},
  96. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  97. },
  98. },
  99. [8] = {
  100. base_texture = mod_name.."_corridor_coach_class1_008.png",
  101. overlays = {
  102. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_008_side_walls.png", alpha = default_wall_alpha},
  103. [2] = {name = S("Decoration Arrows"), texture = mod_name.."_overlay_008_decoration_arrows.png", alpha = default_wall_alpha},
  104. [3] = {name = S("Track Rails"), texture = mod_name.."_overlay_008_track_rails.png", alpha = default_wall_alpha},
  105. [4] = {name = S("Track Ties"), texture = mod_name.."_overlay_008_track_ties.png", alpha = default_wall_alpha},
  106. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  107. [6] = {name = S("Window Band"), texture = mod_name.."_overlay_008_class1_window_band.png", alpha = default_wall_alpha},
  108. },
  109. },
  110. [9] = {
  111. base_texture = mod_name.."_corridor_coach_class1_009.png",
  112. overlays = {
  113. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_009_class1_side_walls.png", alpha = default_wall_alpha},
  114. [2] = {name = S("Decoration Arrows"), texture = mod_name.."_overlay_009_decoration_arrows.png", alpha = default_wall_alpha},
  115. [3] = {name = S("Decoration Line"), texture = mod_name.."_overlay_009_decoration_line.png", alpha = default_wall_alpha},
  116. [4] = {name = S("Trim"), texture = mod_name.."_overlay_009_trim.png", alpha = default_wall_alpha},
  117. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  118. },
  119. },
  120. },
  121. ["classic_coaches:corridor_coach_class2"] = {
  122. [1] = {
  123. base_texture = mod_name.."_corridor_coach_class2_001.png",
  124. overlays = {
  125. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_001_class2_side_walls.png", alpha = default_wall_alpha},
  126. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_001_stripe.png", alpha = default_wall_alpha},
  127. [3] = {name = S("Stripe Divider"), texture = mod_name.."_overlay_001_stripe_divider.png"},
  128. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  129. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  130. },
  131. },
  132. [2] = {
  133. base_texture = mod_name.."_corridor_coach_class2_002.png",
  134. overlays = {
  135. [1] = {name = S("Exterior Walls"), texture = mod_name.."_overlay_002_class2_exterior_walls.png", alpha = default_wall_alpha},
  136. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_002_stripe.png", alpha = default_wall_alpha},
  137. [3] = {name = S("Service Stripe"), texture = "classic_coaches_overlay_service_stripe.png"},
  138. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  139. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  140. },
  141. },
  142. [3] = {
  143. base_texture = mod_name.."_corridor_coach_class2_003.png",
  144. overlays = {
  145. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_003_side_walls.png", alpha = default_wall_alpha},
  146. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_003_stripe.png", alpha = default_wall_alpha},
  147. [3] = {name = S("Stripe Edges"), texture = mod_name.."_overlay_003_stripe_edges.png"},
  148. [4] = {name = S("Seats"), texture = "classic_coaches_overlay_seats.png", alpha = default_seat_alpha},
  149. [5] = {name = S("End Doors"), texture = "classic_coaches_overlay_end_doors.png"},
  150. },
  151. },
  152. [4] = {
  153. base_texture = mod_name.."_corridor_coach_class2_004.png",
  154. overlays = {
  155. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_004_upper_side_walls.png", alpha = default_wall_alpha},
  156. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_004_lower_side_walls.png", alpha = default_wall_alpha},
  157. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_004_class2_window_band.png", alpha = default_wall_alpha},
  158. [4] = {name = S("Window Band Trim"), texture = mod_name.."_overlay_004_window_band_trim.png"},
  159. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  160. },
  161. },
  162. [5] = {
  163. base_texture = mod_name.."_corridor_coach_class2_005.png",
  164. overlays = {
  165. [1] = {name = S("Upper Trim"), texture = mod_name.."_overlay_005_upper_trim.png", alpha = default_wall_alpha},
  166. [2] = {name = S("Window Band"), texture = mod_name.."_overlay_005_class2_window_band.png", alpha = default_wall_alpha},
  167. [3] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_005_middle_stripe.png", alpha = default_wall_alpha},
  168. [4] = {name = S("Lower Band"), texture = mod_name.."_overlay_005_lower_band.png", alpha = default_wall_alpha},
  169. [5] = {name = S("Lower Trim"), texture = mod_name.."_overlay_005_lower_trim.png", alpha = default_wall_alpha},
  170. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  171. },
  172. },
  173. [6] = {
  174. base_texture = mod_name.."_corridor_coach_class2_006.png",
  175. overlays = {
  176. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_006_upper_side_walls.png", alpha = default_wall_alpha},
  177. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_006_lower_side_walls.png", alpha = default_wall_alpha},
  178. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_006_class2_window_band.png", alpha = default_wall_alpha},
  179. [4] = {name = S("Stripe"), texture = mod_name.."_overlay_006_stripe.png", alpha = default_wall_alpha},
  180. [5] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  181. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  182. },
  183. },
  184. [7] = {
  185. base_texture = mod_name.."_corridor_coach_class2_007.png",
  186. overlays = {
  187. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_007_side_walls.png", alpha = default_wall_alpha},
  188. [2] = {name = S("Upper Stripe"), texture = mod_name.."_overlay_007_upper_stripe.png"},
  189. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_007_class2_window_band.png", alpha = default_wall_alpha},
  190. [4] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_007_middle_stripe.png", alpha = default_wall_alpha},
  191. [5] = {name = S("Lower Stripe"), texture = mod_name.."_overlay_007_lower_stripe.png", alpha = default_wall_alpha},
  192. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  193. },
  194. },
  195. [8] = {
  196. base_texture = mod_name.."_corridor_coach_class2_008.png",
  197. overlays = {
  198. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_008_side_walls.png", alpha = default_wall_alpha},
  199. [2] = {name = S("Decoration Arrows"), texture = mod_name.."_overlay_008_decoration_arrows.png", alpha = default_wall_alpha},
  200. [3] = {name = S("Track Rails"), texture = mod_name.."_overlay_008_track_rails.png", alpha = default_wall_alpha},
  201. [4] = {name = S("Track Ties"), texture = mod_name.."_overlay_008_track_ties.png", alpha = default_wall_alpha},
  202. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  203. [6] = {name = S("Window Band"), texture = mod_name.."_overlay_008_class2_window_band.png", alpha = default_wall_alpha},
  204. },
  205. },
  206. [9] = {
  207. base_texture = mod_name.."_corridor_coach_class2_009.png",
  208. overlays = {
  209. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_009_class2_side_walls.png", alpha = default_wall_alpha},
  210. [2] = {name = S("Decoration Arrows"), texture = mod_name.."_overlay_009_decoration_arrows.png", alpha = default_wall_alpha},
  211. [3] = {name = S("Decoration Line"), texture = mod_name.."_overlay_009_decoration_line.png", alpha = default_wall_alpha},
  212. [4] = {name = S("Trim"), texture = mod_name.."_overlay_009_trim.png", alpha = default_wall_alpha},
  213. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  214. },
  215. },
  216. },
  217. ["classic_coaches:open_coach_class1"] = {
  218. [1] = {
  219. base_texture = mod_name.."_open_coach_class1_001.png",
  220. overlays = {
  221. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_001_class1_side_walls.png", alpha = default_wall_alpha},
  222. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_001_stripe.png", alpha = default_wall_alpha},
  223. [3] = {name = S("Stripe Divider"), texture = mod_name.."_overlay_001_stripe_divider.png"},
  224. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  225. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  226. },
  227. },
  228. [2] = {
  229. base_texture = mod_name.."_open_coach_class1_002.png",
  230. overlays = {
  231. [1] = {name = S("Exterior Walls"), texture = mod_name.."_overlay_002_class1_exterior_walls.png", alpha = default_wall_alpha},
  232. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_002_stripe.png", alpha = default_wall_alpha},
  233. [3] = {name = S("Service Stripe"), texture = "classic_coaches_overlay_service_stripe.png"},
  234. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  235. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  236. },
  237. },
  238. [3] = {
  239. base_texture = mod_name.."_open_coach_class1_003.png",
  240. overlays = {
  241. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_003_side_walls.png", alpha = default_wall_alpha},
  242. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_003_stripe.png", alpha = default_wall_alpha},
  243. [3] = {name = S("Stripe Edges"), texture = mod_name.."_overlay_003_stripe_edges.png"},
  244. [4] = {name = S("Seats"), texture = "classic_coaches_overlay_seats.png", alpha = default_seat_alpha},
  245. [5] = {name = S("End Doors"), texture = "classic_coaches_overlay_end_doors.png"},
  246. },
  247. },
  248. [4] = {
  249. base_texture = mod_name.."_open_coach_class1_004.png",
  250. overlays = {
  251. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_004_upper_side_walls.png", alpha = default_wall_alpha},
  252. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_004_lower_side_walls.png", alpha = default_wall_alpha},
  253. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_004_class1_window_band.png", alpha = default_wall_alpha},
  254. [4] = {name = S("Window Band Trim"), texture = mod_name.."_overlay_004_window_band_trim.png"},
  255. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  256. },
  257. },
  258. [5] = {
  259. base_texture = mod_name.."_open_coach_class1_005.png",
  260. overlays = {
  261. [1] = {name = S("Upper Trim"), texture = mod_name.."_overlay_005_upper_trim.png", alpha = default_wall_alpha},
  262. [2] = {name = S("Window Band"), texture = mod_name.."_overlay_005_class1_window_band.png", alpha = default_wall_alpha},
  263. [3] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_005_middle_stripe.png", alpha = default_wall_alpha},
  264. [4] = {name = S("Lower Band"), texture = mod_name.."_overlay_005_lower_band.png", alpha = default_wall_alpha},
  265. [5] = {name = S("Lower Trim"), texture = mod_name.."_overlay_005_lower_trim.png", alpha = default_wall_alpha},
  266. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  267. },
  268. },
  269. [6] = {
  270. base_texture = mod_name.."_open_coach_class1_006.png",
  271. overlays = {
  272. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_006_upper_side_walls.png", alpha = default_wall_alpha},
  273. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_006_lower_side_walls.png", alpha = default_wall_alpha},
  274. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_006_class1_window_band.png", alpha = default_wall_alpha},
  275. [4] = {name = S("Stripe"), texture = mod_name.."_overlay_006_stripe.png", alpha = default_wall_alpha},
  276. [5] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  277. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  278. },
  279. },
  280. [7] = {
  281. base_texture = mod_name.."_open_coach_class1_007.png",
  282. overlays = {
  283. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_007_side_walls.png", alpha = default_wall_alpha},
  284. [2] = {name = S("Upper Stripe"), texture = mod_name.."_overlay_007_upper_stripe.png"},
  285. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_007_class1_window_band.png", alpha = default_wall_alpha},
  286. [4] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_007_middle_stripe.png", alpha = default_wall_alpha},
  287. [5] = {name = S("Lower Stripe"), texture = mod_name.."_overlay_007_lower_stripe.png", alpha = default_wall_alpha},
  288. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  289. },
  290. },
  291. [8] = {
  292. base_texture = mod_name.."_open_coach_class1_008.png",
  293. overlays = {
  294. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_008_side_walls.png", alpha = default_wall_alpha},
  295. [2] = {name = S("Decoration Arrows"), texture = mod_name.."_overlay_008_decoration_arrows.png", alpha = default_wall_alpha},
  296. [3] = {name = S("Track Rails"), texture = mod_name.."_overlay_008_track_rails.png", alpha = default_wall_alpha},
  297. [4] = {name = S("Track Ties"), texture = mod_name.."_overlay_008_track_ties.png", alpha = default_wall_alpha},
  298. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  299. [6] = {name = S("Window Band"), texture = mod_name.."_overlay_008_class1_window_band.png", alpha = default_wall_alpha},
  300. },
  301. },
  302. [9] = {
  303. base_texture = mod_name.."_open_coach_class1_009.png",
  304. overlays = {
  305. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_009_class1_side_walls.png", alpha = default_wall_alpha},
  306. [2] = {name = S("Decoration Arrows"), texture = mod_name.."_overlay_009_decoration_arrows.png", alpha = default_wall_alpha},
  307. [3] = {name = S("Decoration Line"), texture = mod_name.."_overlay_009_decoration_line.png", alpha = default_wall_alpha},
  308. [4] = {name = S("Trim"), texture = mod_name.."_overlay_009_trim.png", alpha = default_wall_alpha},
  309. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class1_class_number.png"},
  310. },
  311. },
  312. },
  313. ["classic_coaches:open_coach_class2"] = {
  314. [1] = {
  315. base_texture = mod_name.."_open_coach_class2_001.png",
  316. overlays = {
  317. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_001_class2_side_walls.png", alpha = default_wall_alpha},
  318. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_001_stripe.png", alpha = default_wall_alpha},
  319. [3] = {name = S("Stripe Divider"), texture = mod_name.."_overlay_001_stripe_divider.png"},
  320. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  321. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  322. },
  323. },
  324. [2] = {
  325. base_texture = mod_name.."_open_coach_class2_002.png",
  326. overlays = {
  327. [1] = {name = S("Exterior Walls"), texture = mod_name.."_overlay_002_class2_exterior_walls.png", alpha = default_wall_alpha},
  328. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_002_stripe.png", alpha = default_wall_alpha},
  329. [3] = {name = S("Service Stripe"), texture = "classic_coaches_overlay_service_stripe.png"},
  330. [4] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  331. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  332. },
  333. },
  334. [3] = {
  335. base_texture = mod_name.."_open_coach_class2_003.png",
  336. overlays = {
  337. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_003_side_walls.png", alpha = default_wall_alpha},
  338. [2] = {name = S("Stripe"), texture = mod_name.."_overlay_003_stripe.png", alpha = default_wall_alpha},
  339. [3] = {name = S("Stripe Edges"), texture = mod_name.."_overlay_003_stripe_edges.png"},
  340. [4] = {name = S("Seats"), texture = "classic_coaches_overlay_seats.png", alpha = default_seat_alpha},
  341. [5] = {name = S("End Doors"), texture = "classic_coaches_overlay_end_doors.png"},
  342. },
  343. },
  344. [4] = {
  345. base_texture = mod_name.."_open_coach_class2_004.png",
  346. overlays = {
  347. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_004_upper_side_walls.png", alpha = default_wall_alpha},
  348. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_004_lower_side_walls.png", alpha = default_wall_alpha},
  349. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_004_class2_window_band.png", alpha = default_wall_alpha},
  350. [4] = {name = S("Window Band Trim"), texture = mod_name.."_overlay_004_window_band_trim.png"},
  351. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  352. },
  353. },
  354. [5] = {
  355. base_texture = mod_name.."_open_coach_class2_005.png",
  356. overlays = {
  357. [1] = {name = S("Upper Trim"), texture = mod_name.."_overlay_005_upper_trim.png", alpha = default_wall_alpha},
  358. [2] = {name = S("Window Band"), texture = mod_name.."_overlay_005_class2_window_band.png", alpha = default_wall_alpha},
  359. [3] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_005_middle_stripe.png", alpha = default_wall_alpha},
  360. [4] = {name = S("Lower Band"), texture = mod_name.."_overlay_005_lower_band.png", alpha = default_wall_alpha},
  361. [5] = {name = S("Lower Trim"), texture = mod_name.."_overlay_005_lower_trim.png", alpha = default_wall_alpha},
  362. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  363. },
  364. },
  365. [6] = {
  366. base_texture = mod_name.."_open_coach_class2_006.png",
  367. overlays = {
  368. [1] = {name = S("Upper Side Walls"), texture = mod_name.."_overlay_006_upper_side_walls.png", alpha = default_wall_alpha},
  369. [2] = {name = S("Lower Side Walls"), texture = mod_name.."_overlay_006_lower_side_walls.png", alpha = default_wall_alpha},
  370. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_006_class2_window_band.png", alpha = default_wall_alpha},
  371. [4] = {name = S("Stripe"), texture = mod_name.."_overlay_006_stripe.png", alpha = default_wall_alpha},
  372. [5] = {name = S("Side Doors"), texture = "classic_coaches_overlay_side_doors.png", alpha = default_wall_alpha},
  373. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  374. },
  375. },
  376. [7] = {
  377. base_texture = mod_name.."_open_coach_class2_007.png",
  378. overlays = {
  379. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_007_side_walls.png", alpha = default_wall_alpha},
  380. [2] = {name = S("Upper Stripe"), texture = mod_name.."_overlay_007_upper_stripe.png"},
  381. [3] = {name = S("Window Band"), texture = mod_name.."_overlay_007_class2_window_band.png", alpha = default_wall_alpha},
  382. [4] = {name = S("Middle Stripe"), texture = mod_name.."_overlay_007_middle_stripe.png", alpha = default_wall_alpha},
  383. [5] = {name = S("Lower Stripe"), texture = mod_name.."_overlay_007_lower_stripe.png", alpha = default_wall_alpha},
  384. [6] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  385. },
  386. },
  387. [8] = {
  388. base_texture = mod_name.."_open_coach_class2_008.png",
  389. overlays = {
  390. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_008_side_walls.png", alpha = default_wall_alpha},
  391. [2] = {name = S("Decoration Arrows"), texture = mod_name.."_overlay_008_decoration_arrows.png", alpha = default_wall_alpha},
  392. [3] = {name = S("Track Rails"), texture = mod_name.."_overlay_008_track_rails.png", alpha = default_wall_alpha},
  393. [4] = {name = S("Track Ties"), texture = mod_name.."_overlay_008_track_ties.png", alpha = default_wall_alpha},
  394. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  395. [6] = {name = S("Window Band"), texture = mod_name.."_overlay_008_class2_window_band.png", alpha = default_wall_alpha},
  396. },
  397. },
  398. [9] = {
  399. base_texture = mod_name.."_open_coach_class2_009.png",
  400. overlays = {
  401. [1] = {name = S("Side Walls"), texture = mod_name.."_overlay_009_class2_side_walls.png", alpha = default_wall_alpha},
  402. [2] = {name = S("Decoration Arrows"), texture = mod_name.."_overlay_009_decoration_arrows.png", alpha = default_wall_alpha},
  403. [3] = {name = S("Decoration Line"), texture = mod_name.."_overlay_009_decoration_line.png", alpha = default_wall_alpha},
  404. [4] = {name = S("Trim"), texture = mod_name.."_overlay_009_trim.png", alpha = default_wall_alpha},
  405. [5] = {name = S("Class Number"), texture = "classic_coaches_overlay_class2_class_number.png"},
  406. },
  407. },
  408. },
  409. }
  410. local predefined_liveries = {
  411. {
  412. name = S("Generic - Ocean View"),
  413. notes = "",
  414. livery_design = {
  415. livery_template_name = S("Generic - Double Bands and Stripe"),
  416. overlays = {
  417. [1] = {id = 1, color = "#000040"}, -- "Upper Trim"
  418. [2] = {id = 2, color = "#87CEEB"}, -- "Window Band"
  419. [3] = {id = 3, color = "#4682B4"}, -- "Middle Stripe"
  420. [4] = {id = 4, color = "#4682B4"}, -- "Lower Band"
  421. [5] = {id = 5, color = "#000040"}, -- "Lower Trim"
  422. -- [6] = {id = 6, color = "#000000"}, -- "Class Number"
  423. },
  424. },
  425. },
  426. {
  427. name = S("Generic - Desert Flyer"),
  428. notes = "",
  429. livery_design = {
  430. livery_template_name = S("Generic - Double Bands and Stripe"),
  431. overlays = {
  432. [1] = {id = 1, color = "#F5DEB3"}, -- "Upper Trim"
  433. [2] = {id = 2, color = "#DAA520"}, -- "Window Band"
  434. [3] = {id = 3, color = "#F5DEB3"}, -- "Middle Stripe"
  435. [4] = {id = 4, color = "#F5DEB3"}, -- "Lower Band"
  436. [5] = {id = 5, color = "#DAA520"}, -- "Lower Trim"
  437. [6] = {id = 6, color = "#F5DEB3"}, -- "Class Number"
  438. },
  439. },
  440. },
  441. {
  442. name = S("Generic - Woodland Safari"),
  443. notes = "",
  444. livery_design = {
  445. livery_template_name = S("Generic - Double Bands and Stripe"),
  446. overlays = {
  447. [1] = {id = 1, color = "#003200"}, -- "Upper Trim"
  448. [2] = {id = 2, color = "#006400"}, -- "Window Band"
  449. [3] = {id = 3, color = "#7EA24E"}, -- "Middle Stripe"
  450. [4] = {id = 4, color = "#006400"}, -- "Lower Band"
  451. [5] = {id = 5, color = "#003200"}, -- "Lower Trim"
  452. [6] = {id = 6, color = "#7EA24E"}, -- "Class Number"
  453. },
  454. },
  455. },
  456. {
  457. name = S("Generic - Artic Dawn"),
  458. notes = "",
  459. livery_design = {
  460. livery_template_name = S("Generic - Window Band and Stripe"),
  461. overlays = {
  462. [1] = {id = 1, color = "#C0C0C0"}, -- "Upper Side Walls"
  463. [2] = {id = 2, color = "#C0C0C0"}, -- "Lower Side Walls"
  464. [3] = {id = 3, color = "#800000"}, -- "Window Band"
  465. [4] = {id = 4, color = "#323232"}, -- "Stripe"
  466. [5] = {id = 5, color = "#C0C0C0"}, -- "Side Doors"
  467. [6] = {id = 6, color = "#C0C0C0"}, -- "Class Number"
  468. },
  469. },
  470. },
  471. {
  472. name = S("Generic - Savanna Zepher"),
  473. notes = "",
  474. livery_design = {
  475. livery_template_name = S("Generic - Window Band and Stripe"),
  476. overlays = {
  477. [1] = {id = 1, color = "#F5DEB3"}, -- "Upper Side Walls"
  478. [2] = {id = 2, color = "#D2B48C"}, -- "Lower Side Walls"
  479. [3] = {id = 3, color = "#DAA520"}, -- "Window Band"
  480. [4] = {id = 4, color = "#006400"}, -- "Stripe"
  481. -- [5] = {id = 5, color = "#000000"}, -- "Side Doors"
  482. -- [6] = {id = 6, color = "#000000"}, -- "Class Number"
  483. },
  484. },
  485. },
  486. {
  487. name = S("Generic - Autum Sunrise"),
  488. notes = "",
  489. livery_design = {
  490. livery_template_name = S("Generic - Window Stripes"),
  491. overlays = {
  492. [1] = {id = 1, color = "#D2691E"}, -- "Side Walls"
  493. [2] = {id = 2, color = "#D2B48C"}, -- "Upper Stripe"
  494. [3] = {id = 3, color = "#4B4B4B"}, -- "Window Band"
  495. [4] = {id = 4, color = "#D2B48C"}, -- "Middle Stripe"
  496. [5] = {id = 5, color = "#DAA520"}, -- "Lower Stripe"
  497. -- [6] = {id = 6, color = "#000000"}, -- "Class Number"
  498. },
  499. },
  500. },
  501. {
  502. name = S("Generic - Frontier Sunbeam"),
  503. notes = "",
  504. livery_design = {
  505. livery_template_name = S("Generic - Arrows and Rail"),
  506. overlays = {
  507. [1] = {id = 1, color = "#FFD700"}, -- "Side Walls"
  508. [2] = {id = 2, color = "#006400"}, -- "Decoration Arrows"
  509. [3] = {id = 3, color = "#006400"}, -- "Track Rails"
  510. [4] = {id = 4, color = "#FFD700"}, -- "Track Ties"
  511. -- [5] = {id = 5, color = "#000000"}, -- "Class Number"
  512. -- [6] = {id = 6, color = "#000000"}, -- "Window Band"
  513. },
  514. },
  515. },
  516. {
  517. name = S("Generic - Midnight Rambler"),
  518. notes = "",
  519. livery_design = {
  520. livery_template_name = S("Generic - Arrows and Rail"),
  521. overlays = {
  522. [1] = {id = 1, color = "#141414"}, -- "Side Walls"
  523. [2] = {id = 2, color = "#FFFFF0"}, -- "Decoration Arrows"
  524. [3] = {id = 3, color = "#C0C0C0"}, -- "Track Rails"
  525. [4] = {id = 4, color = "#141414"}, -- "Track Ties"
  526. [5] = {id = 5, color = "#FFFFF0"}, -- "Class Number"
  527. [6] = {id = 6, color = "#141414"}, -- "Window Band"
  528. },
  529. },
  530. },
  531. {
  532. name = S("Generic - Dawn to Dusk"),
  533. notes = "",
  534. livery_design = {
  535. livery_template_name = S("Generic - Arrows and Line"),
  536. overlays = {
  537. [1] = {id = 1, color = "#FF8C00"}, -- "Side Walls"
  538. [2] = {id = 2, color = "#FF8C00"}, -- "Decoration Arrows"
  539. [3] = {id = 3, color = "#F5DEB3"}, -- "Decoration Line"
  540. [4] = {id = 4, color = "#F5DEB3"}, -- "Trim"
  541. [5] = {id = 5, color = "#FFFFF0"}, -- "Class Number"
  542. },
  543. },
  544. },
  545. }
  546. -- This mod needs to register itself with the livery database in order to be
  547. -- allowed to add livery templates and predefined liveries. It does not need
  548. -- to register itself with the livery designer tool, however, since it is will
  549. -- not be registering any wagons.
  550. advtrains_livery_database.register_mod(mod_name)
  551. -- The following is "boilerplate" code for registering the preceding livery
  552. -- template information with the livery database. It is suitable for basic
  553. -- livery templates such as those defined in this mod. Using some of the more
  554. -- advanced features that are possible with livery templates will likely
  555. -- require modifications to this code. Such advanced features include adding
  556. -- support for models that use multiple texture slots or liveries that require
  557. -- callback function in support of more complex visual features.
  558. -- Register this mod's livery templates with the livery database.
  559. for wagon_type, wagon_livery_templates in pairs(livery_templates) do
  560. for livery_template_id, livery_template in pairs(wagon_livery_templates) do
  561. local livery_template_name = livery_template_names[livery_template_id].name
  562. if livery_template_name then
  563. advtrains_livery_database.add_livery_template(
  564. wagon_type,
  565. livery_template_name,
  566. {livery_template.base_texture},
  567. mod_name,
  568. (livery_template.overlays and #livery_template.overlays) or 0,
  569. livery_template.designer or template_designer,
  570. livery_template.texture_license or texture_license,
  571. livery_template.texture_creator or texture_creator,
  572. livery_template_names[livery_template_id].notes
  573. )
  574. if livery_template.overlays then
  575. for overlay_id, overlay in ipairs(livery_template.overlays) do
  576. advtrains_livery_database.add_livery_template_overlay(
  577. wagon_type,
  578. livery_template_name,
  579. overlay_id,
  580. overlay.name,
  581. 1, -- Texture slot index
  582. overlay.texture,
  583. overlay.alpha
  584. )
  585. end
  586. end
  587. end
  588. end
  589. end
  590. -- Register this mod's predefined wagon liveries with the advtrains_livery_designer tool.
  591. for _, predefined_livery in pairs(predefined_liveries) do
  592. -- Each predefined livery will be defined for each wagon type. This may not be true in the future.
  593. for wagon_type, _ in pairs(livery_templates) do
  594. if wagon_type then
  595. local livery_design = predefined_livery.livery_design
  596. livery_design.wagon_type = wagon_type
  597. advtrains_livery_database.add_predefined_livery(predefined_livery.name, livery_design, mod_name, predefined_livery.notes)
  598. end
  599. end
  600. end