Skip to content

Library

Inherits: Node

Base class for Library implementations

Description

The Library class provides an interface for creating new library implementations. To create a new library, simply extend this class and implement its methods. When a Library node is added to the scene tree, it will automatically register itself with the global LibraryManager.

Properties

Type Name Default
LibraryManager LibraryManager
LibraryManager library_manager
String library_id
String store_id
Texture2D library_icon
bool supports_uninstall true
String logger_name library_id
int log_level 3
CustomLogger logger

Methods

Returns Signature
LibraryLaunchItem[] get_library_launch_items()
Library.InstallLocation[] get_available_install_locations(item: LibraryLaunchItem = null)
Library.InstallOption[] get_install_options(item: LibraryLaunchItem)
AppLifecycleHook[] get_app_lifecycle_hooks()
void install(item: LibraryLaunchItem)
void install_to(item: LibraryLaunchItem, location: Library.InstallLocation = null, options: Dictionary = {})
void update(item: LibraryLaunchItem)
bool has_update(item: LibraryLaunchItem)
void uninstall(item: LibraryLaunchItem)
void move(item: LibraryLaunchItem, to_location: Library.InstallLocation)

Property Descriptions

LibraryManager

LibraryManager LibraryManager

Note

There is currently no description for this property. Please help us by contributing one!

library_manager

LibraryManager library_manager

Note

There is currently no description for this property. Please help us by contributing one!

library_id

String library_id

Unique identifier for the library

store_id

String store_id

Optional store that this library is linked to

library_icon

Texture2D library_icon

Icon for library provider

supports_uninstall

bool supports_uninstall = true

Whether or not the library provider supports uninstalls

logger_name

String logger_name = library_id

Logger name used for debug messages

log_level

int log_level = 3

Log level of the logger.

logger

CustomLogger logger

Note

There is currently no description for this property. Please help us by contributing one!


Method Descriptions

get_library_launch_items()

LibraryLaunchItem[] get_library_launch_items()

Returns an array of available library launch items that this library provides. This method should be overriden in the child class. Example:

    func get_library_launch_items() -> Array[LibraryLaunchItem]:
            var item: LibraryLaunchItem = LibraryLaunchItem.new()
            item.name = "vkCube"
            item.command = "vkcube"
            item.args = []
            item.tags = ["vkcube"]
            item.installed = true

            return [item]

get_available_install_locations()

Library.InstallLocation[] get_available_install_locations(item: LibraryLaunchItem = null)

Returns an array of available install locations for this library provider. This method should be overridden in the child class. Example:

  func get_available_install_locations() -> Array[InstallLocation]:
      var location := InstallLocation.new()
      location.name = "/"
      return [location]

get_install_options()

Library.InstallOption[] get_install_options(item: LibraryLaunchItem)

Returns an array of install options for the given LibraryLaunchItem. Install options are arbitrary and are provider-specific. They allow the user to select things like the language of a game to install, etc. Example:

  func get_install_options(item: LibraryLaunchItem) -> Array[InstallOption]:
      var option := InstallOption.new()
      option.id = "lang"
      option.name = "Language"
      option.description = "Language of the game to install"
      option.values = ["english", "spanish"]
      option.value_type = TYPE_STRING
      return [option]

get_app_lifecycle_hooks()

AppLifecycleHook[] get_app_lifecycle_hooks()

This method should be overridden if the library requires executing callbacks at certain points in an app's lifecycle, such as when an app is starting or stopping.

install()

void install(item: LibraryLaunchItem)

Warning

This is deprecated

Installs the given library item. This method should be overriden in the child class, if it supports it.

install_to()

void install_to(item: LibraryLaunchItem, location: Library.InstallLocation = null, options: Dictionary = {})

Installs the given library item to the given location. This method should be overridden in the child class, if it supports it.

update()

void update(item: LibraryLaunchItem)

Updates the given library item. This method should be overriden in the child class, if it supports it.

has_update()

bool has_update(item: LibraryLaunchItem)

Should return true if the given library item has an update available

uninstall()

void uninstall(item: LibraryLaunchItem)

Uninstalls the given library item. This method should be overriden in the child class if it supports it.

move()

void move(item: LibraryLaunchItem, to_location: Library.InstallLocation)

Move the given library item to the given install location. This method should be overriden in the child class if it supports it.