OpenTTD Source  20241108-master-g80f628063a
textfile_gui.h File Reference

GUI functions related to textfiles. More...

#include "fileio_type.h"
#include "strings_func.h"
#include "textfile_type.h"
#include "window_gui.h"

Go to the source code of this file.

Data Structures

struct  TextfileWindow
 Window for displaying a textfile. More...
 
struct  TextfileWindow::Line
 
struct  TextfileWindow::Hyperlink
 
struct  TextfileWindow::HistoryEntry
 

Functions

std::optional< std::string > GetTextfile (TextfileType type, Subdirectory dir, const std::string &filename)
 Search a textfile file next to the given content. More...
 

Detailed Description

GUI functions related to textfiles.

Definition in file textfile_gui.h.

Function Documentation

◆ GetTextfile()

std::optional<std::string> GetTextfile ( TextfileType  type,
Subdirectory  dir,
const std::string &  filename 
)

Search a textfile file next to the given content.

Parameters
typeThe type of the textfile to search for.
dirThe subdirectory to search in.
filenameThe filename of the content to look for.
Returns
The path to the textfile, nullptr otherwise.

Definition at line 833 of file textfile_gui.cpp.

References lengthof.

Referenced by GRFConfig::GetTextfile(), and ScriptConfig::GetTextfile().