OpenTTD Source 20250312-master-gcdcc6b491d
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 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 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 207 of file league_gui.cpp.

◆ ShowFirstLeagueTable()

void ShowFirstLeagueTable ( )

Definition at line 442 of file league_gui.cpp.

◆ ShowPerformanceLeagueTable()

void ShowPerformanceLeagueTable ( )

Definition at line 202 of file league_gui.cpp.

◆ ShowScriptLeagueTable()

void ShowScriptLeagueTable ( LeagueTableID  table)

Definition at line 436 of file league_gui.cpp.

Variable Documentation

◆ _nested_performance_league_widgets

constexpr NWidgetPart _nested_performance_league_widgets[]
staticconstexpr
Initial value:
= {
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),
}
static const WidgetDimensions unscaled
Unscaled widget dimensions.
Definition window_gui.h:94
constexpr NWidgetPart SetStringTip(StringID string, StringID tip={})
Widget part function for setting the string and tooltip.
constexpr NWidgetPart SetMinimalSize(int16_t x, int16_t y)
Widget part function for setting the minimal size.
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,...
constexpr NWidgetPart SetMinimalTextLines(uint8_t lines, uint8_t spacing, FontSize size=FS_NORMAL)
Widget part function for setting the minimal text lines.
@ WID_PLT_BACKGROUND
Background of the window.
@ NWID_HORIZONTAL
Horizontal container.
Definition widget_type.h:65
@ WWT_PANEL
Simple depressed panel.
Definition widget_type.h:40
@ WWT_STICKYBOX
Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
Definition widget_type.h:56
@ WWT_SHADEBOX
Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
Definition widget_type.h:54
@ WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition widget_type.h:51
@ WWT_CLOSEBOX
Close box (at top-left of a window)
Definition widget_type.h:59

Definition at line 184 of file league_gui.cpp.

◆ _nested_script_league_widgets

constexpr NWidgetPart _nested_script_league_widgets[]
staticconstexpr
Initial value:
= {
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
}
@ WID_SLT_BACKGROUND
Background of the window.
@ WID_SLT_CAPTION
Caption of the window.

Definition at line 418 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.