Add RTL level property and print flag

Again, the RTL property controls whether textboxes will be
right-aligned, and that kind of stuff. It can't be font-bound, since
Space Station supports Hebrew characters and we want to be able to
support, say, a Hebrew translation or Hebrew levels in the future
without having to make a dedicated (or duplicated) font for it.
Therefore it's a property of both the language pack as well as custom
levels - like custom levels already had a <font> tag, they now also
have an <rtl> tag that sets this property.

Right now, we'll have to hardcode it so the menu option for the Arabic
font sets the <rtl> property to 1, and all the other options set it to
0. But it's future-proof in that we can later decide to split the
option for Space Station into an LTR option and an RTL option (so both
"english/..." and "עברית" would select Space Station, but one sets the
RTL property to 0 and the other sets it to 1).
This commit is contained in:
Dav999
2024-01-03 20:09:23 +01:00
committed by Misa Elizabeth Kai
parent 37c4f76988
commit 29e2b19698
11 changed files with 83 additions and 20 deletions

View File

@@ -6357,7 +6357,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
text,
true,
cl.ListOfMetaData[i].title_is_gettext ? PR_FONT_INTERFACE : PR_FONT_IDX(
cl.ListOfMetaData[i].level_main_font_idx
cl.ListOfMetaData[i].level_main_font_idx, cl.ListOfMetaData[i].rtl
)
);
}
@@ -6487,7 +6487,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
for (uint8_t i = 0; i < font::font_idx_options_n; i++)
{
uint8_t idx = font::font_idx_options[i];
option(font::get_main_font_display_name(idx), true, PR_FONT_IDX(idx));
option(font::get_main_font_display_name(idx), true, PR_FONT_IDX(idx, false));
if (font::level_font_is_main_idx(idx))
{
option_match = i;
@@ -6586,9 +6586,17 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
for (size_t i = 0; i < loc::languagelist.size(); i++)
{
if (loc::languagelist[i].nativename.empty())
{
option(loc::languagelist[i].code.c_str());
}
else
option(loc::languagelist[i].nativename.c_str(), true, PR_FONT_IDX(loc::languagelist[i].font_idx));
{
option(
loc::languagelist[i].nativename.c_str(),
true,
PR_FONT_IDX(loc::languagelist[i].font_idx, loc::languagelist[i].rtl)
);
}
}
menuyoff = 70-(menuoptions.size()*10);