Skip to content

PerformanceManager

Inherits: Resource

Manages, sets, and loads performance profiles

Description

The PerformanceManager is responsible for applying the appropriate performance profile when games launch and when the device is plugged in or unplugged.

Properties

Type Name Default
UPowerDevice display_device
PerformanceProfile current_profile
int current_profile_state
CustomLogger logger

Methods

Returns Signature
String get_profile_filename(profile_state: int, library_item: LibraryLaunchItem = null)
void save_profile(profile: PerformanceProfile, profile_path: String, library_item: LibraryLaunchItem = null)
PerformanceProfile create_profile(library_item: LibraryLaunchItem = null)
PerformanceProfile load_profile(profile_path: String)
PerformanceProfile load_or_create_profile(profile_path: String, library_item: LibraryLaunchItem = null)
void apply_profile(profile: PerformanceProfile)
void apply_and_save_profile(profile: PerformanceProfile)
int get_profile_state()
int get_profile_state_from_battery(battery: UPowerDevice)
PackedStringArray get_power_profiles_available()

Property Descriptions

display_device

UPowerDevice display_device

Note

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

current_profile

PerformanceProfile current_profile

Note

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

current_profile_state

int current_profile_state

Note

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

logger

CustomLogger logger

Note

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


Method Descriptions

get_profile_filename()

String get_profile_filename(profile_state: int, library_item: LibraryLaunchItem = null)

Returns a profile filename generated from the given profile state and library item. E.g. "Bravo_15_A4DDR_docked_default_profile.tres"

save_profile()

void save_profile(profile: PerformanceProfile, profile_path: String, library_item: LibraryLaunchItem = null)

Saves the given PerformanceProfile to the given path. If a library item is passed, the user's settings will be updated to use the given profile.

create_profile()

PerformanceProfile create_profile(library_item: LibraryLaunchItem = null)

Create a new PerformanceProfile from the current performance settings. If a library item is passed, the profile will be named after the library item.

load_profile()

PerformanceProfile load_profile(profile_path: String)

Loads a PerformanceProfile from the given path. Returns null if the profile fails to load.

load_or_create_profile()

PerformanceProfile load_or_create_profile(profile_path: String, library_item: LibraryLaunchItem = null)

Loads a PerformanceProfile from the given path. If the profile does not exist, it will create a new profile using the currently applied performance settings.

apply_profile()

void apply_profile(profile: PerformanceProfile)

Applies the given performance profile to the system

apply_and_save_profile()

void apply_and_save_profile(profile: PerformanceProfile)

Applies the given performance profile to the system and saves it based on the current profile state (e.g. docked or undocked) and current running app.

get_profile_state()

int get_profile_state()

Returns the current profile state. I.e. whether or not the "docked" or "undocked" performance profiles should be used.

get_profile_state_from_battery()

int get_profile_state_from_battery(battery: UPowerDevice)

Returns the current profile state. I.e. whether or not the "docked" or "undocked" performance profiles should be used.

get_power_profiles_available()

PackedStringArray get_power_profiles_available()

Note

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