mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-18 09:52:44 +01:00
Codechange: Use only raw strings in drop down lists. (#13667)
Strings with parameters are now pre-formatted, avoiding global parameters. Helper functions still allow StringID.
This commit is contained in:
@@ -29,27 +29,27 @@ std::unique_ptr<DropDownListItem> MakeDropDownListDividerItem()
|
||||
|
||||
std::unique_ptr<DropDownListItem> MakeDropDownListStringItem(StringID str, int value, bool masked, bool shaded)
|
||||
{
|
||||
return std::make_unique<DropDownListStringItem>(str, value, masked, shaded);
|
||||
return MakeDropDownListStringItem(GetString(str), value, masked, shaded);
|
||||
}
|
||||
|
||||
std::unique_ptr<DropDownListItem> MakeDropDownListStringItem(const std::string &str, int value, bool masked, bool shaded)
|
||||
std::unique_ptr<DropDownListItem> MakeDropDownListStringItem(std::string &&str, int value, bool masked, bool shaded)
|
||||
{
|
||||
return std::make_unique<DropDownListStringItem>(str, value, masked, shaded);
|
||||
return std::make_unique<DropDownListStringItem>(std::move(str), value, masked, shaded);
|
||||
}
|
||||
|
||||
std::unique_ptr<DropDownListItem> MakeDropDownListIconItem(SpriteID sprite, PaletteID palette, StringID str, int value, bool masked, bool shaded)
|
||||
{
|
||||
return std::make_unique<DropDownListIconItem>(sprite, palette, str, value, masked, shaded);
|
||||
return std::make_unique<DropDownListIconItem>(sprite, palette, GetString(str), value, masked, shaded);
|
||||
}
|
||||
|
||||
std::unique_ptr<DropDownListItem> MakeDropDownListIconItem(const Dimension &dim, SpriteID sprite, PaletteID palette, StringID str, int value, bool masked, bool shaded)
|
||||
{
|
||||
return std::make_unique<DropDownListIconItem>(dim, sprite, palette, str, value, masked, shaded);
|
||||
return std::make_unique<DropDownListIconItem>(dim, sprite, palette, GetString(str), value, masked, shaded);
|
||||
}
|
||||
|
||||
std::unique_ptr<DropDownListItem> MakeDropDownListCheckedItem(bool checked, StringID str, int value, bool masked, bool shaded, uint indent)
|
||||
{
|
||||
return std::make_unique<DropDownListCheckedItem>(indent, checked, str, value, masked, shaded);
|
||||
return std::make_unique<DropDownListCheckedItem>(indent, checked, GetString(str), value, masked, shaded);
|
||||
}
|
||||
|
||||
static constexpr NWidgetPart _nested_dropdown_menu_widgets[] = {
|
||||
|
||||
Reference in New Issue
Block a user