CMenueWidget: add overloaded version of addIntroItems()

Allows additional usage of strings as text parameter.
This commit is contained in:
2019-03-29 23:29:31 +01:00
parent 08e8fd88ad
commit 06e968df78
2 changed files with 11 additions and 4 deletions

View File

@@ -1491,12 +1491,12 @@ void CMenuWidget::paintItems()
}
/*adds the typical menu intro with optional subhead, separator, back or cancel button and separatorline to menu*/
void CMenuWidget::addIntroItems(neutrino_locale_t subhead_text, neutrino_locale_t section_text, int buttontype, bool brief_hint)
void CMenuWidget::addIntroItems(const std::string& s_subhead_text, neutrino_locale_t section_text, int buttontype, bool brief_hint)
{
brief_hints = brief_hint;
if (subhead_text != NONEXISTANT_LOCALE)
addItem(new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, subhead_text));
if (!s_subhead_text.empty())
addItem(new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, s_subhead_text));
addItem(GenericMenuSeparator);
@@ -1519,6 +1519,12 @@ void CMenuWidget::addIntroItems(neutrino_locale_t subhead_text, neutrino_locale_
addItem(GenericMenuSeparatorLine);
}
void CMenuWidget::addIntroItems(neutrino_locale_t l_subhead_text, neutrino_locale_t section_text, int buttontype, bool brief_hint)
{
std::string str = l_subhead_text == NONEXISTANT_LOCALE ? "" : g_Locale->getText(l_subhead_text);
addIntroItems(str, section_text, buttontype, brief_hint);
}
void CMenuWidget::saveScreen()
{
if(!savescreen)