OpenTTD GameScript API
20241127-master-ge7c63de55d
|
Class that handles league table related functions. More...
Public Types | |
enum | LeagueTableID { LEAGUE_TABLE_INVALID } |
The league table IDs. More... | |
enum | LeagueTableElementID { LEAGUE_TABLE_ELEMENT_INVALID } |
The league table element IDs. More... | |
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. More... | |
static bool | IsValidLeagueTableElement (LeagueTableElementID element_id) |
Check whether this is a valid league table element ID. More... | |
static LeagueTableID | New (Text *title, Text *header, Text *footer) |
Create a new league table. More... | |
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. More... | |
static bool | UpdateElementData (LeagueTableElementID element, GSCompany::CompanyID company, Text *text, LinkType link_type, int link_target) |
Update the attributes of a league table element. More... | |
static bool | UpdateElementScore (LeagueTableElementID element, int rating, Text *score) |
Create a new league table element. More... | |
static bool | RemoveElement (LeagueTableElementID element) |
Remove a league table element. More... | |
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 INVALID_COMPANY. |
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 INVALID_COMPANY. |
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). |