mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-19 12:39:11 +00:00
(svn r24740) -Codechange: Remove duplicate members from QueryStringBaseWindow and directly use QueryString.
This commit is contained in:
@@ -383,7 +383,7 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
|
||||
void ChatTabCompletion()
|
||||
{
|
||||
static char _chat_tab_completion_buf[NETWORK_CHAT_LENGTH];
|
||||
assert(this->edit_str_size == lengthof(_chat_tab_completion_buf));
|
||||
assert(this->text.max_bytes == lengthof(_chat_tab_completion_buf));
|
||||
|
||||
Textbuf *tb = &this->text;
|
||||
size_t len, tb_len;
|
||||
|
@@ -780,7 +780,7 @@ public:
|
||||
virtual void OnEditboxChanged(int wid)
|
||||
{
|
||||
if (wid == WID_NCL_FILTER) {
|
||||
this->string_filter.SetFilterTerm(this->edit_str_buf);
|
||||
this->string_filter.SetFilterTerm(this->text.buf);
|
||||
this->content.SetFilterState(!this->string_filter.IsEmpty());
|
||||
this->content.ForceRebuild();
|
||||
this->InvalidateData();
|
||||
|
@@ -850,8 +850,8 @@ public:
|
||||
{
|
||||
if (wid == WID_NG_CLIENT) {
|
||||
/* The name is only allowed when it starts with a letter! */
|
||||
if (!StrEmpty(this->edit_str_buf) && this->edit_str_buf[0] != ' ') {
|
||||
strecpy(_settings_client.network.client_name, this->edit_str_buf, lastof(_settings_client.network.client_name));
|
||||
if (!StrEmpty(this->text.buf) && this->text.buf[0] != ' ') {
|
||||
strecpy(_settings_client.network.client_name, this->text.buf, lastof(_settings_client.network.client_name));
|
||||
} else {
|
||||
strecpy(_settings_client.network.client_name, "Player", lastof(_settings_client.network.client_name));
|
||||
}
|
||||
@@ -2116,10 +2116,10 @@ struct NetworkCompanyPasswordWindow : public QueryStringBaseWindow {
|
||||
void OnOk()
|
||||
{
|
||||
if (this->IsWidgetLowered(WID_NCP_SAVE_AS_DEFAULT_PASSWORD)) {
|
||||
snprintf(_settings_client.network.default_company_pass, lengthof(_settings_client.network.default_company_pass), "%s", this->edit_str_buf);
|
||||
strecpy(_settings_client.network.default_company_pass, this->text.buf, lastof(_settings_client.network.default_company_pass));
|
||||
}
|
||||
|
||||
NetworkChangeCompanyPassword(_local_company, this->edit_str_buf);
|
||||
NetworkChangeCompanyPassword(_local_company, this->text.buf);
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
|
Reference in New Issue
Block a user