MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / MenuClickGraphsOrLeague

Function MenuClickGraphsOrLeague

src/toolbar_gui.cpp:713–732  ·  view source on GitHub ↗

* Handle click on the entry in the Graphs or CompanyLeague. * * @param index Graph to show. * @return #CBF_NONE */

Source from the content-addressed store, hash-verified

711 * @return #CBF_NONE
712 */
713static CallBackFunction MenuClickGraphsOrLeague(int index)
714{
715 switch (index) {
716 case GRMN_OPERATING_PROFIT_GRAPH: ShowOperatingProfitGraph(); break;
717 case GRMN_INCOME_GRAPH: ShowIncomeGraph(); break;
718 case GRMN_DELIVERED_CARGO_GRAPH: ShowDeliveredCargoGraph(); break;
719 case GRMN_PERFORMANCE_HISTORY_GRAPH: ShowPerformanceHistoryGraph(); break;
720 case GRMN_COMPANY_VALUE_GRAPH: ShowCompanyValueGraph(); break;
721 case GRMN_CARGO_PAYMENT_RATES: ShowCargoPaymentRates(); break;
722 case LTMN_PERFORMANCE_LEAGUE: ShowPerformanceLeagueTable(); break;
723 case LTMN_PERFORMANCE_RATING: ShowPerformanceRatingDetail(); break;
724 case LTMN_HIGHSCORE: ShowHighscoreTable(); break;
725 default: {
726 if (LeagueTable::IsValidID(index)) {
727 ShowScriptLeagueTable((LeagueTableID)index);
728 }
729 }
730 }
731 return CBF_NONE;
732}
733
734
735

Callers

nothing calls this directly

Calls 10

ShowOperatingProfitGraphFunction · 0.85
ShowIncomeGraphFunction · 0.85
ShowDeliveredCargoGraphFunction · 0.85
ShowCompanyValueGraphFunction · 0.85
ShowCargoPaymentRatesFunction · 0.85
ShowHighscoreTableFunction · 0.85
ShowScriptLeagueTableFunction · 0.85

Tested by

no test coverage detected