Godot 4 · GDScript · Leaderboards & scores
get_table_config
Returns a table's dashboard config: sort order and whether period scores are enabled.
Signature
get_table_config(table_index: int) -> DictionaryWhat it does
Reads the locally cached dashboard config for that table, captured from the leaderboard block the server includes in its leaderboard responses. No network call. The client itself uses this config: on historic-only tables (periods_enabled = false) it skips submits that cannot beat the cached best, since the server would store nothing.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| table_index | int | required | Table number to read (1-based: 1, 2, 3…). |
How to call it
Call any time after tables_loaded to adapt your UI to the table's settings (e.g. show 'lower is better' for asc tables, or hide period tabs when periods are disabled).
Returns: Dictionary: {"sort_order": "asc"|"desc", "periods_enabled": bool}, the table's dashboard config captured from the server leaderboard responses. Defaults (desc / true) until the table has loaded at least once.
Example
var cfg := Gamdato.get_table_config(1)
if not cfg.periods_enabled:
hide_period_tabs()
print("sort: %s" % cfg.sort_order)Use cases
- Hide daily/weekly/monthly tabs on tables that only keep historic scores.
- Render an ascending (time-based) table with 'lower is better' labels.