mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Add fence and banner info to tile inspector
This commit also renamed a flag, and corrected the use of one. The flags in question are WALL_SCENERY_BANNER, WALL_SCENERY_2_FLAG4, and WALL_SCENERY_2_FLAG5.
This commit is contained in:
@@ -4287,6 +4287,9 @@ STR_5975 :Slope:
|
||||
STR_5976 :Flat
|
||||
STR_5977 :Right side up
|
||||
STR_5978 :Left side up
|
||||
STR_5979 :{WINDOW_COLOUR_2}Fence type: {BLACK}{COMMA16}
|
||||
STR_5980 :{WINDOW_COLOUR_2}Banner text: {BLACK}{STRINGID}
|
||||
STR_5981 :{WINDOW_COLOUR_2}Not a banner
|
||||
|
||||
#############
|
||||
# Scenarios #
|
||||
|
||||
@@ -3627,6 +3627,9 @@ enum {
|
||||
STR_TILE_INSPECTOR_FENCE_FLAT = 5976,
|
||||
STR_TILE_INSPECTOR_FENCE_SLOPED_LEFT = 5977,
|
||||
STR_TILE_INSPECTOR_FENCE_SLOPED_RIGHT = 5978,
|
||||
STR_TILE_INSPECTOR_FENCE_TYPE = 5979,
|
||||
STR_TILE_INSPECTOR_FENCE_BANNER_TEXT = 5980,
|
||||
STR_TILE_INSPECTOR_FENCE_BANNER_NONE = 5981,
|
||||
|
||||
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
|
||||
STR_COUNT = 32768
|
||||
|
||||
@@ -62,7 +62,7 @@ static void fence_paint_door(uint32 imageId,
|
||||
imageId = (imageId & 0x7FFFF) | dword_141F710;
|
||||
}
|
||||
|
||||
if (sceneryEntry->wall.flags & WALL_SCENERY_FLAG4) {
|
||||
if (sceneryEntry->wall.flags & WALL_SCENERY_BANNER) {
|
||||
paint_struct * ps;
|
||||
|
||||
ps = sub_98197C(imageId, (sint8) offset.x, (sint8) offset.y, boundsR1.x, boundsR1.y, (sint8) boundsR1.z, offset.z, boundsR1_.x, boundsR1_.y, boundsR1_.z, get_current_rotation());
|
||||
@@ -137,7 +137,7 @@ void fence_paint(uint8 direction, int height, rct_map_element * map_element)
|
||||
rct_scenery_entry * sceneryEntry = get_wall_entry(map_element->properties.fence.type);
|
||||
uint32 frameNum = 0;
|
||||
|
||||
if (sceneryEntry->wall.flags2 & WALL_SCENERY_2_FLAG_5) {
|
||||
if (sceneryEntry->wall.flags2 & WALL_SCENERY_2_FLAG5) {
|
||||
frameNum = (gCurrentTicks & 7) * 2;
|
||||
}
|
||||
|
||||
@@ -279,11 +279,11 @@ void fence_paint(uint8 direction, int height, rct_map_element * map_element)
|
||||
}
|
||||
|
||||
if (sceneryEntry->wall.flags & WALL_SCENERY_FLAG2) {
|
||||
if (sceneryEntry->wall.flags & WALL_SCENERY_FLAG4) {
|
||||
if (sceneryEntry->wall.flags & WALL_SCENERY_BANNER) {
|
||||
imageOffset += 12;
|
||||
}
|
||||
} else {
|
||||
if (sceneryEntry->wall.flags & WALL_SCENERY_FLAG4) {
|
||||
if (sceneryEntry->wall.flags & WALL_SCENERY_BANNER) {
|
||||
imageOffset += 6;
|
||||
}
|
||||
}
|
||||
@@ -302,7 +302,7 @@ void fence_paint(uint8 direction, int height, rct_map_element * map_element)
|
||||
imageOffset = 1;
|
||||
}
|
||||
|
||||
if (sceneryEntry->wall.flags & WALL_SCENERY_FLAG4) {
|
||||
if (sceneryEntry->wall.flags & WALL_SCENERY_BANNER) {
|
||||
imageOffset += 6;
|
||||
}
|
||||
|
||||
|
||||
@@ -10858,7 +10858,7 @@ static bool peep_find_ride_to_look_at(rct_peep *peep, uint8 edge, uint8 *rideToV
|
||||
do {
|
||||
if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_FENCE) continue;
|
||||
if (map_element_get_direction(mapElement) != edge) continue;
|
||||
if (get_wall_entry(mapElement->properties.fence.type)->wall.flags2 & WALL_SCENERY_FLAG4) continue;
|
||||
if (get_wall_entry(mapElement->properties.fence.type)->wall.flags2 & WALL_SCENERY_2_FLAG4) continue;
|
||||
if (peep->next_z + 4 <= mapElement->base_height) continue;
|
||||
if (peep->next_z + 1 >= mapElement->clearance_height) continue;
|
||||
|
||||
@@ -10879,7 +10879,7 @@ static bool peep_find_ride_to_look_at(rct_peep *peep, uint8 edge, uint8 *rideToV
|
||||
do {
|
||||
if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_FENCE) continue;
|
||||
if ((map_element_get_direction(mapElement) ^ 0x2) != edge) continue;
|
||||
if (get_wall_entry(mapElement->properties.fence.type)->wall.flags2 & WALL_SCENERY_FLAG4) continue;
|
||||
if (get_wall_entry(mapElement->properties.fence.type)->wall.flags2 & WALL_SCENERY_2_FLAG4) continue;
|
||||
// TODO: Check whether this shouldn't be <=, as the other loops use. If so, also extract as loop A.
|
||||
if (peep->next_z + 4 >= mapElement->base_height) continue;
|
||||
if (peep->next_z + 1 >= mapElement->clearance_height) continue;
|
||||
@@ -10926,7 +10926,7 @@ static bool peep_find_ride_to_look_at(rct_peep *peep, uint8 edge, uint8 *rideToV
|
||||
if (map_element_get_type(mapElement) == MAP_ELEMENT_TYPE_PATH) continue;
|
||||
|
||||
if (map_element_get_type(mapElement) == MAP_ELEMENT_TYPE_FENCE) {
|
||||
if (get_wall_entry(mapElement->properties.fence.type)->wall.flags2 & WALL_SCENERY_FLAG4) {
|
||||
if (get_wall_entry(mapElement->properties.fence.type)->wall.flags2 & WALL_SCENERY_2_FLAG4) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -10949,7 +10949,7 @@ static bool peep_find_ride_to_look_at(rct_peep *peep, uint8 edge, uint8 *rideToV
|
||||
do {
|
||||
if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_FENCE) continue;
|
||||
if ((map_element_get_direction(mapElement) ^ 0x2) != edge) continue;
|
||||
if (get_wall_entry(mapElement->properties.fence.type)->wall.flags2 & WALL_SCENERY_FLAG4) continue;
|
||||
if (get_wall_entry(mapElement->properties.fence.type)->wall.flags2 & WALL_SCENERY_2_FLAG4) continue;
|
||||
if (peep->next_z + 6 <= mapElement->base_height) continue;
|
||||
if (peep->next_z >= mapElement->clearance_height) continue;
|
||||
|
||||
@@ -10995,7 +10995,7 @@ static bool peep_find_ride_to_look_at(rct_peep *peep, uint8 edge, uint8 *rideToV
|
||||
if (map_element_get_type(mapElement) == MAP_ELEMENT_TYPE_PATH) continue;
|
||||
|
||||
if (map_element_get_type(mapElement) == MAP_ELEMENT_TYPE_FENCE) {
|
||||
if (get_wall_entry(mapElement->properties.fence.type)->wall.flags2 & WALL_SCENERY_FLAG4) {
|
||||
if (get_wall_entry(mapElement->properties.fence.type)->wall.flags2 & WALL_SCENERY_2_FLAG4) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -11017,7 +11017,7 @@ static bool peep_find_ride_to_look_at(rct_peep *peep, uint8 edge, uint8 *rideToV
|
||||
do {
|
||||
if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_FENCE) continue;
|
||||
if ((map_element_get_direction(mapElement) ^ 0x2) != edge) continue;
|
||||
if (get_wall_entry(mapElement->properties.fence.type)->wall.flags2 & WALL_SCENERY_FLAG4) continue;
|
||||
if (get_wall_entry(mapElement->properties.fence.type)->wall.flags2 & WALL_SCENERY_2_FLAG4) continue;
|
||||
if (peep->next_z + 8 <= mapElement->base_height) continue;
|
||||
if (peep->next_z >= mapElement->clearance_height) continue;
|
||||
|
||||
|
||||
@@ -358,7 +358,7 @@ static rct_widget windowTileInspectorWidgetsEntrance[] = {
|
||||
#define FEN_GBPB PADDING_BOTTOM // Fence group box properties bottom
|
||||
#define FEN_GBPT (FEN_GBPB + 16 + 2 * 21) // Fence group box properties top
|
||||
#define FEN_GBDB (FEN_GBPT + GROUPBOX_PADDING) // Fence group box info bottom
|
||||
#define FEN_GBDT (FEN_GBDB + 20 + 0 * 11) // Fence group box info top
|
||||
#define FEN_GBDT (FEN_GBDB + 20 + 2 * 11) // Fence group box info top
|
||||
static rct_widget windowTileInspectorWidgetsFence[] = {
|
||||
MAIN_TILE_INSPECTOR_WIDGETS,
|
||||
{ WWT_SPINNER, 1, GBS(WH - FEN_GBPT, 1, 0), STR_NONE, STR_NONE }, // WIDX_FENCE_SPINNER_HEIGHT
|
||||
@@ -1841,6 +1841,7 @@ static void window_tile_inspector_paint(rct_window *w, rct_drawpixelinfo *dpi) {
|
||||
}
|
||||
|
||||
case PAGE_ENTRANCE: {
|
||||
// Details
|
||||
// Entrance type
|
||||
rct_string_id entranceType = entranceTypeStringIds[mapElement->properties.entrance.type];
|
||||
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_ENTRANCE_TYPE, &entranceType, 12, x, y);
|
||||
@@ -1878,6 +1879,20 @@ static void window_tile_inspector_paint(rct_window *w, rct_drawpixelinfo *dpi) {
|
||||
}
|
||||
|
||||
case PAGE_FENCE: {
|
||||
// Details
|
||||
// Type
|
||||
sint16 fenceType = mapElement->properties.fence.type;
|
||||
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_FENCE_TYPE, &fenceType, 12, x, y);
|
||||
|
||||
// Banner text
|
||||
rct_wall_scenery_entry fenceEntry = get_wall_entry(fenceType)->wall;
|
||||
if (fenceEntry.flags & WALL_SCENERY_BANNER) {
|
||||
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_FENCE_BANNER_TEXT, &gBanners[mapElement->properties.fence.item[0]].string_idx, 12, x, y + 11);
|
||||
}
|
||||
else {
|
||||
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_FENCE_BANNER_NONE, NULL, 12, x, y + 11);
|
||||
}
|
||||
|
||||
// Properties
|
||||
// Raise / lower label
|
||||
y = w->y + w->widgets[WIDX_FENCE_SPINNER_HEIGHT].top;
|
||||
|
||||
@@ -125,7 +125,7 @@ typedef enum {
|
||||
WALL_SCENERY_FLAG1 = (1 << 0), // 0x1
|
||||
WALL_SCENERY_FLAG2 = (1 << 1), // 0x2
|
||||
WALL_SCENERY_CANT_BUILD_ON_SLOPE = (1 << 2), // 0x4
|
||||
WALL_SCENERY_FLAG4 = (1 << 3), // 0x8 // Probably indicates translucency
|
||||
WALL_SCENERY_BANNER = (1 << 3), // 0x8 // Probably indicates translucency
|
||||
WALL_SCENERY_IS_DOOR = (1 << 4), // 0x10
|
||||
WALL_SCENERY_FLAG6 = (1 << 5), // 0x20
|
||||
WALL_SCENERY_HAS_SECONDARY_COLOUR = (1 << 6), // 0x40
|
||||
@@ -133,7 +133,8 @@ typedef enum {
|
||||
} WALL_SCENERY_FLAGS;
|
||||
|
||||
typedef enum {
|
||||
WALL_SCENERY_2_FLAG_5 = (1 << 4), // 0x10
|
||||
WALL_SCENERY_2_FLAG4 = (1 << 3), // 0x8
|
||||
WALL_SCENERY_2_FLAG5 = (1 << 4), // 0x10
|
||||
} WALL_SCENERY_2_FLAGS;
|
||||
|
||||
typedef struct rct_path_bit_scenery_entry {
|
||||
|
||||
Reference in New Issue
Block a user