diff --git a/src/console_gui.cpp b/src/console_gui.cpp index c3dcdaa122..031a4900ad 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -22,6 +22,7 @@ #include "console_func.h" #include "rev.h" #include "video/video_driver.hpp" +#include "textbuf_gui.h" #include "widgets/console_widget.h" @@ -227,6 +228,24 @@ struct IConsoleWindow : Window } } + virtual void OnClick(Point pt, int widget, int click_count) + { + if (_settings_client.gui.touchscreen_mode == 0) return; + + ShowQueryString(STR_EMPTY, STR_CONSOLE_QUERY_STRING, ICON_CMDLN_SIZE, + this, CS_ALPHANUMERAL, QSF_NONE); + } + + virtual void OnQueryTextFinished(char *str) + { + _focused_window = this; + + if (str == NULL) return; + + _iconsole_cmdline.Assign(str); + this->OnKeyPress(0, WKC_RETURN); + } + virtual void OnHundredthTick() { if (IConsoleLine::Truncate() && diff --git a/src/lang/english.txt b/src/lang/english.txt index 60ea491032..3a875fc014 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2663,6 +2663,10 @@ STR_LAI_OBJECT_DESCRIPTION_LIGHTHOUSE :Lighthouse STR_LAI_OBJECT_DESCRIPTION_COMPANY_HEADQUARTERS :Company headquarters STR_LAI_OBJECT_DESCRIPTION_COMPANY_OWNED_LAND :Company-owned land +# Console + +STR_CONSOLE_QUERY_STRING :Enter a console command + # About OpenTTD window STR_ABOUT_OPENTTD :{WHITE}About OpenTTD STR_ABOUT_ORIGINAL_COPYRIGHT :{BLACK}Original copyright {COPYRIGHT} 1995 Chris Sawyer, All rights reserved