|
OpenTTD GameScript API 20251104-master-g6d5f150b3d
|
Class that handles league table related functions. More...
#include <script_league.hpp>
Public Types | |
| enum | LinkType : int { LINK_NONE , LINK_TILE , LINK_INDUSTRY , LINK_TOWN , LINK_COMPANY , LINK_STORY_PAGE } |
| The type of a link. More... | |
Static Public Member Functions | |
| static bool | IsValidLeagueTable (LeagueTableID table_id) |
| Check whether this is a valid league table ID. | |
| static bool | IsValidLeagueTableElement (LeagueTableElementID element_id) |
| Check whether this is a valid league table element ID. | |
| static LeagueTableID | New (Text *title, Text *header, Text *footer) |
| Create a new league table. | |
| static LeagueTableElementID | NewElement (LeagueTableID table, int rating, GSCompany::CompanyID company, Text *text, Text *score, LinkType link_type, int link_target) |
| Create a new league table element. | |
| static bool | UpdateElementData (LeagueTableElementID element, GSCompany::CompanyID company, Text *text, LinkType link_type, int link_target) |
| Update the attributes of a league table element. | |
| static bool | UpdateElementScore (LeagueTableElementID element, int rating, Text *score) |
| Create a new league table element. | |
| static bool | RemoveElement (LeagueTableElementID element) |
| Remove a league table element. | |
Static Public Attributes | |
| static constexpr LeagueTableID | LEAGUE_TABLE_INVALID = ::LeagueTableID::Invalid() |
| An invalid league table id. | |
| static constexpr LeagueTableElementID | LEAGUE_TABLE_ELEMENT_INVALID = ::LeagueTableElementID::Invalid() |
| An invalid league table element id. | |
Class that handles league table related functions.
To create a league table:
| enum GSLeagueTable::LinkType : int |
|
static |
Check whether this is a valid league table ID.
| table_id | The LeagueTableID to check. |
|
static |
Check whether this is a valid league table element ID.
| element_id | The LeagueTableElementID to check. |
|
static |
Create a new league table.
| title | League table title (can be either a raw string, or GSText object). |
| header | The optional header text for the table (null is allowed). |
| footer | The optional footer text for the table (null is allowed). |
|
static |
Create a new league table element.
| table | Id of the league table this element belongs to. |
| rating | Value that elements are ordered by. |
| company | Company to show the color blob for or COMPANY_INVALID. |
| text | Text of the element (can be either a raw string, or GSText object). |
| score | String representation of the score associated with the element (can be either a raw string, or GSText object). |
| link_type | Type of the referenced object. |
| link_target | Id of the referenced object. |
|
static |
Remove a league table element.
| element | Id of the element to update |
|
static |
Update the attributes of a league table element.
| element | Id of the element to update |
| company | Company to show the color blob for or COMPANY_INVALID. |
| text | Text of the element (can be either a raw string, or GSText object). |
| link_type | Type of the referenced object. |
| link_target | Id of the referenced object. |
|
static |
Create a new league table element.
| element | Id of the element to update |
| rating | Value that elements are ordered by. |
| score | String representation of the score associated with the element (can be either a raw string, or GSText object). |