Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: Support for station variable 6B #320

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nml/actions/action2var_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,14 @@ def platform_info_fix_var(var, info):
'nearby_tile_height' : {'var': 0x67, 'start': 16, 'size': 8, 'param_function': signed_tile_offset},
'nearby_tile_class' : {'var': 0x67, 'start': 24, 'size': 4, 'param_function': signed_tile_offset},
'nearby_tile_is_station' : {'var': 0x68, 'start': 0, 'size': 32, 'param_function': signed_tile_offset, 'value_function': lambda var, info: nmlop.CMP_NEQ(var, 0xFFFFFFFF)},
'nearby_tile_station_id' : {'var': 0x68, 'start': 0, 'size': 8, 'param_function': signed_tile_offset},
'nearby_tile_original_gfx' : {'var': 0x68, 'start': 8, 'size': 2, 'param_function': signed_tile_offset, 'value_function': value_equals(0)},
'nearby_tile_same_grf' : {'var': 0x68, 'start': 8, 'size': 2, 'param_function': signed_tile_offset, 'value_function': value_equals(1)},
'nearby_tile_other_grf' : {'var': 0x68, 'start': 8, 'size': 2, 'param_function': signed_tile_offset, 'value_function': value_equals(2)},
'nearby_tile_same_station' : {'var': 0x68, 'start': 10, 'size': 1, 'param_function': signed_tile_offset},
'nearby_tile_perpendicular' : {'var': 0x68, 'start': 11, 'size': 1, 'param_function': signed_tile_offset},
'nearby_tile_tile_type' : {'var': 0x68, 'start': 11, 'size': 3, 'param_function': signed_tile_offset},
'nearby_tile_grfid' : {'var': 0x6A, 'start': 0, 'size': 32, 'param_function': signed_tile_offset},
'nearby_tile_station_id' : {'var': 0x6B, 'start': 0, 'size': 16, 'param_function': signed_tile_offset},
# 'var' will be set in the value_function, depending on parameter
'platform_length' : {'var': 0x00, 'start': 16, 'size': 4, 'param_function': platform_info_param, 'value_function': platform_info_fix_var},
'platform_count' : {'var': 0x00, 'start': 20, 'size': 4, 'param_function': platform_info_param, 'value_function': platform_info_fix_var},
Expand Down Expand Up @@ -823,7 +823,6 @@ def industry_cargotype(name, args, pos, info):
'nearby_tile_class' : {'var': 0x67, 'start': 24, 'size': 4, 'param_function': signed_tile_offset},
'nearby_tile_road_stop_info' : {'var': 0x68, 'start': 0, 'size': 32, 'param_function': signed_tile_offset},
'nearby_tile_is_road_stop' : {'var': 0x68, 'start': 0, 'size': 32, 'param_function': signed_tile_offset, 'value_function': lambda var, info: nmlop.CMP_NEQ(var, 0xFFFFFFFF)},
'nearby_tile_road_stop_id' : {'var': 0x68, 'start': 0, 'size': 8, 'param_function': signed_tile_offset},
'nearby_tile_same_grf' : {'var': 0x68, 'start': 8, 'size': 2, 'param_function': signed_tile_offset, 'value_function': value_equals(0)},
'nearby_tile_other_grf' : {'var': 0x68, 'start': 8, 'size': 2, 'param_function': signed_tile_offset, 'value_function': value_equals(1)},
'nearby_tile_original_gfx' : {'var': 0x68, 'start': 8, 'size': 2, 'param_function': signed_tile_offset, 'value_function': value_equals(2)},
Expand All @@ -834,6 +833,7 @@ def industry_cargotype(name, args, pos, info):
'nearby_tile_stop_type' : {'var': 0x68, 'start': 16, 'size': 4, 'param_function': signed_tile_offset},
'nearby_tile_same_stop_type' : {'var': 0x68, 'start': 20, 'size': 1, 'param_function': signed_tile_offset},
'nearby_tile_grfid' : {'var': 0x6A, 'start': 0, 'size': 32, 'param_function': signed_tile_offset},
'nearby_tile_road_stop_id' : {'var': 0x6B, 'start': 0, 'size': 16, 'param_function': signed_tile_offset},
}

class VarAct2Scope:
Expand Down
2 changes: 1 addition & 1 deletion regression/040_station.nml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ item (FEAT_STATIONS, basic_station, 255) {
}
graphics {
foundations: 0;
prepare_layout: [STORE_TEMP(0,0), STORE_TEMP(1,1)];
prepare_layout: [STORE_TEMP(0,nearby_tile_station_id(-1,2)), STORE_TEMP(1,1)];
purchase_prepare_layout: STORE_TEMP(3,3);
sprite_layouts: [
station_sprite_layout_0,
Expand Down
Binary file modified regression/expected/040_station.grf
Binary file not shown.
4 changes: 2 additions & 2 deletions regression/expected/040_station.nfo
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
\wx8000 // Return computed value

// Name: Station Layout@prepare - Id FF
17 * 34 02 04 FC 89
17 * 35 02 04 FC 89
1A 20 \dx00000000
\2sto 1A 20 \dx00000000
\2sto 6B 2F 20 \dx0000FFFF
\2r 1A 20 \dx00000001
\2sto 1A 00 \dx00000001
\b0
Expand Down