OpenTTD Source: src/linkgraph/linkgraph_gui.cpp File Reference

OpenTTD Source 14.0-beta1

Functions | Variables
linkgraph_gui.cpp File Reference
`#include "../stdafx.h"`
`#include "../window_gui.h"`
`#include "../window_func.h"`
`#include "../company_base.h"`
`#include "../company_gui.h"`
`#include "../timer/timer_game_tick.h"`
`#include "../timer/timer_game_calendar.h"`
`#include "../viewport_func.h"`
`#include "../zoom_func.h"`
`#include "../smallmap_gui.h"`
`#include "../core/geometry_func.hpp"`
`#include "../widgets/link_graph_legend_widget.h"`
`#include "../strings_func.h"`
`#include "linkgraph_gui.h"`
`#include "table/strings.h"`
`#include "../safeguards.h"`

Go to the source code of this file.

## Functions
std::unique_ptr< NWidgetBase > | MakeCompanyButtonRowsLinkGraphGUI ()
| Make a number of rows with buttons for each company for the linkgraph legend window.
std::unique_ptr< NWidgetBase > | MakeSaturationLegendLinkGraphGUI ()
std::unique_ptr< NWidgetBase > | MakeCargoesLegendLinkGraphGUI ()
void | ShowLinkGraphLegend ()
| Open a link graph legend window.

## Variables
static constexpr NWidgetPart | _nested_linkgraph_legend_widgets []
static WindowDesc | _linkgraph_legend_desc (__FILE__, __LINE__, WDP_AUTO, "toolbar_linkgraph", 0, 0, WC_LINKGRAPH_LEGEND, WC_NONE, 0, std::begin(_nested_linkgraph_legend_widgets), std::end(_nested_linkgraph_legend_widgets))

## Detailed Description

Implementation of linkgraph overlay GUI.

Definition in file linkgraph_gui.cpp.

## Variable Documentation

## ◆ _nested_linkgraph_legend_widgets

constexpr NWidgetPart _nested_linkgraph_legend_widgets[]
| staticconstexpr

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN, WID_LGL_CAPTION), SetDataTip(STR_LINKGRAPH_LEGEND_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_STICKYBOX, COLOUR_DARK_GREEN),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN),
NWidget(NWID_HORIZONTAL), SetPadding(WidgetDimensions::unscaled.framerect), SetPIP(0, WidgetDimensions::unscaled.framerect.Horizontal(), 0),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_LGL_SATURATION),
NWidgetFunction(MakeSaturationLegendLinkGraphGUI),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_LGL_COMPANIES),
NWidget(NWID_VERTICAL, NC_EQUALSIZE),
NWidgetFunction(MakeCompanyButtonRowsLinkGraphGUI),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_LGL_COMPANIES_ALL), SetDataTip(STR_LINKGRAPH_LEGEND_ALL, STR_NULL),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_LGL_COMPANIES_NONE), SetDataTip(STR_LINKGRAPH_LEGEND_NONE, STR_NULL),
EndContainer(),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_LGL_CARGOES),
NWidget(NWID_VERTICAL, NC_EQUALSIZE),
NWidgetFunction(MakeCargoesLegendLinkGraphGUI),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_LGL_CARGOES_ALL), SetDataTip(STR_LINKGRAPH_LEGEND_ALL, STR_NULL),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_LGL_CARGOES_NONE), SetDataTip(STR_LINKGRAPH_LEGEND_NONE, STR_NULL),
EndContainer(),
EndContainer(),
EndContainer(),
EndContainer()
}

Definition at line 511 of file linkgraph_gui.cpp.

WID_LGL_CARGOES
@ WID_LGL_CARGOES
Cargo selection widget.
Definition: link_graph_legend_widget.h:27
WWT_STICKYBOX
@ WWT_STICKYBOX
Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
Definition: widget_type.h:68
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
WID_LGL_COMPANIES
@ WID_LGL_COMPANIES
Company selection widget.
Definition: link_graph_legend_widget.h:22
EndContainer
constexpr NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
Definition: widget_type.h:1151
NWidgetFunction
constexpr NWidgetPart NWidgetFunction(NWidgetFunctionType *func_ptr)
Obtain a nested widget (sub)tree from an external source.
Definition: widget_type.h:1279
WID_LGL_SATURATION
@ WID_LGL_SATURATION
Saturation legend.
Definition: link_graph_legend_widget.h:19
NC_EQUALSIZE
@ NC_EQUALSIZE
Value of the NCB_EQUALSIZE flag.
Definition: widget_type.h:508
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
MakeCompanyButtonRowsLinkGraphGUI
std::unique_ptr< NWidgetBase > MakeCompanyButtonRowsLinkGraphGUI()
Make a number of rows with buttons for each company for the linkgraph legend window.
Definition: linkgraph_gui.cpp:459
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
NWID_VERTICAL
@ NWID_VERTICAL
Vertical container.
Definition: widget_type.h:79
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
SetDataTip
constexpr NWidgetPart SetDataTip(uint32_t data, StringID tip)
Widget part function for setting the data and tooltip.
Definition: widget_type.h:1162
WID_LGL_CAPTION
@ WID_LGL_CAPTION
Caption widget.
Definition: link_graph_legend_widget.h:18
WWT_SHADEBOX
@ WWT_SHADEBOX
Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
Definition: widget_type.h:66