summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-14 22:50:35 +0000
committerfrosch <frosch@openttd.org>2012-11-14 22:50:35 +0000
commitf5d8ba5d7f90abc72db6c0470da383ecf82da487 (patch)
tree3dbbbbe18733005c5851251dac62314d871b2b30 /src/ai
parentdcfb2af871b76a7b65fb959b2f4ebc2da2f9e4d3 (diff)
downloadopenttd-f5d8ba5d7f90abc72db6c0470da383ecf82da487.tar.xz
(svn r24742) -Codechange: Remove QueryStringBaseWindow and store QueryStrings per widget instead.
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai_gui.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index 214c4eb81..4ecde1c48 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -981,7 +981,7 @@ static bool SetScriptButtonColour(NWidgetCore &button, bool dead, bool paused)
/**
* Window with everything an AI prints via ScriptLog.
*/
-struct AIDebugWindow : public QueryStringBaseWindow {
+struct AIDebugWindow : public Window {
static const int top_offset; ///< Offset of the text at the top of the WID_AID_LOG_PANEL.
static const int bottom_offset; ///< Offset of the text at the bottom of the WID_AID_LOG_PANEL.
@@ -994,6 +994,7 @@ struct AIDebugWindow : public QueryStringBaseWindow {
bool show_break_box; ///< Whether the break/debug box is visible.
static bool break_check_enabled; ///< Stop an AI when it prints a matching string
static char break_string[MAX_BREAK_STR_STRING_LENGTH]; ///< The string to match to the AI output
+ QueryString break_editbox; ///< Break editbox
static StringFilter break_string_filter; ///< Log filter for break.
static bool case_sensitive_break_check; ///< Is the matching done case-sensitive
int highlight_row; ///< The output row that matches the given string, or -1
@@ -1010,7 +1011,7 @@ struct AIDebugWindow : public QueryStringBaseWindow {
* @param desc The description of the window.
* @param number The window number (actually unused).
*/
- AIDebugWindow(const WindowDesc *desc, WindowNumber number) : QueryStringBaseWindow(MAX_BREAK_STR_STRING_LENGTH)
+ AIDebugWindow(const WindowDesc *desc, WindowNumber number) : break_editbox(MAX_BREAK_STR_STRING_LENGTH)
{
this->CreateNestedTree(desc);
this->vscroll = this->GetScrollbar(WID_AID_SCROLLBAR);
@@ -1032,8 +1033,10 @@ struct AIDebugWindow : public QueryStringBaseWindow {
this->autoscroll = true;
this->highlight_row = -1;
+ this->querystrings[WID_AID_BREAK_STR_EDIT_BOX] = &this->break_editbox;
+
/* Restore the break string value from static variable */
- this->text.Assign(this->break_string);
+ this->break_editbox.text.Assign(this->break_string);
/* Restore button state from static class variables */
if (ai_debug_company == OWNER_DEITY) {
@@ -1356,7 +1359,7 @@ struct AIDebugWindow : public QueryStringBaseWindow {
{
if (wid == WID_AID_BREAK_STR_EDIT_BOX) {
/* Save the current string to static member so it can be restored next time the window is opened. */
- strecpy(this->break_string, this->text.buf, lastof(this->break_string));
+ strecpy(this->break_string, this->break_editbox.text.buf, lastof(this->break_string));
break_string_filter.SetFilterTerm(this->break_string);
}
}