Skip to content

Commit

Permalink
Class 20 sprites flip depending on position, added Railfreight Grey l…
Browse files Browse the repository at this point in the history
…ivery, coded current liveries
  • Loading branch information
audigex committed Aug 22, 2024
1 parent 1d8ce4d commit 4f65f37
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 5 deletions.
Binary file modified gfx/Diesel/20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions lang/english.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,7 @@ str_Biffa : (Biffa)
str_BlackpoolTransport : (Blackpool Transport)
str_BoltonCorporation : (BoltonCorporation)
str_BP : (BP)
str_BR2ToneGrey : (BR - 2 Tone Grey)
str_BRBlack : (BR - Black)
str_BRBlue : (BR - Blue)
str_BRBlueAlt : (BR - Blue, Alternate)
Expand Down Expand Up @@ -1574,6 +1575,7 @@ str_BRMaroon : (BR - Maroon)
str_BROchre : (BR - Golden Ochre)
str_BRPrototype : (BR - Prototype)
str_BRProvincial : (BR - Provincial)
str_BRRailfreightGrey : (BR - Railfreight Grey)
str_BRResearch : (BR - Research Department)
str_BRRefurb : (BR - Refurbished)
str_BRTransitionalRed : (BR - TransitionalRed)
Expand Down
14 changes: 12 additions & 2 deletions src/templates_trains.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ template template_train8px(x,y){
[ x+71, y, 10, 13, -5, -11] //nw
}


template template_train12px(x,y){
//left_x, upper_y, width, height, offset_x, offset_y
[ x, y, 8, 15, -3, -12] //n
Expand All @@ -52,7 +51,7 @@ template template_train16px(x,y){
[ x+99, y, 14, 15, -5, -11] //nw
}

template template_train20px(x,y){ // Clone to 4view when changed
template template_train20px(x,y){
//left_x, upper_y, width, height, offset_x, offset_y
[ x, y, 8, 19, -3, -13] // n
[ x+9, y, 16, 16, -7, -12] //ne
Expand All @@ -63,6 +62,17 @@ template template_train20px(x,y){ // Clone to 4view when changed
[ x+91, y, 21, 13, -15, -9] //w
[ x+113, y, 16, 16, -5, -11] //nw
}
template template_train20px_reversed(x,y){
//left_x, upper_y, width, height, offset_x, offset_y
[ x+65, y, 8, 19, -3, -13] //s as n
[ x+74, y, 16, 16, -7, -12] //sw as ne
[ x+91, y, 21, 13, -8, -9] //w as e
[ x+113, y, 16, 16, 0, -8] //nw as se (might be -1 -8 with the class 20 sprite NW being wrong?)
[ x, y, 8, 19, -3, -13] // n as s
[ x+9, y, 16, 16, -13, -9] //ne as sw
[ x+26, y, 21, 13, -15, -9] //e as w
[ x+48, y, 16, 16, -5, -11] //se as nw
}

template template_train24px(x,y){
//left_x, upper_y, width, height, offset_x, offset_y
Expand Down
68 changes: 65 additions & 3 deletions src/trains/diesel_loco/20.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,75 @@ spriteset(spriteset_BR20_Purchase, "gfx/Diesel/20.png") {
spriteset(spriteset_BR20_BRBlue, "gfx/Diesel/20.png") {
template_train20px(0, 13)
}
spriteset(spriteset_BR20_reversed_BRBlue, "gfx/Diesel/20.png") {
template_train20px_reversed(0, 13)
}

spriteset(spriteset_BR20_GBRf, "gfx/Diesel/20.png") {
template_train20px(0, 39)
}
spriteset(spriteset_BR20_reversed_GBRf, "gfx/Diesel/20.png") {
template_train20px_reversed(0, 39)
}

spriteset(spriteset_BR20_GBRf2Tone, "gfx/Diesel/20.png") {
template_train20px(0, 65)
}
spriteset(spriteset_BR20_reversed_GBRf2Tone, "gfx/Diesel/20.png") {
template_train20px_reversed(0, 65)
}

spriteset(spriteset_BR20_BR2Tone, "gfx/Diesel/20.png") {
template_train20px(0, 91)
}
spriteset(spriteset_BR20_reversed_BR2Tone, "gfx/Diesel/20.png") {
template_train20px_reversed(0, 91)
}

spriteset(spriteset_BR20_EWS, "gfx/Diesel/20.png") {
template_train20px(0, 117)
}
spriteset(spriteset_BR20_reversed_EWS, "gfx/Diesel/20.png") {
template_train20px_reversed(0, 117)
}

spriteset(spriteset_BR20_BRRailfreightGrey, "gfx/Diesel/20.png") {
template_train20px(0, 143)
}
spriteset(spriteset_BR20_reversed_BRRailfreightGrey, "gfx/Diesel/20.png") {
template_train20px_reversed(0, 143)
}

switch(FEAT_TRAINS,SELF, sw_BR20_normal,cargo_subtype){
0: spriteset_BR20_BRRailfreightGrey;
1: spriteset_BR20_BRBlue;
2: spriteset_BR20_GBRf;
3: spriteset_BR20_GBRf2Tone;
4: spriteset_BR20_BR2Tone;
5: spriteset_BR20_EWS;
}
switch(FEAT_TRAINS,SELF, sw_BR20_reversed,cargo_subtype){
0: spriteset_BR20_reversed_BRRailfreightGrey;
1: spriteset_BR20_reversed_BRBlue;
2: spriteset_BR20_reversed_GBRf;
3: spriteset_BR20_reversed_GBRf2Tone;
4: spriteset_BR20_reversed_BR2Tone;
5: spriteset_BR20_reversed_EWS;
}

switch(FEAT_TRAINS,SELF, sw_BR20,cargo_subtype){
0: spriteset_BR20_BRBlue;
// Automatically flip second vehicle
switch(FEAT_TRAINS,SELF, sw_BR20, position_in_consist % 2){
0: sw_BR20_reversed;
sw_BR20_normal;
}

switch(FEAT_TRAINS,SELF,sw_BR20_cargo_subtype_text,cargo_subtype){
0: return string(str_BRBlue);
0: return string(str_BRRailfreightGrey);
1: return string(str_BRBlue);
2: return string(str_GBRf);
3: return string(str_GBRf2ToneGrey);
4: return string(str_BR2ToneGrey);
5: return string(str_EWSRed);
return CB_RESULT_NO_TEXT;
}

Expand Down

0 comments on commit 4f65f37

Please sign in to comment.