When clicking the console and when in touchscreen modes, open a query string window.
This commit is contained in:
@@ -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() &&
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user