OpenTTD Source 20241224-master-gf74b0cf984
linkgraph_gui.cpp File Reference

Implementation of linkgraph overlay GUI. More...

#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< NWidgetBaseMakeCompanyButtonRowsLinkGraphGUI ()
 Make a number of rows with buttons for each company for the linkgraph legend window.
 
std::unique_ptr< NWidgetBaseMakeSaturationLegendLinkGraphGUI ()
 
std::unique_ptr< NWidgetBaseMakeCargoesLegendLinkGraphGUI ()
 
void ShowLinkGraphLegend ()
 Open a link graph legend window.
 

Variables

static constexpr NWidgetPart _nested_linkgraph_legend_widgets []
 
static WindowDesc _linkgraph_legend_desc (WDP_AUTO, "toolbar_linkgraph", 0, 0, WC_LINKGRAPH_LEGEND, WC_NONE, 0, _nested_linkgraph_legend_widgets)
 

Detailed Description

Implementation of linkgraph overlay GUI.

Definition in file linkgraph_gui.cpp.

Function Documentation

◆ MakeCargoesLegendLinkGraphGUI()

std::unique_ptr< NWidgetBase > MakeCargoesLegendLinkGraphGUI ( )

Definition at line 473 of file linkgraph_gui.cpp.

◆ MakeCompanyButtonRowsLinkGraphGUI()

std::unique_ptr< NWidgetBase > MakeCompanyButtonRowsLinkGraphGUI ( )

Make a number of rows with buttons for each company for the linkgraph legend window.

Definition at line 454 of file linkgraph_gui.cpp.

References MakeCompanyButtonRows().

◆ MakeSaturationLegendLinkGraphGUI()

std::unique_ptr< NWidgetBase > MakeSaturationLegendLinkGraphGUI ( )

Definition at line 459 of file linkgraph_gui.cpp.

◆ ShowLinkGraphLegend()

void ShowLinkGraphLegend ( )

Open a link graph legend window.

Definition at line 549 of file linkgraph_gui.cpp.

Referenced by MenuClickMap().

Variable Documentation

◆ _nested_linkgraph_legend_widgets

constexpr NWidgetPart _nested_linkgraph_legend_widgets[]
staticconstexpr
Initial value:
= {
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),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_LGL_SATURATION),
NWidgetFunction(MakeSaturationLegendLinkGraphGUI),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_LGL_COMPANIES),
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),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_LGL_CARGOES),
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),
}
static const WidgetDimensions unscaled
Unscaled widget dimensions.
Definition window_gui.h:96
constexpr NWidgetPart NWidgetFunction(NWidgetFunctionType *func_ptr)
Obtain a nested widget (sub)tree from an external source.
constexpr NWidgetPart SetPIP(uint8_t pre, uint8_t inter, uint8_t post)
Widget part function for setting a pre/inter/post spaces.
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.
constexpr NWidgetPart SetDataTip(uint32_t data, StringID tip)
Widget part function for setting the data and tooltip.
constexpr NWidgetPart NWidget(WidgetType tp, Colours col, WidgetID idx=-1)
Widget part function for starting a new 'real' widget.
constexpr NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
std::unique_ptr< NWidgetBase > MakeCompanyButtonRowsLinkGraphGUI()
Make a number of rows with buttons for each company for the linkgraph legend window.
@ NC_EQUALSIZE
Value of the NCB_EQUALSIZE flag.
@ WWT_PUSHTXTBTN
Normal push-button (no toggle button) with text caption.
@ NWID_HORIZONTAL
Horizontal container.
Definition widget_type.h:75
@ WWT_PANEL
Simple depressed panel.
Definition widget_type.h:50
@ WWT_STICKYBOX
Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
Definition widget_type.h:66
@ WWT_SHADEBOX
Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
Definition widget_type.h:64
@ WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition widget_type.h:61
@ NWID_VERTICAL
Vertical container.
Definition widget_type.h:77
@ WWT_CLOSEBOX
Close box (at top-left of a window)
Definition widget_type.h:69

Definition at line 506 of file linkgraph_gui.cpp.