From 90528d01a0dc52375ab804a269c710ba26b785e8 Mon Sep 17 00:00:00 2001 From: David Tootill Date: Fri, 23 Aug 2024 12:09:38 -0700 Subject: [PATCH] Add overloads of Get...ActionOrigins() with an action set argument --- Facepunch.Steamworks/SteamInput.cs | 40 ++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/Facepunch.Steamworks/SteamInput.cs b/Facepunch.Steamworks/SteamInput.cs index 6414be1..e3ea710 100644 --- a/Facepunch.Steamworks/SteamInput.cs +++ b/Facepunch.Steamworks/SteamInput.cs @@ -88,7 +88,7 @@ ref origin /// - /// Return an array of all origins mapped to the provided analog action + /// Return an array of all origins mapped to the provided analog action in the current action set /// /// public static InputActionOrigin[] GetAnalogActionOrigins( Controller controller, string action ) @@ -105,6 +105,24 @@ ref origins[0] } + /// + /// Return an array of all origins mapped to the provided analog action in the specified action set + /// + /// + public static InputActionOrigin[] GetAnalogActionOrigins( Controller controller, string actionSet, string action ) + { + InputActionOrigin[] origins = new InputActionOrigin[STEAM_INPUT_MAX_ORIGINS]; + + Internal.GetAnalogActionOrigins( + controller.Handle, + Internal.GetActionSetHandle(actionSet), + GetAnalogActionHandle( action ), + ref origins[0] + ); + return origins; + } + + /// /// Return an absolute path to the PNG image glyph for the provided digital action name. The current /// action set in use for the controller will be used for the lookup. You should cache the result and @@ -130,7 +148,7 @@ ref origin /// - /// Return an array of all origins mapped to the provided digital action + /// Return an array of all origins mapped to the provided digital action in the current action set /// /// public static InputActionOrigin[] GetDigitalActionOrigins( Controller controller, string action ) @@ -147,6 +165,24 @@ ref origins[0] } + /// + /// Return an array of all origins mapped to the provided action set and digital action + /// + /// + public static InputActionOrigin[] GetDigitalActionOrigins( Controller controller, string actionSet, string action ) + { + InputActionOrigin[] origins = new InputActionOrigin[STEAM_INPUT_MAX_ORIGINS]; + + Internal.GetDigitalActionOrigins( + controller.Handle, + Internal.GetActionSetHandle( actionSet ), + GetDigitalActionHandle( action ), + ref origins[0] + ); + return origins; + } + + /// /// Return an absolute path to the PNG image glyph for the provided digital action name. The current /// action set in use for the controller will be used for the lookup. You should cache the result and