OpenTTD Source: src/league_gui.cpp File Reference

OpenTTD Source 15.3

Data Structures | Functions | Variables
league_gui.cpp File Reference

GUI for league tables. More...

`#include "stdafx.h"`
`#include "league_gui.h"`
`#include "company_base.h"`
`#include "company_gui.h"`
`#include "gui.h"`
`#include "industry.h"`
`#include "league_base.h"`
`#include "sortlist_type.h"`
`#include "story_base.h"`
`#include "strings_func.h"`
`#include "tile_map.h"`
`#include "town.h"`
`#include "viewport_func.h"`
`#include "window_gui.h"`
`#include "widgets/league_widget.h"`
`#include "table/strings.h"`
`#include "table/sprites.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Data Structures
class | PerformanceLeagueWindow
class | ScriptLeagueWindow

## Functions
static StringID | GetPerformanceTitleFromValue (uint value)
void | ShowPerformanceLeagueTable ()
static void | HandleLinkClick (Link link)
void | ShowScriptLeagueTable (LeagueTableID table)
void | ShowFirstLeagueTable ()

## Variables
static const StringID | _performance_titles []
static constexpr std::initializer_list< NWidgetPart > | _nested_performance_league_widgets
static WindowDesc | _performance_league_desc (WDP_AUTO, "performance_league", 0, 0, WC_COMPANY_LEAGUE, WC_NONE, {}, _nested_performance_league_widgets)
static constexpr std::initializer_list< NWidgetPart > | _nested_script_league_widgets
static WindowDesc | _script_league_desc (WDP_AUTO, "script_league", 0, 0, WC_COMPANY_LEAGUE, WC_NONE, {}, _nested_script_league_widgets)

## Detailed Description

GUI for league tables.

Definition in file league_gui.cpp.

## Function Documentation

## ◆ GetPerformanceTitleFromValue()

static StringID GetPerformanceTitleFromValue | ( | uint | value | ) |
| inlinestatic

Definition at line 52 of file league_gui.cpp.

## ◆ HandleLinkClick()

static void HandleLinkClick | ( | Link | link | ) |
| static

Definition at line 206 of file league_gui.cpp.

## ◆ ShowFirstLeagueTable()

void ShowFirstLeagueTable | ( |  | ) |

Definition at line 443 of file league_gui.cpp.

## ◆ ShowPerformanceLeagueTable()

void ShowPerformanceLeagueTable | ( |  | ) |

Definition at line 201 of file league_gui.cpp.

## ◆ ShowScriptLeagueTable()

void ShowScriptLeagueTable | ( | LeagueTableID | table | ) |

Definition at line 437 of file league_gui.cpp.

## Variable Documentation

## ◆ _nested_performance_league_widgets

constexpr std::initializer_list<NWidgetPart> _nested_performance_league_widgets
| staticconstexpr

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_COMPANY_LEAGUE_TABLE_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN, WID_PLT_BACKGROUND), SetMinimalSize(400, 0), SetMinimalTextLines(15, WidgetDimensions::unscaled.framerect.Vertical()),
EndContainer(),
}
WidgetDimensions::unscaled
static const WidgetDimensions unscaled
Unscaled widget dimensions.
Definition window_gui.h:93
SetStringTip
constexpr NWidgetPart SetStringTip(StringID string, StringID tip={})
Widget part function for setting the string and tooltip.
Definition widget_type.h:1243
SetMinimalSize
constexpr NWidgetPart SetMinimalSize(int16_t x, int16_t y)
Widget part function for setting the minimal size.
Definition widget_type.h:1159
EndContainer
constexpr NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
Definition widget_type.h:1232
NWidget
constexpr NWidgetPart NWidget(WidgetType tp, Colours col, WidgetID idx=INVALID_WIDGET)
Widget part function for starting a new 'real' widget.
Definition widget_type.h:1427
SetMinimalTextLines
constexpr NWidgetPart SetMinimalTextLines(uint8_t lines, uint8_t spacing, FontSize size=FS_NORMAL)
Widget part function for setting the minimal text lines.
Definition widget_type.h:1190
WID_PLT_BACKGROUND
@ WID_PLT_BACKGROUND
Background of the window.
Definition league_widget.h:15
NWID_HORIZONTAL
@ NWID_HORIZONTAL
Horizontal container.
Definition widget_type.h:66
WWT_PANEL
@ WWT_PANEL
Simple depressed panel.
Definition widget_type.h:39
WWT_STICKYBOX
@ WWT_STICKYBOX
Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
Definition widget_type.h:57
WWT_SHADEBOX
@ WWT_SHADEBOX
Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
Definition widget_type.h:55
WWT_CAPTION
@ WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition widget_type.h:52
WWT_CLOSEBOX
@ WWT_CLOSEBOX
Close box (at top-left of a window)
Definition widget_type.h:60

Definition at line 183 of file league_gui.cpp.

## ◆ _nested_script_league_widgets

constexpr std::initializer_list<NWidgetPart> _nested_script_league_widgets
| staticconstexpr

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_SLT_CAPTION),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN, WID_SLT_BACKGROUND), SetMinimalSize(400, 0), SetMinimalTextLines(15, WidgetDimensions::unscaled.framerect.Vertical()),
EndContainer(),
}
WID_SLT_BACKGROUND
@ WID_SLT_BACKGROUND
Background of the window.
Definition league_widget.h:21
WID_SLT_CAPTION
@ WID_SLT_CAPTION
Caption of the window.
Definition league_widget.h:20

Definition at line 419 of file league_gui.cpp.

## ◆ _performance_titles

const StringID _performance_titles[]
| static

Initial value:
= {
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ENGINEER,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ENGINEER,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRAFFIC_MANAGER,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRAFFIC_MANAGER,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRANSPORT_COORDINATOR,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRANSPORT_COORDINATOR,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ROUTE_SUPERVISOR,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ROUTE_SUPERVISOR,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_DIRECTOR,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_DIRECTOR,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHIEF_EXECUTIVE,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHIEF_EXECUTIVE,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHAIRMAN,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHAIRMAN,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_PRESIDENT,
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TYCOON,
}

Definition at line 33 of file league_gui.cpp.