1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-22 19:54:06 +01:00

Codechange: Pass raw string to editable query window. (#13481)

This avoids separating string id and parameters. EncodedString is not needed as it is the raw text that is editable.
This commit is contained in:
Peter Nelson
2025-02-07 17:03:53 +00:00
committed by GitHub
parent 8c48f9fc49
commit c3643e3ee0
25 changed files with 60 additions and 115 deletions

View File

@@ -1099,12 +1099,11 @@ public:
{
assert(Group::IsValidID(group));
this->group_rename = group;
/* Show empty query for new groups */
StringID str = STR_EMPTY;
if (!empty) {
SetDParam(0, group);
str = STR_GROUP_NAME;
}
std::string str;
if (!empty) str = GetString(STR_GROUP_NAME, group);
ShowQueryString(str, STR_GROUP_RENAME_CAPTION, MAX_LENGTH_GROUP_NAME_CHARS, this, CS_ALPHANUMERAL, QSF_ENABLE_DEFAULT | QSF_LEN_IN_CHARS);
}