RetroHub
This is the main class to interact with RetroHub. It is also the source of all information regarding the user’s library.
Constants
Type |
Name |
|---|---|
int version_major
Major version of RetroHub. A change in the major version number indicates a breaking change to RetroHub or Godot. Themes designed for a different major version are highly unlikely to work without significant modifications regarding RetroHub’s API or even Godot changes.
int version_minor
Minor version of RetroHub. A change in the minor version number indicates minor changes to RetroHub’s API. Themes designed for a different minor version are highly unlikely to work without some modifications regarding RetroHub’s API.
int version_patch
Patch version of RetroHub. A change in the patch version number indicates mostly bug fixes or new features implemented in a backwards-compatible way. Themes designed for a different patch version are expected to work without issues.
String version_extra
Extra information about the version, such as alpha or beta. On release versions, this is empty.
String version_str
Fully assembled version string, for convenience, in the format {major}.{minor}.{patch}{extra}.
Signals
app_initializing ()
Called only one time, when the app is initializing. Themes aren’t able to catch this signal.
app_closing ()
Called only one time, when the app is closing.
app_received_focus ()
Called when the app receives focus.
app_lost_focus ()
Called when the app loses focus.
app_returning (system_data: RetroHubSystemData, game_data: RetroHubGameData)
Called when the app is returning from a launched game. This signal is emitted after a full theme load cycle, notably after all the system_received and game_received signals have been emitted.
system_receive_start ()
Called when system data is about to be sent to the theme. This signal is emitted only if there’s system data available.
system_received (system_data: RetroHubSystemData)
Information about a RetroHubSystemData.
system_receive_end ()
Called when all system data has been sent. Game data will follow after this signal.
game_receive_start ()
Called when game data is about to be sent to the theme. This signal is emitted after all system data has been sent.
game_received (game_data: RetroHubGameData)
Information about a RetroHubGameData.
game_receive_end ()
Called when all game data has been sent. By this point, all information about the user’s gaming library has been sent.
Methods
Type |
Name |
|---|---|
void |
|
void |
|
void |
|
void |
void set_curr_game_data (game_data: RetroHubGameData)
Sets the currently selected game data. This is needed to launch games, but also so users can edit and/or scrape game information from RetroHub.
bool is_main_app ()
Returns whether the theme is running on the main app, or under the theme helper addon.
bool is_input_echo ()
Returns whether the current input event was generated by RetroHub. This is used to simulate echo events for controller inputs. This can be undesirable for some scenarios, so in that case, use this to ignore such events.
func _input(event):
if RetroHub.is_input_echo():
return
...
void quit ()
Request the app to quit. Theme configuration will be saved.
void launch_game ()
Launches the currently selected game. Must be set prior with set_curr_game_data. After this call, the theme will be unloaded, so this should be treated as an exit point where no more code from your theme will be executed.
void request_theme_reload ()
Requests RetroHub to fully reload your theme. This is useful if some major configuration was changed from the app, and it’s easier to reload the theme than to try to update it in place.