diff --git a/gfx/freight/RM_TPO.png b/gfx/freight/RM_TPO.png index b73f75ff..5386735c 100644 Binary files a/gfx/freight/RM_TPO.png and b/gfx/freight/RM_TPO.png differ diff --git a/src/trains/_spriteset/Diesel_Sprites/47.pnml b/src/trains/_spriteset/Diesel_Sprites/47.pnml new file mode 100644 index 00000000..89581b21 --- /dev/null +++ b/src/trains/_spriteset/Diesel_Sprites/47.pnml @@ -0,0 +1,97 @@ +spriteset(spriteset_BR47_Purchase, "gfx/BR47_BR57.png") { + template_purchase(0, 0) +} + +spriteset(spriteset_BR47_BRGreen, "gfx/BR47_BR57.png") { + template_train32px(0, 463) +} + +spriteset(spriteset_BR47_BRBlue, "gfx/BR47_BR57.png") { + template_train32px(0, 13) +} + +spriteset(spriteset_BR47_Porterbrook, "gfx/BR47_BR57.png") { + template_train32px(0, 38) +} + +spriteset(spriteset_BR47_EWS, "gfx/BR47_BR57.png") { + template_train32px(0, 63) +} + +spriteset(spriteset_BR47_BRLLogo, "gfx/BR47_BR57.png") { + template_train32px(0, 113) +} + +spriteset(spriteset_BR47_BRLLogoAlt, "gfx/BR47_BR57.png") { + template_train32px(0, 88) +} + +spriteset(spriteset_BR47_Anglia, "gfx/BR47_BR57.png") { + template_train32px(0, 138) +} + +spriteset(spriteset_BR47_Intercity, "gfx/BR47_BR57.png") { + template_train32px(0, 163) +} + +spriteset(spriteset_BR47_WCRC, "gfx/BR47_BR57.png") { + template_train32px(0, 238) +} + +spriteset(spriteset_BR47_GWR, "gfx/BR47_BR57.png") { + template_train32px(0, 313) +} + +spriteset(spriteset_BR47_Virgin, "gfx/BR47_BR57.png") { + template_train32px(0, 513) +} + +spriteset(spriteset_BR47_Colas, "gfx/BR47_BR57.png") { + template_train32px(0, 538) +} + +spriteset(spriteset_BR47_One, "gfx/BR47_BR57.png") { + template_train32px(0, 263) +} + +spriteset(spriteset_BR47_Freightliner, "gfx/BR47_BR57.png") { + template_train32px(0, 213) +} + +// This switch called when displaying as this locomotive +// WARNING: If editing this, also edit PushPull.pnml in the Spritesets folder +switch(FEAT_TRAINS,SELF, sw_BR47,cargo_subtype){ + 0: spriteset_BR47_BRGreen; + 1: spriteset_BR47_BRBlue; + 2: spriteset_BR47_Porterbrook; + 3: spriteset_BR47_EWS; + 4: spriteset_BR47_BRLLogo; + 5: spriteset_BR47_BRLLogoAlt; + 6: spriteset_BR47_Anglia; + 7: spriteset_BR47_Intercity; + 8: spriteset_BR47_WCRC; + 9: spriteset_BR47_GWR; + 10: spriteset_BR47_Virgin; + 11: spriteset_BR47_Colas; + 12: spriteset_BR47_One; + 13: spriteset_BR47_Freightliner; + return CB_RESULT_NO_TEXT; +} + +switch(FEAT_TRAINS,SELF,sw_BR47_cargo_subtype_text,cargo_subtype){ + 0: return string(str_BRGreen); + 1: return string(str_BRBlue); + 2: return string(str_Purple); + 3: return string(str_EWSCentre); + 4: return string(str_BRLLogo); + 5: return string(str_BRLLogoAlt); + 6: return string(str_Anglia); + 7: return string(str_Intercity); + 8: return string(str_WCRC); + 9: return string(str_GWRGreen); + 10: return string(str_Virgin); + 11: return string(str_ColasRail); + 12: return string(str_One); + 13: return string(str_Freightliner); + return CB_RESULT_NO_TEXT; +} \ No newline at end of file diff --git a/src/trains/_spriteset/PushPull.pnml b/src/trains/_spriteset/PushPull.pnml index 65855214..5f7973c6 100644 --- a/src/trains/_spriteset/PushPull.pnml +++ b/src/trains/_spriteset/PushPull.pnml @@ -30,6 +30,30 @@ switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_LocomotiveAsMk4DVT, [STORE_TEMP(num_vehs spriteset_BR91_IntercitySwallowr; } +// Not a mirror for once, as RMTPO PCV only has one livery +switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_LocomotiveAsRMTPO, [STORE_TEMP(num_vehs_in_consist - 1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xF2]]){ + spriteset_RMTPO_PCVr; +} + +// Mirror of BR47 +switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DMSOasBR47,cargo_subtype){ + 0: spriteset_BR47_BRGreen; + 1: spriteset_BR47_BRBlue; + 2: spriteset_BR47_Porterbrook; + 3: spriteset_BR47_EWS; + 4: spriteset_BR47_BRLLogo; + 5: spriteset_BR47_BRLLogoAlt; + 6: spriteset_BR47_Anglia; + 7: spriteset_BR47_Intercity; + 8: spriteset_BR47_WCRC; + 9: spriteset_BR47_GWR; + 10: spriteset_BR47_Virgin; + 11: spriteset_BR47_Colas; + 12: spriteset_BR47_One; + 13: spriteset_BR47_Freightliner; + return CB_RESULT_NO_TEXT; +} + // Mirror of BR67 switch(FEAT_TRAINS, PARENT, sw_PUSHPULL_DVTasBR67,cargo_subtype){ 0: spriteset_BR67_EWS; diff --git a/src/trains/_spriteset/Rolling Stock_Sprites/Mk4DVT.pnml b/src/trains/_spriteset/Rolling Stock_Sprites/Mk4DVT.pnml index 6d4fab36..8f7c0542 100644 --- a/src/trains/_spriteset/Rolling Stock_Sprites/Mk4DVT.pnml +++ b/src/trains/_spriteset/Rolling Stock_Sprites/Mk4DVT.pnml @@ -63,7 +63,7 @@ switch(FEAT_TRAINS, PARENT, sw_BRMk4DVT_PushPUll, [STORE_TEMP(0 - position_in_ar sw_BRMk4DVT; // No compatible locomotive found, show normal sprites } -switch(FEAT_TRAINS,PARENT,sw_BRMk4DVT_CheckPosition, position_in_articulated_veh_from_end){ +switch(FEAT_TRAINS, SELF,sw_BRMk4DVT_CheckPosition, position_in_articulated_veh_from_end){ 0: sw_BRMk4DVT_PushPUll; // Attempt push pull sw_BRMk4DVT; // We aren't at the back of theconsist, show normal sprites } diff --git a/src/trains/_spriteset/Rolling Stock_Sprites/RM_TPO.pnml b/src/trains/_spriteset/Rolling Stock_Sprites/RM_TPO.pnml new file mode 100644 index 00000000..0ddc68a8 --- /dev/null +++ b/src/trains/_spriteset/Rolling Stock_Sprites/RM_TPO.pnml @@ -0,0 +1,34 @@ +spriteset(spriteset_RMTPO_Purchase, "gfx/freight/RM_TPO.png") { + template_purchase(0, 0) +} + +spriteset(spriteset_RMTPO_NoDoors, "gfx/freight/RM_TPO.png") { + template_train28px(0, 13) +} +spriteset(spriteset_RMTPO_2Door, "gfx/freight/RM_TPO.png") { + template_train28px(0, 36) +} +spriteset(spriteset_RMTPO_3Door, "gfx/freight/RM_TPO.png") { + template_train28px(0, 59) +} + +spriteset(spriteset_RMTPO_PCV, "gfx/freight/RM_TPO.png") { + template_train28px(0, 82) +} + +spriteset(spriteset_RMTPO_PCVr, "gfx/freight/RM_TPO.png") { + template_train28px(0, 105) +} + +random_switch(FEAT_TRAINS, SELF, sw_RMTPO_Random) +{ + 1: spriteset_RMTPO_NoDoors; + 1: spriteset_RMTPO_2Door; + 1: spriteset_RMTPO_3Door; +} + +switch(FEAT_TRAINS, SELF, sw_RMTPO, position_in_consist_from_end) +{ + 0: spriteset_RMTPO_PCV; + sw_RMTPO_Random; +} \ No newline at end of file diff --git a/src/trains/diesel/BR047.pnml b/src/trains/diesel/BR047.pnml index 07c9658b..e50fe309 100644 --- a/src/trains/diesel/BR047.pnml +++ b/src/trains/diesel/BR047.pnml @@ -1,97 +1,17 @@ -spriteset(spriteset_BR47_Purchase, "gfx/BR47_BR57.png") { - template_purchase(0, 0) +// If the rear of this consist is a compatible Driving Trailer, call that vehicles's remote sprite call switch +switch(FEAT_TRAINS, PARENT, sw_BR47_PushPUll, [STORE_TEMP(num_vehs_in_consist - 1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) { + //483: sw_PUSHPULL_LocomotiveAsRMTPO; // Royal Mail TPO, uncommen this line when RMTPO has been changed to length 8 + sw_BR47; // No compatible locomotive found, show normal sprites } -spriteset(spriteset_BR47_BRGreen, "gfx/BR47_BR57.png") { - template_train32px(0, 463) +switch(FEAT_TRAINS, SELF,sw_BR47_CheckPosition, position_in_consist){ + 0: sw_BR47_PushPUll; // Attempt push pull + sw_BR47; // We aren't at the front of the consist, show normal sprites } -spriteset(spriteset_BR47_BRBlue, "gfx/BR47_BR57.png") { - template_train32px(0, 13) -} - -spriteset(spriteset_BR47_Porterbrook, "gfx/BR47_BR57.png") { - template_train32px(0, 38) -} - -spriteset(spriteset_BR47_EWS, "gfx/BR47_BR57.png") { - template_train32px(0, 63) -} - -spriteset(spriteset_BR47_BRLLogo, "gfx/BR47_BR57.png") { - template_train32px(0, 113) -} - -spriteset(spriteset_BR47_BRLLogoAlt, "gfx/BR47_BR57.png") { - template_train32px(0, 88) -} - -spriteset(spriteset_BR47_Anglia, "gfx/BR47_BR57.png") { - template_train32px(0, 138) -} - -spriteset(spriteset_BR47_Intercity, "gfx/BR47_BR57.png") { - template_train32px(0, 163) -} - -spriteset(spriteset_BR47_WCRC, "gfx/BR47_BR57.png") { - template_train32px(0, 238) -} - -spriteset(spriteset_BR47_GWR, "gfx/BR47_BR57.png") { - template_train32px(0, 313) -} - -spriteset(spriteset_BR47_Virgin, "gfx/BR47_BR57.png") { - template_train32px(0, 513) -} - -spriteset(spriteset_BR47_Colas, "gfx/BR47_BR57.png") { - template_train32px(0, 538) -} - -spriteset(spriteset_BR47_One, "gfx/BR47_BR57.png") { - template_train32px(0, 263) -} - -spriteset(spriteset_BR47_Freightliner, "gfx/BR47_BR57.png") { - template_train32px(0, 213) -} - -switch(FEAT_TRAINS,SELF, sw_BR47,cargo_subtype){ - 0: spriteset_BR47_BRGreen; - 1: spriteset_BR47_BRBlue; - 2: spriteset_BR47_Porterbrook; - 3: spriteset_BR47_EWS; - 4: spriteset_BR47_BRLLogo; - 5: spriteset_BR47_BRLLogoAlt; - 6: spriteset_BR47_Anglia; - 7: spriteset_BR47_Intercity; - 8: spriteset_BR47_WCRC; - 9: spriteset_BR47_GWR; - 10: spriteset_BR47_Virgin; - 11: spriteset_BR47_Colas; - 12: spriteset_BR47_One; - 13: spriteset_BR47_Freightliner; - return CB_RESULT_NO_TEXT; -} - -switch(FEAT_TRAINS,SELF,sw_BR47_cargo_subtype_text,cargo_subtype){ - 0: return string(str_BRGreen); - 1: return string(str_BRBlue); - 2: return string(str_Purple); - 3: return string(str_EWSCentre); - 4: return string(str_BRLLogo); - 5: return string(str_BRLLogoAlt); - 6: return string(str_Anglia); - 7: return string(str_Intercity); - 8: return string(str_WCRC); - 9: return string(str_GWRGreen); - 10: return string(str_Virgin); - 11: return string(str_ColasRail); - 12: return string(str_One); - 13: return string(str_Freightliner); - return CB_RESULT_NO_TEXT; +switch(FEAT_TRAINS,PARENT,sw_BR47_Sprites ,vehicle_is_reversed){ + 0: sw_BR47; // We're heading foward, show normal sprites + 1: sw_BR47_CheckPosition; // Attempt push pull } item (FEAT_TRAINS, item_BR47, 440) { @@ -133,7 +53,7 @@ item (FEAT_TRAINS, item_BR47, 440) { can_attach_wagon: CB_RESULT_ATTACH_ALLOW; cargo_capacity: return 0; cargo_subtype_text: sw_BR47_cargo_subtype_text; - default: sw_BR47; + default: sw_BR47_Sprites; purchase: spriteset_BR47_Purchase; colour_mapping: return PALETTE_CC_FIRST; create_effect: diesel_create_visual_effect; diff --git a/src/trains/rollingstock/RM_TPO.pnml b/src/trains/rollingstock/RM_TPO.pnml index 0d4d85b1..220bc79c 100644 --- a/src/trains/rollingstock/RM_TPO.pnml +++ b/src/trains/rollingstock/RM_TPO.pnml @@ -1,35 +1,19 @@ -spriteset(spriteset_RMTPO_Purchase, "gfx/freight/RM_TPO.png") { - template_purchase(0, 0) +// If the front of this consist is a compatible locomotive, call that locomotive's remote sprite call switch +switch(FEAT_TRAINS, PARENT, sw_RMTPO_PushPUll, [STORE_TEMP(0 - position_in_articulated_veh, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]) { + 440: sw_PUSHPULL_DMSOasBR47; // Class 47 + sw_RMTPO; // No compatible locomotive found, show normal sprites } -spriteset(spriteset_RMTPO_NoDoors, "gfx/freight/RM_TPO.png") { - template_train28px(0, 13) -} -spriteset(spriteset_RMTPO_2Door, "gfx/freight/RM_TPO.png") { - template_train28px(0, 36) -} -spriteset(spriteset_RMTPO_3Door, "gfx/freight/RM_TPO.png") { - template_train28px(0, 59) -} - -spriteset(spriteset_RMTPO_PCV, "gfx/freight/RM_TPO.png") { - template_train28px(0, 82) +switch(FEAT_TRAINS, PARENT, sw_RMTPO_CheckDirection,vehicle_is_reversed){ + 0: sw_RMTPO; // We're heading foward, show normal sprites + 1: sw_RMTPO_PushPUll; // Attempt push pull (skipping check position for now for testing) } -random_switch(FEAT_TRAINS, SELF, sw_RMTPO_Random) -{ - 1: spriteset_RMTPO_NoDoors; - 1: spriteset_RMTPO_2Door; - 1: spriteset_RMTPO_3Door; +switch(FEAT_TRAINS, SELF, sw_RMTPO_Sprites, position_in_consist_from_end){ + 0: sw_RMTPO_CheckDirection; // Attempt push pull + sw_RMTPO_Random; // We aren't at the back of theconsist, show normal sprites } -switch(FEAT_TRAINS, SELF, sw_RMTPO, position_in_consist_from_end) -{ - 0: spriteset_RMTPO_PCV; - sw_RMTPO_Random; -} - - item (FEAT_TRAINS, item_RMTPO, 483) { property { name: string(STR_NAME_RMTPO); @@ -54,7 +38,7 @@ item (FEAT_TRAINS, item_RMTPO, 483) { graphics { additional_text: return(string(str_purchase_coach,string(str_RMTPO_liveries))); can_attach_wagon: CB_RESULT_ATTACH_ALLOW; - default: sw_RMTPO; + default: sw_RMTPO; // Switch to sw_RMTPO_Sprites when length changed to 8 for push pull purchase: spriteset_RMTPO_Purchase; colour_mapping: return PALETTE_CC_FIRST; cargo_capacity: return(50);