* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file league_base.h %LeagueTable base class. */
std::string header; ///< Text to show above the table
std::string footer; ///< Text to show below the table
/**
* We need an (empty) constructor so struct isn't zeroed (as C++ standard states)
*/
LeagueTable() { }
/**
* (Empty) destructor has to be defined else operator delete might be called with nullptr parameter
*/
~LeagueTable() { }
};
#endif /* LEAGUE_BASE_H */
src/league_cmd.cpp
➞
Show inline comments
new file 100644
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file league_cmd.cpp Handling of league tables. */
if (_current_company != OWNER_DEITY) return CMD_ERROR;
auto lte = LeagueTableElement::GetIfValid(element);
if (lte == nullptr) return CMD_ERROR;
if (flags & DC_EXEC) {
auto table = lte->table;
delete lte;
InvalidateWindowData(WC_COMPANY_LEAGUE, table);
}
return CommandCost();
}
src/league_cmd.h
➞
Show inline comments
new file 100644
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file league_cmd.h Command definitions related to league tables. */
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file league_gui.cpp GUI for league tables. */
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file league_gui.h League table GUI functions. */
#ifndef LEAGUE_GUI_H
#define LEAGUE_GUI_H
#include "league_type.h"
void ShowPerformanceLeagueTable();
void ShowScriptLeagueTable(LeagueTableID table);
void ShowFirstLeagueTable();
#endif /* LEAGUE_GUI_H */
src/league_type.h
➞
Show inline comments
new file 100644
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file league_type.h basic types related to league tables */
#ifndef LEAGUE_TYPE_H
#define LEAGUE_TYPE_H
/** Types of the possible link targets. */
enum LinkType : byte {
LT_NONE = 0, ///< No link
LT_TILE = 1, ///< Link a tile
LT_INDUSTRY = 2, ///< Link an industry
LT_TOWN = 3, ///< Link a town
LT_COMPANY = 4, ///< Link a company
LT_STORY_PAGE = 5, ///< Link a story page
};
typedef uint32 LinkTargetID; ///< Contains either tile, industry ID, town ID, story page ID or company ID
typedef uint8 LeagueTableID; ///< ID of a league table
struct LeagueTable;
static const LeagueTableID INVALID_LEAGUE_TABLE = 0xFF; ///< Invalid/unknown index of LeagueTable
typedef uint16 LeagueTableElementID; ///< ID of a league table element
struct LeagueTableElement;
static const LeagueTableElementID INVALID_LEAGUE_TABLE_ELEMENT = 0xFFFF; ///< Invalid/unknown index of LeagueTableElement
#endif /* LEAGUE_TYPE_H */
src/network/network_command.cpp
➞
Show inline comments
@@ -26,6 +26,7 @@
#include "../group_cmd.h"
#include "../industry_cmd.h"
#include "../landscape_cmd.h"
#include "../league_cmd.h"
#include "../misc_cmd.h"
#include "../news_cmd.h"
#include "../object_cmd.h"
src/saveload/CMakeLists.txt
➞
Show inline comments
@@ -19,6 +19,7 @@ add_files(
group_sl.cpp
industry_sl.cpp
labelmaps_sl.cpp
league_sl.cpp
linkgraph_sl.cpp
map_sl.cpp
misc_sl.cpp
src/saveload/league_sl.cpp
➞
Show inline comments
new file 100644
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file league_sl.cpp Code handling saving and loading of league tables */
* \li GSRoad::HasRoadType now correctly checks RoadType against RoadType
src/script/api/script_league.cpp
➞
Show inline comments
new file 100644
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file script_league.cpp Implementation of ScriptLeagueTable. */
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file script_league.hpp Everything to manipulate league tables. */
#ifndef SCRIPT_LEAGUE_HPP
#define SCRIPT_LEAGUE_HPP
#include "script_company.hpp"
#include "script_text.hpp"
#include "../../league_type.h"
/**
* Class that handles league table related functions.
*
* To create a league table:
* 1. Create the league table
* 2. Create league table elements that will be shown in the table in the order of their rating (higher=better).
*
* @api game
*/
class ScriptLeagueTable : public ScriptObject {
public:
/**
* The league table IDs.
*/
enum LeagueTableID {
LEAGUE_TABLE_INVALID = ::INVALID_LEAGUE_TABLE, ///< An invalid league table id.
};
/**
* The league table element IDs.
*/
enum LeagueTableElementID {
LEAGUE_TABLE_ELEMENT_INVALID = ::INVALID_LEAGUE_TABLE_ELEMENT, ///< An invalid league table element id.
};
/**
* The type of a link.
*/
enum LinkType : byte {
LINK_NONE = ::LT_NONE, ///< No link
LINK_TILE = ::LT_TILE, ///< Link a tile
LINK_INDUSTRY = ::LT_INDUSTRY, ///< Link an industry
LINK_TOWN = ::LT_TOWN, ///< Link a town
LINK_COMPANY = ::LT_COMPANY, ///< Link a company
LINK_STORY_PAGE = ::LT_STORY_PAGE, ///< Link a story page
WID_CPR_MATRIX_SCROLLBAR,///< Cargo list scrollbar.
};
/** Widget of the #CompanyLeagueWindow class. */
enum CompanyLeagueWidgets {
WID_CL_BACKGROUND, ///< Background of the window.
};
/** Widget of the #PerformanceRatingDetailWindow class. */
enum PerformanceRatingDetailsWidgets {
WID_PRD_SCORE_FIRST, ///< First entry in the score list.
src/widgets/league_widget.h
➞
Show inline comments
new file 100644
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file league_widget.h Types related to the graph widgets. */
#ifndef WIDGETS_LEAGUE_WIDGET_H
#define WIDGETS_LEAGUE_WIDGET_H
/** Widget of the #PerformanceLeagueWindow class. */
enum PerformanceLeagueWidgets {
WID_PLT_BACKGROUND, ///< Background of the window.
};
/** Widget of the #ScriptLeagueWindow class. */
enum ScriptLeagueWidgets {
WID_SLT_CAPTION, ///< Caption of the window.
WID_SLT_BACKGROUND, ///< Background of the window.