Public Member Functions | Data Fields | Static Public Attributes

AIDebugWindow Struct Reference

Window with everything an AI prints via ScriptLog. More...

Inheritance diagram for AIDebugWindow:
QueryStringBaseWindow Window QueryString ZeroedMemoryAllocator

Public Member Functions

ScriptLog::LogDataGetLogPointer () const
 AIDebugWindow (const WindowDesc *desc, WindowNumber number)
 Constructor for the window.
virtual void UpdateWidgetSize (int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
virtual void OnPaint ()
virtual void SetStringParameters (int widget) const
virtual void DrawWidget (const Rect &r, int widget) const
void ChangeToAI (CompanyID show_ai)
 Change all settings to select another AI.
virtual void OnClick (Point pt, int widget, int click_count)
virtual void OnTimeout ()
virtual void OnMouseLoop ()
virtual EventState OnKeyPress (uint16 key, uint16 keycode)
virtual void OnInvalidateData (int data=0, bool gui_scope=true)
 Some data on this window has become invalid.
virtual void OnResize ()

Data Fields

int redraw_timer
 Timer for redrawing the window, otherwise it'll happen every tick.
int last_vscroll_pos
 Last position of the scrolling.
bool autoscroll
 Whether automatically scrolling should be enabled or not.
bool show_break_box
 Whether the break/debug box is visible.
int highlight_row
 The output row that matches the given string, or -1.
Scrollbarvscroll
 Cache of the vertical scrollbar.

Static Public Attributes

static const int top_offset = WD_FRAMERECT_TOP + 2
 Offset of the text at the top of the WID_AID_LOG_PANEL.
static const int bottom_offset = WD_FRAMERECT_BOTTOM
 Offset of the text at the bottom of the WID_AID_LOG_PANEL.
static const unsigned int MAX_BREAK_STR_STRING_LENGTH = 256
 Maximum length of the break string.
static CompanyID ai_debug_company = INVALID_COMPANY
 The AI that is (was last) being debugged.
static bool break_check_enabled = true
 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.
static bool case_sensitive_break_check = false
 Is the matching done case-sensitive.

Detailed Description

Window with everything an AI prints via ScriptLog.

Definition at line 839 of file ai_gui.cpp.


Constructor & Destructor Documentation


Member Function Documentation

void AIDebugWindow::ChangeToAI ( CompanyID  show_ai  )  [inline]
virtual void AIDebugWindow::OnInvalidateData ( int  data = 0,
bool  gui_scope = true 
) [inline, virtual]

Some data on this window has become invalid.

Parameters:
data Information about the changed data.
gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See InvalidateWindowData() for details.

Definition at line 1174 of file ai_gui.cpp.

References _pause_mode, ai_debug_company, break_check_enabled, case_sensitive_break_check, CMD_PAUSE, Window::DisableWidget(), DoCommandP(), QueryStringBaseWindow::edit_str_buf, Window::EnableWidget(), highlight_row, ScriptLog::LogData::lines, OWNER_DEITY, PM_PAUSED_NORMAL, PM_UNPAUSED, ScriptLog::LogData::pos, Window::SetDirty(), Window::SetWidgetDirty(), StrEmpty(), AI::Suspend(), WID_AID_CONTINUE_BTN, and WID_AID_LOG_PANEL.


The documentation for this struct was generated from the following file: