Window for displaying the textfile of a NewGRF. More...
Public Member Functions | |
NewGRFTextfileWindow (const WindowDesc *desc, const GRFConfig *c, TextfileType file_type) | |
virtual void | UpdateWidgetSize (int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) |
virtual void | SetStringParameters (int widget) const |
virtual void | DrawWidget (const Rect &r, int widget) const |
virtual void | OnResize () |
Data Fields | |
const GRFConfig * | grf_config |
View the textfile of this GRFConfig. | |
TextfileType | file_type |
Type of textfile to view. | |
int | line_height |
Height of a line in the display widget. | |
Scrollbar * | vscroll |
Vertical scrollbar. | |
Scrollbar * | hscroll |
Horizontal scrollbar. | |
char * | text |
Lines of text from the NewGRF's textfile. | |
SmallVector< const char *, 64 > | lines |
text, split into lines in a table with lines. | |
uint | max_length |
The longest line in the textfile (in pixels). | |
Static Public Attributes | |
static const int | TOP_SPACING = WD_FRAMETEXT_TOP |
Additional spacing at the top of the WID_NT_BACKGROUND widget. | |
static const int | BOTTOM_SPACING = WD_FRAMETEXT_BOTTOM |
Additional spacing at the bottom of the WID_NT_BACKGROUND widget. | |
Private Member Functions | |
void | Reset () |
Reset the search, i.e. | |
FontSize | DefaultSize () |
Get the default (font) size of the string. | |
const char * | NextString () |
Get the next string to search through. | |
bool | Monospace () |
Whether to search for a monospace font or not. | |
void | SetFontNames (FreeTypeSettings *settings, const char *font_name) |
Set the right font names. | |
void | LoadTextfile () |
Load the NewGRF's textfile text from file, and setup lines, max_length, and both scrollbars. | |
Private Attributes | |
uint | search_iterator |
Iterator for the font check search. |
Window for displaying the textfile of a NewGRF.
Definition at line 468 of file newgrf_gui.cpp.
FontSize NewGRFTextfileWindow::DefaultSize | ( | ) | [inline, private, virtual] |
Get the default (font) size of the string.
Implements MissingGlyphSearcher.
Definition at line 557 of file newgrf_gui.cpp.
bool NewGRFTextfileWindow::Monospace | ( | ) | [inline, private, virtual] |
Whether to search for a monospace font or not.
Implements MissingGlyphSearcher.
Definition at line 569 of file newgrf_gui.cpp.
const char* NewGRFTextfileWindow::NextString | ( | ) | [inline, private, virtual] |
Get the next string to search through.
Implements MissingGlyphSearcher.
Definition at line 562 of file newgrf_gui.cpp.
References SmallVector< T, S >::Length(), lines, and search_iterator.
void NewGRFTextfileWindow::Reset | ( | ) | [inline, private, virtual] |
Reset the search, i.e.
begin from the beginning again.
Implements MissingGlyphSearcher.
Definition at line 552 of file newgrf_gui.cpp.
References search_iterator.
void NewGRFTextfileWindow::SetFontNames | ( | FreeTypeSettings * | settings, | |
const char * | font_name | |||
) | [inline, private, virtual] |
Set the right font names.
settings | The settings to modify. | |
font_name | The new font name. |
Implements MissingGlyphSearcher.
Definition at line 574 of file newgrf_gui.cpp.