OpenTTD Source: src/help_gui.cpp File Reference

OpenTTD Source 14.0-beta3

Data Structures | Functions | Variables
help_gui.cpp File Reference
`#include "stdafx.h"`
`#include "gui.h"`
`#include "window_gui.h"`
`#include "textfile_gui.h"`
`#include "fileio_func.h"`
`#include "table/control_codes.h"`
`#include "string_func.h"`
`#include "openttd.h"`
`#include "help_gui.h"`
`#include "widgets/help_widget.h"`
`#include "widgets/misc_widget.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | GameManualTextfileWindow
| Window class displaying the game manual textfile viewer. More...
struct | HelpWindow
| Window class displaying the help window. More...

## Functions
static std::optional< std::string > | FindGameManualFilePath (std::string_view filename)
| Find the path to the game manual file. More...
void | ShowHelpWindow ()

## Variables
static const std::string | README_FILENAME = "README.md"
static const std::string | CHANGELOG_FILENAME = "changelog.txt"
static const std::string | KNOWN_BUGS_FILENAME = "known-bugs.txt"
static const std::string | LICENSE_FILENAME = "COPYING.md"
static const std::string | WEBSITE_LINK = "https://www.openttd.org/"
static const std::string | WIKI_LINK = "https://wiki.openttd.org/"
static const std::string | BUGTRACKER_LINK = "https://bugs.openttd.org/"
static const std::string | COMMUNITY_LINK = "https://community.openttd.org/"
static constexpr size_t | CHANGELOG_VERSIONS_LIMIT = 20
| Only show the first 20 changelog versions in the textfile viewer.
static constexpr NWidgetPart | _nested_helpwin_widgets []
static WindowDesc | _helpwin_desc (__FILE__, __LINE__, WDP_CENTER, nullptr, 0, 0, WC_HELPWIN, WC_NONE, 0, std::begin(_nested_helpwin_widgets), std::end(_nested_helpwin_widgets))

## Detailed Description

GUI to access manuals and related.

Definition in file help_gui.cpp.

## Function Documentation

## ◆ FindGameManualFilePath()

static std::optional<std::string> FindGameManualFilePath | ( | std::string_view | filename | ) |
| static

Find the path to the game manual file.

Parameters

  filename | The filename to find.

Returns
  std::string The path to the filename if found.

Definition at line 44 of file help_gui.cpp.

References SP_APPLICATION_BUNDLE_DIR, SP_BINARY_DIR, SP_INSTALLATION_DIR, SP_SHARED_DIR, and SP_WORKING_DIR.

## Variable Documentation

## ◆ _nested_helpwin_widgets

constexpr NWidgetPart _nested_helpwin_widgets[]
| staticconstexpr

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_HELP_WINDOW_CAPTION, STR_NULL),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN),
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0), SetPadding(WidgetDimensions::unscaled.sparse),
NWidget(WWT_FRAME, COLOUR_DARK_GREEN), SetDataTip(STR_HELP_WINDOW_WEBSITES, STR_NULL),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_WEBSITE), SetDataTip(STR_HELP_WINDOW_MAIN_WEBSITE, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_WIKI), SetDataTip(STR_HELP_WINDOW_MANUAL_WIKI, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_BUGTRACKER), SetDataTip(STR_HELP_WINDOW_BUGTRACKER, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_COMMUNITY), SetDataTip(STR_HELP_WINDOW_COMMUNITY, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0),
EndContainer(),
NWidget(WWT_FRAME, COLOUR_DARK_GREEN), SetDataTip(STR_HELP_WINDOW_DOCUMENTS, STR_NULL),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_README), SetDataTip(STR_HELP_WINDOW_README, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_CHANGELOG), SetDataTip(STR_HELP_WINDOW_CHANGELOG, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_KNOWN_BUGS),SetDataTip(STR_HELP_WINDOW_KNOWN_BUGS, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_LICENSE), SetDataTip(STR_HELP_WINDOW_LICENSE, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0),
EndContainer(),
EndContainer(),
EndContainer(),
}

Definition at line 171 of file help_gui.cpp.

SetFill
constexpr NWidgetPart SetFill(uint16_t fill_x, uint16_t fill_y)
Widget part function for setting filling.
Definition: widget_type.h:1141
WWT_CAPTION
@ WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition: widget_type.h:63
NWID_HORIZONTAL
@ NWID_HORIZONTAL
Horizontal container.
Definition: widget_type.h:77
EndContainer
constexpr NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
Definition: widget_type.h:1151
SetPadding
constexpr NWidgetPart SetPadding(uint8_t top, uint8_t right, uint8_t bottom, uint8_t left)
Widget part function for setting additional space around a widget.
Definition: widget_type.h:1188
WWT_PUSHTXTBTN
@ WWT_PUSHTXTBTN
Normal push-button (no toggle button) with text caption.
Definition: widget_type.h:110
NWidget
constexpr NWidgetPart NWidget(WidgetType tp, Colours col, WidgetID idx=-1)
Widget part function for starting a new 'real' widget.
Definition: widget_type.h:1258
WWT_FRAME
@ WWT_FRAME
Frame.
Definition: widget_type.h:62
WidgetDimensions::unscaled
static const WidgetDimensions unscaled
Unscaled widget dimensions.
Definition: window_gui.h:67
WWT_CLOSEBOX
@ WWT_CLOSEBOX
Close box (at top-left of a window)
Definition: widget_type.h:71
SetPIP
constexpr NWidgetPart SetPIP(uint8_t pre, uint8_t inter, uint8_t post)
Widget part function for setting a pre/inter/post spaces.
Definition: widget_type.h:1220
WWT_PANEL
@ WWT_PANEL
Simple depressed panel.
Definition: widget_type.h:52
SetMinimalSize
constexpr NWidgetPart SetMinimalSize(int16_t x, int16_t y)
Widget part function for setting the minimal size.
Definition: widget_type.h:1097
SetDataTip
constexpr NWidgetPart SetDataTip(uint32_t data, StringID tip)
Widget part function for setting the data and tooltip.
Definition: widget_type.h:1162