Update banner formatting code/strings

Changes some things to use STR_BANNER_TEXT_FORMAT and removes
instances of " - - " attached to other strings in the
localization files.

This can be used in the future to show the messages on
a sign or banner via a tooltip without having to
duplicate those messages without " - - ".
This commit is contained in:
Xkeeper 2019-01-31 14:27:38 -08:00 committed by Aaron van Geffen
parent 8ac6c9e9de
commit c6a4316bd4
4 changed files with 47 additions and 37 deletions

View File

@ -551,8 +551,8 @@ STR_1167 :Can't raise water level here...
STR_1168 :Options
STR_1169 :(None)
STR_1170 :{STRING}
STR_1171 :{RED}Closed - -
STR_1172 :{YELLOW}{STRINGID} - -
STR_1171 :{RED}Closed
STR_1172 :{YELLOW}{STRINGID}
STR_1173 :{SMALLFONT}{BLACK}Build footpaths and queue lines
STR_1174 :Banner sign in the way
STR_1175 :Can't build this on sloped footpath
@ -1108,7 +1108,7 @@ STR_1726 :Land not for sale!
STR_1727 :Construction rights not for sale!
STR_1728 :Can't buy construction rights here...
STR_1729 :Land not owned by park!
STR_1730 :{RED}Closed - -
STR_1730 :{RED}Closed
STR_1731 :{WHITE}{STRINGID} - -
STR_1732 :Build
STR_1733 :Mode
@ -2237,7 +2237,7 @@ STR_2977 :Staff member name
STR_2978 :Enter new name for this member of staff:
STR_2979 :Can't name staff member...
STR_2980 :Too many banners in game
STR_2981 :{RED}No entry - -
STR_2981 :{RED}No entry
STR_2982 :Banner text
STR_2983 :Enter new text for this banner:
STR_2984 :Can't set new text for banner...

View File

@ -95,19 +95,23 @@ void banner_paint(paint_session* session, uint8_t direction, int32_t height, con
set_format_arg(0, uint32_t, 0);
set_format_arg(4, uint32_t, 0);
rct_string_id string_id = STR_NO_ENTRY;
if (!(gBanners[tile_element->AsBanner()->GetIndex()].flags & BANNER_FLAG_NO_ENTRY))
if (gBanners[tile_element->AsBanner()->GetIndex()].flags & BANNER_FLAG_NO_ENTRY)
{
set_format_arg(0, rct_string_id, gBanners[tile_element->AsBanner()->GetIndex()].string_idx);
string_id = STR_BANNER_TEXT_FORMAT;
}
if (gConfigGeneral.upper_case_banners)
{
format_string_to_upper(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), string_id, gCommonFormatArgs);
set_format_arg(0, rct_string_id, STR_NO_ENTRY);
}
else
{
format_string(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), string_id, gCommonFormatArgs);
set_format_arg(0, rct_string_id, gBanners[tile_element->AsBanner()->GetIndex()].string_idx);
}
if (gConfigGeneral.upper_case_banners)
{
format_string_to_upper(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_BANNER_TEXT_FORMAT, gCommonFormatArgs);
}
else
{
format_string(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_BANNER_TEXT_FORMAT, gCommonFormatArgs);
}
gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;
@ -116,6 +120,6 @@ void banner_paint(paint_session* session, uint8_t direction, int32_t height, con
uint16_t scroll = (gCurrentTicks / 2) % string_width;
sub_98199C(
session, scrolling_text_setup(session, string_id, scroll, scrollingMode), 0, 0, 1, 1, 0x15, height + 22,
session, scrolling_text_setup(session, STR_BANNER_TEXT_FORMAT, scroll, scrollingMode), 0, 0, 1, 1, 0x15, height + 22,
boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ);
}

View File

@ -158,27 +158,28 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction,
if (!is_exit && !(tile_element->IsGhost()) && tile_element->AsEntrance()->GetRideIndex() != RIDE_ID_NULL
&& stationObj->ScrollingMode != SCROLLING_MODE_NONE)
{
set_format_arg(0, uint32_t, 0);
set_format_arg(0, rct_string_id, STR_RIDE_ENTRANCE_NAME);
set_format_arg(4, uint32_t, 0);
rct_string_id string_id = STR_RIDE_ENTRANCE_CLOSED;
if (ride->status == RIDE_STATUS_OPEN && !(ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN))
{
set_format_arg(0, rct_string_id, ride->name);
set_format_arg(2, uint32_t, ride->name_arguments);
string_id = STR_RIDE_ENTRANCE_NAME;
set_format_arg(2, rct_string_id, STR_RIDE_ENTRANCE_NAME);
set_format_arg(4, rct_string_id, ride->name);
set_format_arg(6, uint32_t, ride->name_arguments);
}
else
{
set_format_arg(2, rct_string_id, STR_RIDE_ENTRANCE_CLOSED);
}
utf8 entrance_string[256];
if (gConfigGeneral.upper_case_banners)
{
format_string_to_upper(entrance_string, sizeof(entrance_string), string_id, gCommonFormatArgs);
format_string_to_upper(entrance_string, sizeof(entrance_string), STR_BANNER_TEXT_FORMAT, gCommonFormatArgs);
}
else
{
format_string(entrance_string, sizeof(entrance_string), string_id, gCommonFormatArgs);
format_string(entrance_string, sizeof(entrance_string), STR_BANNER_TEXT_FORMAT, gCommonFormatArgs);
}
gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;
@ -187,7 +188,7 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction,
uint16_t scroll = (gCurrentTicks / 2) % string_width;
sub_98199C(
session, scrolling_text_setup(session, string_id, scroll, stationObj->ScrollingMode), 0, 0, 0x1C, 0x1C, 0x33,
session, scrolling_text_setup(session, STR_BANNER_TEXT_FORMAT, scroll, stationObj->ScrollingMode), 0, 0, 0x1C, 0x1C, 0x33,
height + stationObj->Height, 2, 2, height + stationObj->Height);
}
@ -264,7 +265,6 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32
break;
{
rct_string_id park_text_id = STR_BANNER_TEXT_CLOSED;
set_format_arg(0, uint32_t, 0);
set_format_arg(4, uint32_t, 0);
@ -272,18 +272,21 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32
{
set_format_arg(0, rct_string_id, gParkName);
set_format_arg(2, uint32_t, gParkNameArgs);
park_text_id = STR_BANNER_TEXT_FORMAT;
}
else
{
set_format_arg(0, rct_string_id, STR_BANNER_TEXT_CLOSED);
set_format_arg(2, uint32_t, 0);
}
utf8 park_name[256];
if (gConfigGeneral.upper_case_banners)
{
format_string_to_upper(park_name, sizeof(park_name), park_text_id, gCommonFormatArgs);
format_string_to_upper(park_name, sizeof(park_name), STR_BANNER_TEXT_FORMAT, gCommonFormatArgs);
}
else
{
format_string(park_name, sizeof(park_name), park_text_id, gCommonFormatArgs);
format_string(park_name, sizeof(park_name), STR_BANNER_TEXT_FORMAT, gCommonFormatArgs);
}
gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;
@ -294,7 +297,7 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32
if (entrance->scrolling_mode == SCROLLING_MODE_NONE)
break;
int32_t stsetup = scrolling_text_setup(session, park_text_id, scroll, entrance->scrolling_mode + direction / 2);
int32_t stsetup = scrolling_text_setup(session, STR_BANNER_TEXT_FORMAT, scroll, entrance->scrolling_mode + direction / 2);
int32_t text_height = height + entrance->text_height;
sub_98199C(session, stsetup, 0, 0, 0x1C, 0x1C, 0x2F, text_height, 2, 2, text_height);
}

View File

@ -451,21 +451,24 @@ static void sub_6A4101(
set_format_arg(4, uint32_t, 0);
Ride* ride = get_ride(tile_element->AsPath()->GetRideIndex());
rct_string_id string_id = STR_RIDE_ENTRANCE_CLOSED;
if (ride->status == RIDE_STATUS_OPEN && !(ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN))
{
set_format_arg(0, rct_string_id, ride->name);
set_format_arg(2, uint32_t, ride->name_arguments);
string_id = STR_RIDE_ENTRANCE_NAME;
set_format_arg(0, rct_string_id, STR_RIDE_ENTRANCE_NAME);
set_format_arg(2, rct_string_id, ride->name);
set_format_arg(4, uint32_t, ride->name_arguments);
}
else
{
set_format_arg(0, rct_string_id, STR_RIDE_ENTRANCE_CLOSED);
}
if (gConfigGeneral.upper_case_banners)
{
format_string_to_upper(
gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), string_id, gCommonFormatArgs);
gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_BANNER_TEXT_FORMAT, gCommonFormatArgs);
}
else
{
format_string(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), string_id, gCommonFormatArgs);
format_string(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_BANNER_TEXT_FORMAT, gCommonFormatArgs);
}
gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;
@ -474,7 +477,7 @@ static void sub_6A4101(
uint16_t scroll = (gCurrentTicks / 2) % string_width;
sub_98199C(
session, scrolling_text_setup(session, string_id, scroll, scrollingMode), 0, 0, 1, 1, 21, height + 7,
session, scrolling_text_setup(session, STR_BANNER_TEXT_FORMAT, scroll, scrollingMode), 0, 0, 1, 1, 21, height + 7,
boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z);
}