### Install Method Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.InstallController.html Starts the game installation process using the provided installation arguments. ```APIDOC ## Install(InstallActionArgs) ### Description Start installation. ### Parameters #### args InstallActionArgs - **args** (InstallActionArgs) - Description not available ``` -------------------------------- ### Install Method Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.InstallController.html Abstract method to start the game installation process. Implementations must define the actual installation logic. ```csharp public abstract void Install(InstallActionArgs args)__ ``` -------------------------------- ### Basic Startup Script Example Source: https://api.playnite.link/docs/manual/features/scriptingSupport/startupScript.html This script starts a game executable and waits for it to exit. It's a fundamental example for managing game processes. ```powershell $process = [System.Diagnostics.Process]::Start("game.exe") $process.WaitForExit() $process.Dispose() ``` -------------------------------- ### InstallationStatus Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets the current installation state of the game. ```csharp public InstallationStatus InstallationStatus { get; }__ ``` -------------------------------- ### InstallDirectory Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets the installation directory path for the game. ```APIDOC ## InstallDirectory ### Description Gets or sets game installation directory path. ### Property Value string ``` -------------------------------- ### InstallationFile Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.EmulatorDefinitionProfile.html Gets or sets the path to the emulator's installation file. ```csharp public string InstallationFile { get; set; }__ ``` -------------------------------- ### InstallSize Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets the install size of the game in bytes. ```APIDOC ## InstallSize ### Description Gets or sets the install size in bytes of the game. ### Property Value ulong? ``` -------------------------------- ### InstallDirectory Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.GameMetadata.html Gets or sets installation directory. This property is of type string. ```csharp public string InstallDirectory { get; set; }__ ``` -------------------------------- ### Example: Create New Desktop Theme Source: https://api.playnite.link/docs/tutorials/themes/usingBlend.html This is an example of creating a new desktop theme named 'Super Clear Modern'. Ensure you are in Playnite's installation directory when running this command. ```bash Toolbox.exe new desktoptheme "Super Clear Modern" ``` -------------------------------- ### Install Game Source: https://api.playnite.link/docs/api/Playnite.SDK.IPlayniteAPI.html Initiates the installation process for a game identified by its unique ID. ```csharp void InstallGame(Guid gameId) ``` -------------------------------- ### Example: Create New Desktop Theme Source: https://api.playnite.link/docs/tutorials/toolbox.html This is an example of creating a new desktop theme named 'New Desktop Theme'. ```bash Toolbox.exe new desktoptheme "New Desktop Theme" ``` -------------------------------- ### Example: Create New Metadata Plugin Source: https://api.playnite.link/docs/tutorials/toolbox.html This is an example of creating a new MetadataPlugin named 'GameDatabase metadata provider' in the 'd:\\somefolder' directory. ```bash Toolbox.exe new MetadataPlugin "GameDatabase metadata provider" "d:\\somefolder" ``` -------------------------------- ### GetInstallActions Method Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.Plugin.html Returns a collection of install controllers for managing game installations. ```csharp public virtual IEnumerable GetInstallActions(GetInstallActionsArgs args)__ ``` -------------------------------- ### InstallGame Source: https://api.playnite.link/docs/api/Playnite.SDK.IPlayniteAPI.html Initiates the installation process for a specified game. ```APIDOC ## InstallGame(Guid) ### Description Installs the specified game. ### Method ``` void InstallGame(Guid gameId) ``` ### Parameters - **gameId** (Guid) - The unique identifier of the game to install. ``` -------------------------------- ### Get Extension List Source: https://api.playnite.link/docs/api/Playnite.SDK.BuiltinExtensions.html Gets a dictionary containing all built-in extension plugins, keyed by their GUID. ```csharp public static Dictionary ExtensionList { get; } ``` -------------------------------- ### Get Installed Addons Source: https://api.playnite.link/docs/api/Playnite.SDK.IAddons.html Retrieves a list of IDs for all currently installed addons. ```csharp List Addons { get; }__ ``` -------------------------------- ### IsInstalling Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets a value indicating whether the game is currently being installed. ```APIDOC ## IsInstalling ### Description Gets or sets value indicating whether a game is being installed. ### Property Value bool ``` -------------------------------- ### Example: Pack Theme Extension Source: https://api.playnite.link/docs/tutorials/toolbox.html This is an example of packing a theme extension located at 'C:\\Playnite\\Themes\\Fullscreen\\TestingFullscreen' into the 'c:\\somefolder' directory. This will create a 'TestingFullscreen.pthm' package. ```bash Toolbox.exe pack "C:\\Playnite\\Themes\\Fullscreen\\TestingFullscreen" "c:\\somefolder" ``` -------------------------------- ### IsInstalling Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets a value indicating whether the game is currently being installed. ```csharp public bool IsInstalling { get; set; }__ ``` -------------------------------- ### IsInstalled Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets a value indicating whether the game is installed. ```APIDOC ## IsInstalled ### Description Gets or sets value indicating whether a game is installed. ### Property Value bool ``` -------------------------------- ### InstallSizeGroup Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets the install size group category for the game. ```csharp public InstallSizeGroup InstallSizeGroup { get; }__ ``` -------------------------------- ### Script Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.GameAction.html Gets or sets the startup script. ```csharp public string Script { get; set; } ``` -------------------------------- ### InstallSize Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.GameMetadata.html Gets or sets install size in bytes of the game. This property is of type ulong? (nullable unsigned long). ```csharp public ulong? InstallSize { get; set; }__ ``` -------------------------------- ### On Game Installed Event Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.Plugin.html Callback method invoked after a game has been successfully installed. ```csharp public virtual void OnGameInstalled(OnGameInstalledEventArgs args)__ ``` -------------------------------- ### PreScript Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.EmulatorProfile.html Gets or sets the script to be executed before the emulator process starts. ```csharp public string PreScript { get; set; } ``` -------------------------------- ### On Game Started Event Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.Plugin.html Callback method invoked when a game has successfully started running. ```csharp public virtual void OnGameStarted(OnGameStartedEventArgs args)__ ``` -------------------------------- ### SwapStartDetailsAction Source: https://api.playnite.link/docs/api/Playnite.SDK.IFullscreenSettingsAPI.html Gets a value indicating whether the start and details actions are swapped in fullscreen mode. ```APIDOC ## SwapStartDetailsAction ### Description Gets a value indicating whether the start and details actions are swapped in fullscreen mode. ### Property - **SwapStartDetailsAction** (bool) - Read-only ### Property Value - bool ``` -------------------------------- ### Verify Extension Manifest Source: https://api.playnite.link/docs/tutorials/toolbox.html Use this command to verify extension manifests. Specify the manifest type ('addon' or 'installer') and the path to the manifest file. 'addon' type also verifies linked installer manifests. ```bash Toolbox.exe verify ``` -------------------------------- ### GetInstallActions Method Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.Plugin.html Retrieves a list of install controllers for the plugin. ```APIDOC ## GetInstallActions(GetInstallActionsArgs) ### Parameters * **args** (GetInstallActionsArgs) ### Returns * **IEnumerable** ``` -------------------------------- ### InstallationStatus Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Retrieves the current installation state of the game. ```APIDOC ## InstallationStatus ### Description Gets game installation state. ### Property Value InstallationStatus ``` -------------------------------- ### On Application Started Event Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.Plugin.html Callback method invoked when the Playnite application has started and completed its initialization. ```csharp public virtual void OnApplicationStarted(OnApplicationStartedEventArgs args)__ ``` -------------------------------- ### OnGameStarting Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.Plugin.html Callback method invoked just before a game is started. ```APIDOC ## OnGameStarting ### Description Called before game is started. ### Method POST (Assumed for event callbacks) ### Endpoint (Not explicitly defined, assumed to be part of the plugin's API surface) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **args** (OnGameStartingEventArgs) - Event arguments containing information about the game about to start. ### Request Example None ### Response #### Success Response None #### Response Example None ``` -------------------------------- ### SwapStartDetailsAction Property Source: https://api.playnite.link/docs/api/Playnite.SDK.IFullscreenSettingsAPI.html Gets a value indicating whether the Start and Details actions are swapped in fullscreen mode. ```csharp bool SwapStartDetailsAction { get; } ``` -------------------------------- ### Example: Create New PowerShell Script Source: https://api.playnite.link/docs/tutorials/toolbox.html This is an example of creating a new PowerShell script named 'Testing Script' in the 'd:\\somefolder' directory. ```bash Toolbox.exe new PowerShellScript "Testing Script" "d:\\somefolder" ``` -------------------------------- ### On Game Installation Cancelled Event Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.Plugin.html Callback method invoked when a game installation process has been cancelled. ```csharp public virtual void OnGameInstallationCancelled(OnGameInstallationCancelledEventArgs args)__ ``` -------------------------------- ### GameInstalledEventArgs InstalledInfo Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.GameInstalledEventArgs.html Gets or sets the data for the newly installed game. This property holds GameInstallationData. ```csharp public GameInstallationData InstalledInfo { get; set; }__ ``` -------------------------------- ### Start Application Before Game Source: https://api.playnite.link/docs/manual/features/scriptingSupport/exampleScripts.html Use this script to start an external application before a game launches. You can optionally minimize the application window. ```powershell Start-Process -FilePath "c:\somepath\someapp.exe" -ArgumentList "-some arguments" ``` -------------------------------- ### GameStartedScript Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets the script to be executed after a game starts. ```APIDOC ## GameStartedScript ### Description Gets or sets script to be executed after game started. ### Property Value string ``` -------------------------------- ### Localization Resource Dictionary Example Source: https://api.playnite.link/docs/tutorials/themes/localizations.html Example of a XAML ResourceDictionary file for localization. It defines default strings, including one that spans multiple lines. ```xml Test string Test string on multiple lines ``` -------------------------------- ### Manual Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets the game manual. ```APIDOC ## Manual ### Description Gets or sets game manual. ### Property Value string ``` -------------------------------- ### Start External Backup Source: https://api.playnite.link/docs/manual/library/backup.html Initiates an external backup process using a specified configuration file. Ensure the configuration file contains the necessary properties for backup. ```command-line Playnite.DesktopApp.exe --backup "c:\test\backup_config.json" ``` -------------------------------- ### SourceId Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets the GUID representing the source of the game. ```APIDOC ## Property: SourceId ### Description Gets or sets source of the game. ### Property Value Guid ``` -------------------------------- ### Handle Game Started Event (C#) Source: https://api.playnite.link/docs/tutorials/extensions/events.html Override the OnGameStarted method in your C# plugin to log the name of the game that just started. ```csharp public override void OnGameStarted(OnGameStartedEventArgs args) { logger.Info($"Game started: {args.Game.Name}"); } ``` -------------------------------- ### Start Application Only If Not Running Source: https://api.playnite.link/docs/manual/features/scriptingSupport/exampleScripts.html This script checks if an application is currently running using Get-Process. If it's not running, you can then combine it with the starting script from the previous example. ```powershell if (!(Get-Process -Name "someapp" -EA 0)) { # Process is not running. Combine with previous section } else { # Process is running. Combine with previous section } ``` -------------------------------- ### Create MetadataFile with Name, Data, and Original URL Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.MetadataFile.html Demonstrates creating a MetadataFile instance with a file name, content, and the original source URL. ```csharp public MetadataFile(string name, byte[] data, string originalUrl)__ ``` -------------------------------- ### OnGameStartingEventArgs Source: https://api.playnite.link/docs/api/Playnite.SDK.Events.OnGameStartingEventArgs.html Arguments for the game starting event. ```APIDOC ## Class OnGameStartingEventArgs Namespace Playnite.SDK.Events Assembly Playnite.SDK.dll Represents arguments for the event when a game is starting. ### Properties #### CancelStartup Gets or sets value indicating whether game startup should be interrupted. - **Type**: bool - **Access**: public bool { get; set; } #### Game Gets game object initiating the event. - **Type**: Game - **Access**: public Game { get; } #### SelectedRomFile Gets ROM file selected when running a game with multiple ROMs assigned. - **Type**: string - **Access**: public string { get; } #### SourceAction Gets custom game action used to start the game. - **Type**: GameAction - **Access**: public GameAction { get; } ``` -------------------------------- ### Script Extension Manifest Example Source: https://api.playnite.link/docs/tutorials/extensions/extensionsManifest.html Example of a YAML manifest file for a Playnite script extension. Ensure the Module property points to the correct script file. ```yaml Id: LibraryExporter_Playnite_Script Name: Library Exporter Author: Playnite Version: 1.0 Module: LibraryExporter.psm1 Type: Script Links: - Name: Website Url: https://some.website.nowhere ``` -------------------------------- ### StartGame Source: https://api.playnite.link/docs/api/Playnite.SDK.IPlayniteAPI.html Launches the specified game. ```APIDOC ## StartGame(Guid) ### Description Starts the specified game. ### Method ``` void StartGame(Guid gameId) ``` ### Parameters - **gameId** (Guid) - The unique identifier of the game to start. ``` -------------------------------- ### Create MetadataFile with Path Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.MetadataFile.html Shows how to create a MetadataFile instance by providing the source path (URL, URI, or system path). ```csharp public MetadataFile(string path)__ ``` -------------------------------- ### GameStartedScript Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets the script to be executed after a game starts. ```csharp public string GameStartedScript { get; set; }__ ``` -------------------------------- ### StartupArguments Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.EmulatorDefinitionProfile.html Gets or sets the arguments to be passed to the emulator on startup. ```csharp public string StartupArguments { get; set; }__ ``` -------------------------------- ### StartedProcessId Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.GameStartedEventArgs.html Gets or sets the process ID of the started game. ```csharp public int StartedProcessId { get; set; }__ ``` -------------------------------- ### OnGameStarted Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.Plugin.html Callback method invoked when a game has started running. ```APIDOC ## OnGameStarted ### Description Called when game has started. ### Method POST (Assumed for event callbacks) ### Endpoint (Not explicitly defined, assumed to be part of the plugin's API surface) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **args** (OnGameStartedEventArgs) - Event arguments containing information about the started game. ### Request Example None ### Response #### Success Response None #### Response Example None ``` -------------------------------- ### TrackingFrequency Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.GameAction.html Gets or sets the delay in milliseconds before tracking starts. ```csharp public int TrackingFrequency { get; set; } ``` -------------------------------- ### Start Game Source: https://api.playnite.link/docs/api/Playnite.SDK.IPlayniteAPI.html Launches a game identified by its unique ID. ```csharp void StartGame(Guid gameId) ``` -------------------------------- ### InitialTrackingDelay Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.GameAction.html Gets or sets the delay in milliseconds before tracking starts. ```csharp public int InitialTrackingDelay { get; set; } ``` -------------------------------- ### OnGameInstalled Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.Plugin.html Callback method invoked when a game has been successfully installed. ```APIDOC ## OnGameInstalled ### Description Called when game has been installed. ### Method POST (Assumed for event callbacks) ### Endpoint (Not explicitly defined, assumed to be part of the plugin's API surface) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **args** (OnGameInstalledEventArgs) - Event arguments containing information about the installed game. ### Request Example None ### Response #### Success Response None #### Response Example None ``` -------------------------------- ### SeriesIds Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets a list of GUIDs representing the game series. ```APIDOC ## Property: SeriesIds ### Description Gets or sets game series. ### Property Value List ``` -------------------------------- ### Source Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets the source of the game. ```csharp public GameSource Source { get; }__ ``` -------------------------------- ### Library Plugin Manifest Example Source: https://api.playnite.link/docs/tutorials/extensions/extensionsManifest.html Example of a YAML manifest file for a Playnite library plugin extension. The Icon property is optional and specifies a relative path to the extension's icon. ```yaml Id: SomeLibraryPlugin_Playnite_Plugin Name: Some Library Plugin Author: Playnite Version: 1.0 Module: SomeLibraryPlugin.dll Type: GameLibrary Icon: pluginicon.png Links: - Name: Website Url: https://some.website.nowhere ``` -------------------------------- ### InstallSizeGroup Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Retrieves the install size group for the game. ```APIDOC ## InstallSizeGroup ### Description Gets game's install size group. ### Property Value InstallSizeGroup ``` -------------------------------- ### InstallController Constructor Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.InstallController.html Initializes a new instance of the InstallController class. Requires a Game object to be passed. ```csharp public InstallController(Game game)__ ``` -------------------------------- ### InitialTrackingDelay Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.AutomaticPlayController.html Gets or sets delay in milliseconds before tracking actually starts. ```APIDOC ## InitialTrackingDelay ### Description Gets or sets delay in milliseconds before tracking actually starts. ### Property Value (int) - The delay in milliseconds. ``` -------------------------------- ### Platform.Empty Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Platform.html Gets the default empty platform instance. ```APIDOC ## Platform.Empty ### Description Gets empty platform. ### Method Field Accessor ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response - **Platform** (Platform) - The empty platform instance. ``` -------------------------------- ### StartupExecutable Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.EmulatorDefinitionProfile.html Gets or sets the path to the emulator's startup executable. ```csharp public string StartupExecutable { get; set; }__ ``` -------------------------------- ### TagIds Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets a list of GUIDs representing the tags associated with the game. ```APIDOC ## Property: TagIds ### Description Gets or sets list of tags. ### Property Value List ``` -------------------------------- ### InstallController Constructor Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.InstallController.html Creates a new instance of the InstallController class, initializing it with a specific game. ```APIDOC ## InstallController(Game) ### Description Creates new instance of InstallController. ### Parameters #### game Game - **game** (Game) - Description not available ``` -------------------------------- ### ScriptStartup Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.EmulatorDefinitionProfile.html Gets or sets a value indicating whether to use scripts for startup. ```csharp public bool ScriptStartup { get; set; }__ ``` -------------------------------- ### RegionIds Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets a list of GUIDs representing the game's regions. ```APIDOC ## Property: RegionIds ### Description Gets or sets game region. ### Property Value List ``` -------------------------------- ### Startup Script with Cancellation Handling Source: https://api.playnite.link/docs/manual/features/scriptingSupport/startupScript.html This script demonstrates how to handle user cancellation requests during a game session. It continuously checks for cancellation and process status, allowing for graceful exit. ```powershell #WaitForExit() is synchronous check so it can't be used if you want to support session cancellation $process = [System.Diagnostics.Process]::Start("game.exe") while ($true) { # Check if user cancelled game session if ($CancelToken.IsCancellationRequested) { break } # Check if process is still running if (!(Get-Process -Name "game" -EA 0)) { break } # Sleep for a while to not waste CPU Start-Sleep -s 1 } $process.Dispose() ``` -------------------------------- ### PublisherIds Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets a list of GUIDs representing the publishers associated with the game. ```APIDOC ## Property: PublisherIds ### Description Gets or sets list of publishers. ### Property Value List ``` -------------------------------- ### On Game Starting Event Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.Plugin.html Callback method invoked just before a game is launched. ```csharp public virtual void OnGameStarting(OnGameStartingEventArgs args)__ ``` -------------------------------- ### LastSizeScanDate Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets the date of the last scan for the game's install size. ```APIDOC ## LastSizeScanDate ### Description Gets or sets date of last date of install size scan made to a game. ### Property Value DateTime? ``` -------------------------------- ### LastSizeScanDate Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets the date of the last install size scan for the game. ```csharp public DateTime? LastSizeScanDate { get; set; }__ ``` -------------------------------- ### InstallationDirectory Variable Source: https://api.playnite.link/docs/api/Playnite.SDK.ExpandableVariables.html Represents the full path to the game's installation directory. Essential for accessing game files. ```csharp public const string InstallationDirectory = "{InstallDir}" ``` -------------------------------- ### Create MetadataFile with Name and Data Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.MetadataFile.html Illustrates creating a MetadataFile by specifying the file name and its content as a byte array. ```csharp public MetadataFile(string name, byte[] data)__ ``` -------------------------------- ### PreScript Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets the pre-action script for a game. This script is executed before the game starts. ```APIDOC ## Property: PreScript ### Description Gets or sets pre-action script. ### Property Value string ``` -------------------------------- ### Hint Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.SearchContext.html Gets or sets the search hint. ```csharp public string Hint { get; set; } ``` -------------------------------- ### MetadataIdProperty Id Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.MetadataIdProperty.html Gets the unique identifier (GUID) of the referenced database object. ```csharp public Guid Id { get; } ``` -------------------------------- ### OnApplicationStarted Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.Plugin.html Callback method invoked when the application has started and completed its initialization. ```APIDOC ## OnApplicationStarted ### Description Called when application is started and initialized. ### Method POST (Assumed for event callbacks) ### Endpoint (Not explicitly defined, assumed to be part of the plugin's API surface) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **args** (OnApplicationStartedEventArgs) - Event arguments containing information about the application start. ### Request Example None ### Response #### Success Response None #### Response Example None ``` -------------------------------- ### GetInstallActionsArgs Class Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.GetInstallActionsArgs.html Represents the arguments passed when requesting installation actions. It contains a reference to the Game object for which the actions are being requested. ```APIDOC ## Class GetInstallActionsArgs Namespace Playnite.SDK.Plugins Assembly Playnite.SDK.dll ```csharp public class GetInstallActionsArgs ``` ### Properties #### Game ```csharp public Game Game { get; set; } ``` **Description:** The Game object for which installation actions are being requested. **Type:** Game ``` -------------------------------- ### CustomEmulatorProfile.Platforms Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.CustomEmulatorProfile.html Gets or sets the platforms supported by the profile. This property is a List of Guids. ```csharp public List Platforms { get; set; } ``` -------------------------------- ### GuideButtonFocus Source: https://api.playnite.link/docs/api/Playnite.SDK.IFullscreenSettingsAPI.html Gets a value indicating whether the guide button has focus in fullscreen mode. ```APIDOC ## GuideButtonFocus ### Description Gets a value indicating whether the guide button has focus in fullscreen mode. ### Property - **GuideButtonFocus** (bool) - Read-only ### Property Value - bool ``` -------------------------------- ### Get ID from Extension Source: https://api.playnite.link/docs/api/Playnite.SDK.BuiltinExtensions.html Determines the unique GUID for a given built-in extension object. ```csharp public static Guid GetIdFromExtension(BuiltinExtension extension) ``` -------------------------------- ### Implement Automatic Play Action Source: https://api.playnite.link/docs/tutorials/extensions/gameActions.html Use AutomaticPlayController to simplify play action handling when no special game startup logic is required. This example shows how to configure a 'Notepad' play action. ```csharp public override IEnumerable GetPlayActions(GetPlayActionsArgs args) { yield return new AutomaticPlayController(args.Game) { Type = GenericPlayActionType.File, TrackingMode = TrackingMode.Process, Name = "Notepad", Path = "notepad.exe" }; } ``` -------------------------------- ### Create WebView with Settings Source: https://api.playnite.link/docs/api/Playnite.SDK.IWebViewFactory.html Creates a new standard web view instance with specified WebViewSettings. This method allows for detailed configuration of the web view. ```csharp IWebView CreateView(WebViewSettings settings) ``` -------------------------------- ### UseGlobalGameStartedScript Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets a value indicating whether the global game started script should be executed. ```APIDOC ## Property: UseGlobalGameStartedScript ### Description Gets or sets value indicating whether global pre script should be executed. ### Property Value bool ``` -------------------------------- ### Create New Desktop or Fullscreen Theme Source: https://api.playnite.link/docs/tutorials/themes/usingBlend.html Use this command to generate the basic file structure for a new desktop or fullscreen theme. Replace `` with your desired theme's name. ```bash Toolbox.exe new desktoptheme|fullscreentheme ``` -------------------------------- ### GuideButtonFocus Property Source: https://api.playnite.link/docs/api/Playnite.SDK.IFullscreenSettingsAPI.html Gets a value indicating whether the Guide button has focus in fullscreen mode. ```csharp bool GuideButtonFocus { get; } ``` -------------------------------- ### Troubleshoot Start-Process Wildcard Issues Source: https://api.playnite.link/docs/tutorials/extensions/scripting.html Avoid issues with wildcard characters in paths when starting processes. Use .NET classes directly for literal path execution. ```powershell # Instead of: Start-Process "game.exe" # call .NET class directly: [System.Diagnostics.Process]::Start("game.exe") ``` -------------------------------- ### Get Extension by ID Source: https://api.playnite.link/docs/api/Playnite.SDK.BuiltinExtensions.html Retrieves a specific built-in extension plugin using its unique GUID. ```csharp public static BuiltinExtension GetExtensionFromId(Guid id) ``` -------------------------------- ### Start External Restore Source: https://api.playnite.link/docs/manual/library/backup.html Initiates an external restore process using a specified configuration file. The configuration file must define the backup file and target directories for restoration. ```command-line Playnite.DesktopApp.exe --restorebackup "c:\test\restore_config.json" ``` -------------------------------- ### OverrideInstallState Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets a value indicating whether to ignore the installation state set by an integration plugin. ```APIDOC ## OverrideInstallState ### Description Gets or sets value indicating whether installation state set by integration plugin should be ignored. ### Property Value bool ``` -------------------------------- ### Open Method Source: https://api.playnite.link/docs/api/Playnite.SDK.IWebView.html Opens the web view. ```csharp void Open() ``` -------------------------------- ### Example Library Plugin Implementation Source: https://api.playnite.link/docs/tutorials/extensions/libraryPlugins.html This C# code demonstrates a basic implementation of a Playnite library plugin, including setting unique IDs, names, and game metadata. ```csharp public class LibraryPlugin : LibraryPlugin { public override Guid Id { get; } = Guid.Parse("D625A3B7-1AA4-41CB-9CD7-74448D28E99B"); public override string Name { get; } = "Test Library"; public TestGameLibrary(IPlayniteAPI api) : base (api) { Properties = new LibraryPluginProperties { CanShutdownClient = true, HasSettings = true }; } public override IEnumerable GetGames() { return new List() { new GameMetadata() { Name = "Some App", GameId = "some_app_id", GameActions = new List { new GameAction { Type = GameActionType.File, Path = "c:\\some_path\\app.exe", IsPlayAction = true } }, IsInstalled = true, Icon = new MetadataFile(@"c:\\some_path\\app.exe") }, new GameMetadata() { Name = "Calculator", GameId = "calc", GameActions = new List { new GameAction { Type = GameActionType.File, Path = "calc.exe", IsPlayAction = true } }, IsInstalled = true, Icon = new MetadataFile(@"https://playnite.link/applogo.png"), BackgroundImage = new MetadataFile(@"https://playnite.link/applogo.png") } }; } } ``` -------------------------------- ### UseGlobalGameStartedScript Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets a value indicating whether the global game started script should be executed. ```csharp public bool UseGlobalGameStartedScript { get; set; }__ ``` -------------------------------- ### OverrideInstallState Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Models.Game.html Gets or sets a value indicating whether the installation state set by an integration plugin should be ignored. ```csharp public bool OverrideInstallState { get; set; }__ ``` -------------------------------- ### Play Method Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.AutomaticPlayController.html Overrides the Play method from the base class to handle game startup. ```csharp public override void Play(PlayActionArgs args) ``` -------------------------------- ### StartedProcessId Property Source: https://api.playnite.link/docs/api/Playnite.SDK.Events.OnGameStartedEventArgs.html Gets the process ID of the started game. This may not always be accurate depending on how the game was launched. ```csharp public int StartedProcessId { get; } ``` -------------------------------- ### GetInstallSize Method Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.OnDemandMetadataProvider.html Retrieves the install size for a game. Requires GetMetadataFieldArgs to specify the context. ```csharp public virtual ulong? GetInstallSize(GetMetadataFieldArgs args)__ ``` -------------------------------- ### Getting Active Filter Preset ID Source: https://api.playnite.link/docs/api/Playnite.SDK.IMainViewAPI.html Retrieves the unique identifier (Guid) of the currently active filter preset. ```csharp Guid GetActiveFilterPreset() ``` -------------------------------- ### InstallActionArgs Constructor Source: https://api.playnite.link/docs/api/Playnite.SDK.Plugins.InstallActionArgs.html Initializes a new instance of the InstallActionArgs class. ```APIDOC ## InstallActionArgs() ### Description Initializes a new instance of the InstallActionArgs class. ### Method InstallActionArgs() ### Parameters None ``` -------------------------------- ### Create and Show a Custom Window with XAML Content (PowerShell) Source: https://api.playnite.link/docs/tutorials/extensions/windows.html This PowerShell snippet demonstrates creating a custom window with content defined in XAML. It includes setting window properties, loading XAML content, setting the data context to selected games, and attaching a click event handler to a button within the XAML. ```powershell $windowCreationOptions = New-Object Playnite.SDK.WindowCreationOptions $windowCreationOptions.ShowMinimizeButton = $false $window = $PlayniteApi.Dialogs.CreateWindow($windowCreationOptions); $window.Height = 768; $window.Width = 768; $window.Title = "Some title"; # Set content of a window. Can be loaded from xaml, loaded from UserControl or created from code behind [xml]$xaml = @"