mirror of https://github.com/OpenTTD/OpenTTD.git
Fix d42a78f: Some raw drop down list strings may need token processing. (#11400)
Storing the raw string without processing though GetString() caused token processing to be skipped.
This commit is contained in:
parent
062c19830b
commit
129e98fbab
|
@ -36,6 +36,13 @@ DropDownListStringItem::DropDownListStringItem(StringID string, int result, bool
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DropDownListStringItem::DropDownListStringItem(const std::string &string, int result, bool masked) : DropDownListItem(result, masked)
|
||||||
|
{
|
||||||
|
/* A raw string may contain parsable tokens, so it needs to be passed through GetString. */
|
||||||
|
SetDParamStr(0, string);
|
||||||
|
this->string = GetString(STR_JUST_RAW_STRING);
|
||||||
|
}
|
||||||
|
|
||||||
uint DropDownListStringItem::Width() const
|
uint DropDownListStringItem::Width() const
|
||||||
{
|
{
|
||||||
return GetStringBoundingBox(this->String()).width + WidgetDimensions::scaled.dropdowntext.Horizontal();
|
return GetStringBoundingBox(this->String()).width + WidgetDimensions::scaled.dropdowntext.Horizontal();
|
||||||
|
|
|
@ -37,10 +37,10 @@ public:
|
||||||
*/
|
*/
|
||||||
class DropDownListStringItem : public DropDownListItem {
|
class DropDownListStringItem : public DropDownListItem {
|
||||||
public:
|
public:
|
||||||
const std::string string; ///< String of item
|
std::string string; ///< String of item
|
||||||
|
|
||||||
DropDownListStringItem(StringID string, int result, bool masked);
|
DropDownListStringItem(StringID string, int result, bool masked);
|
||||||
DropDownListStringItem(const std::string &string, int result, bool masked) : DropDownListItem(result, masked), string(string) {}
|
DropDownListStringItem(const std::string &string, int result, bool masked);
|
||||||
|
|
||||||
bool Selectable() const override { return true; }
|
bool Selectable() const override { return true; }
|
||||||
uint Width() const override;
|
uint Width() const override;
|
||||||
|
|
Loading…
Reference in New Issue