Add SteamInput call to retrieve analog action glyphs and clarify documentation for retrieving both analog and digital glyphs using information from the official docs.

This commit is contained in:
Herman Groenenboom 2023-04-07 10:50:11 +02:00
parent 4e7e0ef8c4
commit a0cb27f324

View File

@ -51,27 +51,58 @@ public static IEnumerable<Controller> Controllers
}
/// <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;
/// <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.
/// <para>
/// Valve recommends that you continuously check the action origins using <see cref="Controller.GetDigitalActionOrigins(string)"/>
/// in case the bindings have changed. When that happens you can update the prompts displayed in your game.
/// </para>
/// </summary>
/// <param name="controller"></param>
/// <param name="action"></param>
/// <returns></returns>
public static string GetDigitalActionGlyph( Controller controller, string action )
{
InputActionOrigin origin = InputActionOrigin.None;
Internal.GetDigitalActionOrigins(
controller.Handle,
Internal.GetCurrentActionSet(controller.Handle),
GetDigitalActionHandle(action),
ref origin
);
Internal.GetDigitalActionOrigins(
controller.Handle,
Internal.GetCurrentActionSet( controller.Handle ),
GetDigitalActionHandle( action ),
ref origin
);
return Internal.GetGlyphForActionOrigin_Legacy(origin);
}
return Internal.GetGlyphForActionOrigin_Legacy( origin );
}
/// <summary>
/// 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
/// maintain your own list of loaded PNG assets.
/// <para>
/// Valve recommends that you continuously check the action origins using <see cref="Controller.GetAnalogActionOrigins(string)"/>
/// in case the bindings have changed. When that happens you can update the prompts displayed in your game.
/// </para>
/// </summary>
/// <param name="controller"></param>
/// <param name="action"></param>
/// <returns></returns>
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>