mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-02-19 10:08:47 +03:00
Add functions to SteamInput (Init, GetAnalogGylph, ShowBindings, GetDescription)
This commit is contained in:
parent
4463739be5
commit
a6677dbe04
@ -21,6 +21,14 @@ namespace Steamworks
|
|||||||
|
|
||||||
internal const int STEAM_CONTROLLER_MAX_COUNT = 16;
|
internal const int STEAM_CONTROLLER_MAX_COUNT = 16;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Must be called when starting use of the ISteamInput interface.
|
||||||
|
/// </summary>
|
||||||
|
public static void Init( bool explicitlyCallRunFrame = false )
|
||||||
|
{
|
||||||
|
Internal.Init( explicitlyCallRunFrame );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// You shouldn't really need to call this because it gets called by <see cref="SteamClient.RunCallbacks"/>
|
/// You shouldn't really need to call this because it gets called by <see cref="SteamClient.RunCallbacks"/>
|
||||||
@ -51,15 +59,38 @@ namespace Steamworks
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Return an absolute path to the PNG image glyph for the provided digital action name. The current
|
/// Return an absolute path to the PNG image glyph for the provided analog action name. The current
|
||||||
/// action set in use for the controller will be used for the lookup. You should cache the result and
|
/// action set in use for the controller will be used for the lookup. You should cache the result and
|
||||||
/// maintain your own list of loaded PNG assets.
|
/// maintain your own list of loaded PNG assets.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="controller"></param>
|
/// <param name="controller"></param>
|
||||||
/// <param name="action"></param>
|
/// <param name="action"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string GetDigitalActionGlyph( Controller controller, string action )
|
public static string GetAnalogActionGlyph( Controller controller, string action )
|
||||||
|
{
|
||||||
|
InputActionOrigin origin = InputActionOrigin.None;
|
||||||
|
|
||||||
|
Internal.GetAnalogActionOrigins(
|
||||||
|
controller.Handle,
|
||||||
|
Internal.GetCurrentActionSet( controller.Handle ),
|
||||||
|
GetAnalogActionHandle( action ),
|
||||||
|
ref origin
|
||||||
|
);
|
||||||
|
|
||||||
|
return Internal.GetGlyphForActionOrigin_Legacy( origin );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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
|
||||||
|
/// maintain your own list of loaded PNG assets.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="controller"></param>
|
||||||
|
/// <param name="action"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetDigitalActionGlyph( Controller controller, string action )
|
||||||
{
|
{
|
||||||
InputActionOrigin origin = InputActionOrigin.None;
|
InputActionOrigin origin = InputActionOrigin.None;
|
||||||
|
|
||||||
@ -102,6 +133,49 @@ namespace Steamworks
|
|||||||
return Internal.GetGlyphSVGForActionOrigin( origin, 0 );
|
return Internal.GetGlyphSVGForActionOrigin( origin, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Show the binding panel for the specified controller.
|
||||||
|
/// If the player is using Big Picture Mode the configuration will open in the overlay.
|
||||||
|
/// In desktop mode a popup window version of Big Picture will be created and open the configuration.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true for success; false if overlay is disabled or unavailable.</returns>
|
||||||
|
public static bool ShowBindingPanel(Controller controller)
|
||||||
|
{
|
||||||
|
return Internal.ShowBindingPanel(controller.Handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get the localized description of the button assigned to the specified digital action
|
||||||
|
/// </summary>
|
||||||
|
public static string GetDigitalActionDescription(Controller controller, string action)
|
||||||
|
{
|
||||||
|
InputActionOrigin origin = InputActionOrigin.None;
|
||||||
|
|
||||||
|
Internal.GetDigitalActionOrigins(
|
||||||
|
controller.Handle,
|
||||||
|
Internal.GetCurrentActionSet( controller.Handle ),
|
||||||
|
GetDigitalActionHandle( action ),
|
||||||
|
ref origin
|
||||||
|
);
|
||||||
|
return Internal.GetStringForActionOrigin( origin );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get the localized description of the joystick or gamepad assigned to the specified analog action
|
||||||
|
/// </summary>
|
||||||
|
public static string GetAnalogActionDescription( Controller controller, string action )
|
||||||
|
{
|
||||||
|
InputActionOrigin origin = InputActionOrigin.None;
|
||||||
|
|
||||||
|
Internal.GetAnalogActionOrigins(
|
||||||
|
controller.Handle,
|
||||||
|
Internal.GetCurrentActionSet( controller.Handle ),
|
||||||
|
GetAnalogActionHandle( action ),
|
||||||
|
ref origin
|
||||||
|
);
|
||||||
|
return Internal.GetStringForActionOrigin( origin );
|
||||||
|
}
|
||||||
|
|
||||||
internal static Dictionary<string, InputDigitalActionHandle_t> DigitalHandles = new Dictionary<string, InputDigitalActionHandle_t>();
|
internal static Dictionary<string, InputDigitalActionHandle_t> DigitalHandles = new Dictionary<string, InputDigitalActionHandle_t>();
|
||||||
internal static InputDigitalActionHandle_t GetDigitalActionHandle( string name )
|
internal static InputDigitalActionHandle_t GetDigitalActionHandle( string name )
|
||||||
{
|
{
|
||||||
|
BIN
UnityPlugin/Facepunch.Steamworks.Posix.dll
Normal file
BIN
UnityPlugin/Facepunch.Steamworks.Posix.dll
Normal file
Binary file not shown.
BIN
UnityPlugin/Facepunch.Steamworks.Win32.dll
Normal file
BIN
UnityPlugin/Facepunch.Steamworks.Win32.dll
Normal file
Binary file not shown.
BIN
UnityPlugin/Facepunch.Steamworks.Win64.dll
Normal file
BIN
UnityPlugin/Facepunch.Steamworks.Win64.dll
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user