|
OpenTTD Source 20261129-master-g72a8bdc861
|
GUI that shows performance graphs. More...
#include "stdafx.h"#include <ranges>#include "misc/history_func.hpp"#include "graph_gui.h"#include "window_gui.h"#include "company_base.h"#include "company_gui.h"#include "economy_func.h"#include "cargotype.h"#include "strings_func.h"#include "window_func.h"#include "sound_func.h"#include "gfx_func.h"#include "core/geometry_func.hpp"#include "currency_func.h"#include "timer/timer.h"#include "timer/timer_window.h"#include "timer/timer_game_tick.h"#include "timer/timer_game_economy.h"#include "zoom_func.h"#include "industry.h"#include "town.h"#include "widgets/graph_widget.h"#include "table/strings.h"#include "table/sprites.h"#include "safeguards.h"Go to the source code of this file.
Data Structures | |
| struct | GraphLegendWindow |
| struct | ValuesInterval |
| Contains the interval of a graph's data. More... | |
| struct | BaseGraphWindow |
| struct | BaseGraphWindow::GraphScale |
| struct | BaseGraphWindow::GraphRange |
| Label and tooltip for a graph range. More... | |
| struct | BaseGraphWindow::DataSet |
| struct | BaseGraphWindow::BaseFiller |
| struct | BaseGraphWindow::Filler< Tprojection > |
| struct | BaseGraphWindow::TransformFiller< Tprojection, Ttransformer > |
| Fill graph dataset with transformed data. More... | |
| class | BaseCompanyGraphWindow |
| struct | OperatingProfitGraphWindow |
| struct | IncomeGraphWindow |
| struct | DeliveredCargoGraphWindow |
| struct | PerformanceHistoryGraphWindow |
| struct | CompanyValueGraphWindow |
| struct | BaseCargoGraphWindow |
| struct | PaymentRatesGraphWindow |
| struct | PerformanceRatingDetailWindow |
| struct | IndustryProductionGraphWindow |
| struct | TownCargoGraphWindow |
| struct | StationGraphWindow |
| Window for station cargo graphs. More... | |
Functions | |
| static std::unique_ptr< NWidgetBase > | MakeNWidgetCompanyLines () |
| Construct a vertical list of buttons, one for each company. | |
| static void | ShowGraphLegend () |
| void | ShowOperatingProfitGraph () |
| void | ShowIncomeGraph () |
| void | ShowDeliveredCargoGraph () |
| void | ShowPerformanceHistoryGraph () |
| void | ShowCompanyValueGraph () |
| void | ShowCargoPaymentRates () |
| void | ShowIndustryProductionGraph (WindowNumber window_number) |
| void | ShowTownCargoGraph (WindowNumber window_number) |
| void | ShowStationGraph (WindowNumber window_number) |
| Create a station graph window for a station. | |
| static std::unique_ptr< NWidgetBase > | MakePerformanceDetailPanels () |
| Make a vertical list of panels for outputting score details. | |
| std::unique_ptr< NWidgetBase > | MakeCompanyButtonRowsGraphGUI () |
| Make a number of rows with buttons for each company for the performance rating detail window. | |
| void | ShowPerformanceRatingDetail () |
| void | InitializeGraphGui () |
Variables | |
| static CompanyMask | _legend_excluded_companies |
| Bitmasks of company and cargo indices that shouldn't be drawn. | |
| static const OverflowSafeInt64 | INVALID_DATAPOINT (INT64_MAX) |
| Value used for a datapoint that shouldn't be drawn. | |
| static const uint | INVALID_DATAPOINT_POS = UINT_MAX |
| Used to determine if the previous point was drawn. | |
| constexpr double | INT64_MAX_IN_DOUBLE = static_cast<double>(INT64_MAX - 512) |
| The biggest double that when cast to int64_t still fits in a int64_t. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_graph_legend_widgets |
| static WindowDesc | _graph_legend_desc (WindowPosition::Automatic, "graph_legend", 0, 0, WindowClass::GraphLegend, WindowClass::None, {}, _nested_graph_legend_widgets) |
| Window definition for the graph legend window. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_operating_profit_widgets |
| static WindowDesc | _operating_profit_desc (WindowPosition::Automatic, "graph_operating_profit", 0, 0, WindowClass::OperatingProfitGraph, WindowClass::None, {}, _nested_operating_profit_widgets) |
| Window definition for the operating profit graph window. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_income_graph_widgets |
| static WindowDesc | _income_graph_desc (WindowPosition::Automatic, "graph_income", 0, 0, WindowClass::IncomeGraph, WindowClass::None, {}, _nested_income_graph_widgets) |
| Window definition for the income graph window. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_delivered_cargo_graph_widgets |
| static WindowDesc | _delivered_cargo_graph_desc (WindowPosition::Automatic, "graph_delivered_cargo", 0, 0, WindowClass::DeliveredCargoGraph, WindowClass::None, {}, _nested_delivered_cargo_graph_widgets) |
| Window definition for the delivered cargo graph window. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_performance_history_widgets |
| static WindowDesc | _performance_history_desc (WindowPosition::Automatic, "graph_performance", 0, 0, WindowClass::PerformanceGraph, WindowClass::None, {}, _nested_performance_history_widgets) |
| Window definition for the performance history graph window. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_company_value_graph_widgets |
| static WindowDesc | _company_value_graph_desc (WindowPosition::Automatic, "graph_company_value", 0, 0, WindowClass::CompanyValueGraph, WindowClass::None, {}, _nested_company_value_graph_widgets) |
| Window definition for the company value graph window. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_cargo_payment_rates_widgets |
| static WindowDesc | _cargo_payment_rates_desc (WindowPosition::Automatic, "graph_cargo_payment_rates", 0, 0, WindowClass::CargoPaymentRatesGraph, WindowClass::None, {}, _nested_cargo_payment_rates_widgets) |
| Window definition for the cargo payment rates graph window. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_industry_production_widgets |
| static WindowDesc | _industry_production_desc (WindowPosition::Automatic, "graph_industry_production", 0, 0, WindowClass::IndustryProductionGraph, WindowClass::IndustryView, {}, _nested_industry_production_widgets) |
| Window definition for the industry production graph window. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_town_cargo_graph_widgets |
| static WindowDesc | _town_cargo_graph_desc (WindowPosition::Automatic, "graph_town_cargo", 0, 0, WindowClass::TownCargoGraph, WindowClass::TownView, {}, _nested_town_cargo_graph_widgets) |
| Window definition for the town cargo graph window. | |
| static constexpr NWidgetPart | _nested_station_graph_widgets [] |
| Widgets of the station graph window. | |
| static WindowDesc | _station_graph_desc (WindowPosition::Automatic, "graph_station", 0, 0, WindowClass::StationCargoGraph, WindowClass::StationView, {}, _nested_station_graph_widgets) |
| Window definition for the station graph window. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_performance_rating_detail_widgets |
| static WindowDesc | _performance_rating_detail_desc (WindowPosition::Automatic, "league_details", 0, 0, WindowClass::PerformanceDetail, WindowClass::None, {}, _nested_performance_rating_detail_widgets) |
| Window definition for the performance rating details window. | |
GUI that shows performance graphs.
Definition in file graph_gui.cpp.
| void InitializeGraphGui | ( | ) |
Definition at line 2341 of file graph_gui.cpp.
| std::unique_ptr< NWidgetBase > MakeCompanyButtonRowsGraphGUI | ( | ) |
Make a number of rows with buttons for each company for the performance rating detail window.
Pointer to function returning a nested widget.
Definition at line 2310 of file graph_gui.cpp.
References Brown, MakeCompanyButtonRows(), WID_PRD_COMPANY_FIRST, and WID_PRD_COMPANY_LAST.
|
static |
Construct a vertical list of buttons, one for each company.
Definition at line 119 of file graph_gui.cpp.
References Brown, EqualSize, GetSpriteSize(), Dimension::height, Normal, SPR_COMPANY_ICON, WidgetDimensions::unscaled, WID_GL_FIRST_COMPANY, WID_GL_LAST_COMPANY, and WWT_PANEL.
|
static |
Make a vertical list of panels for outputting score details.
Definition at line 2281 of file graph_gui.cpp.
References Brown, End, EqualSize, lengthof, to_underlying(), TimerGameEconomy::UsingWallclockUnits(), WID_PRD_SCORE_FIRST, WID_PRD_SCORE_LAST, and WWT_PANEL.
| void ShowCargoPaymentRates | ( | ) |
Definition at line 1526 of file graph_gui.cpp.
| void ShowCompanyValueGraph | ( | ) |
Definition at line 1225 of file graph_gui.cpp.
| void ShowDeliveredCargoGraph | ( | ) |
Definition at line 1114 of file graph_gui.cpp.
|
static |
Definition at line 156 of file graph_gui.cpp.
| void ShowIncomeGraph | ( | ) |
Definition at line 1062 of file graph_gui.cpp.
| void ShowIndustryProductionGraph | ( | WindowNumber | window_number | ) |
Definition at line 1930 of file graph_gui.cpp.
| void ShowOperatingProfitGraph | ( | ) |
Definition at line 1009 of file graph_gui.cpp.
| void ShowPerformanceHistoryGraph | ( | ) |
Definition at line 1173 of file graph_gui.cpp.
| void ShowPerformanceRatingDetail | ( | ) |
Definition at line 2336 of file graph_gui.cpp.
| void ShowStationGraph | ( | WindowNumber | window_number | ) |
Create a station graph window for a station.
| window_number | The station index. |
Definition at line 2272 of file graph_gui.cpp.
References _station_graph_desc, and AllocateWindowDescFront().
Referenced by StationViewWindow::OnClick().
| void ShowTownCargoGraph | ( | WindowNumber | window_number | ) |
Definition at line 2094 of file graph_gui.cpp.
|
static |
Bitmasks of company and cargo indices that shouldn't be drawn.
Definition at line 41 of file graph_gui.cpp.
Referenced by GraphLegendWindow::DrawWidget(), GraphLegendWindow::OnClick(), GraphLegendWindow::OnInvalidateData(), and BaseCompanyGraphWindow::UpdateStatistics().
|
staticconstexpr |
Definition at line 1485 of file graph_gui.cpp.
|
staticconstexpr |
Definition at line 1199 of file graph_gui.cpp.
|
staticconstexpr |
Definition at line 1088 of file graph_gui.cpp.
|
staticconstexpr |
Definition at line 136 of file graph_gui.cpp.
|
staticconstexpr |
Definition at line 1036 of file graph_gui.cpp.
|
staticconstexpr |
Definition at line 1887 of file graph_gui.cpp.
|
staticconstexpr |
Definition at line 982 of file graph_gui.cpp.
|
staticconstexpr |
Definition at line 1146 of file graph_gui.cpp.
|
staticconstexpr |
Definition at line 2315 of file graph_gui.cpp.
|
staticconstexpr |
Widgets of the station graph window.
Definition at line 2225 of file graph_gui.cpp.
|
staticconstexpr |
Definition at line 2051 of file graph_gui.cpp.
|
constexpr |
The biggest double that when cast to int64_t still fits in a int64_t.
Definition at line 47 of file graph_gui.cpp.
Referenced by BaseGraphWindow::GetValuesInterval().
|
static |
Used to determine if the previous point was drawn.
Definition at line 45 of file graph_gui.cpp.
Referenced by BaseGraphWindow::DrawGraph().