(965c31410a) Unstable v0.10.4.0

This commit is contained in:
Juan Pablo Arce
2020-07-21 08:57:50 -03:00
parent 4f8bd39789
commit 33d3a41104
546 changed files with 45952 additions and 25762 deletions
+33 -37
View File
@@ -3,44 +3,17 @@ using System.Collections.Generic;
namespace Steamworks
{
public static class SteamInput
public class SteamInput : SteamClientClass<SteamInput>
{
internal static ISteamInput Internal => Interface as ISteamInput;
internal override void InitializeInterface( bool server )
{
SetInterface( server, new ISteamInput( server ) );
}
internal const int STEAM_CONTROLLER_MAX_COUNT = 16;
static ISteamInput _internal;
internal static ISteamInput Internal
{
get
{
SteamClient.ValidCheck();
if ( _internal == null )
{
_internal = new ISteamInput();
_internal.Init();
}
return _internal;
}
}
internal static void Shutdown()
{
if ( _internal != null && _internal.IsValid )
{
_internal.DoShutdown();
}
_internal = null;
}
internal static void InstallEvents()
{
Internal.DoInit();
Internal.RunFrame();
// None?
}
/// <summary>
/// You shouldn't really need to call this because it get called by RunCallbacks on SteamClient
@@ -52,7 +25,7 @@ namespace Steamworks
Internal.RunFrame();
}
static InputHandle_t[] queryArray = new InputHandle_t[STEAM_CONTROLLER_MAX_COUNT];
static readonly InputHandle_t[] queryArray = new InputHandle_t[STEAM_CONTROLLER_MAX_COUNT];
/// <summary>
/// Return a list of connected controllers.
@@ -70,7 +43,30 @@ namespace Steamworks
}
}
internal static Dictionary<string, InputDigitalActionHandle_t> DigitalHandles = new Dictionary<string, InputDigitalActionHandle_t>();
/// <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;
Internal.GetDigitalActionOrigins(
controller.Handle,
Internal.GetCurrentActionSet(controller.Handle),
GetDigitalActionHandle(action),
ref origin
);
return Internal.GetGlyphForActionOrigin(origin);
}
internal static Dictionary<string, InputDigitalActionHandle_t> DigitalHandles = new Dictionary<string, InputDigitalActionHandle_t>();
internal static InputDigitalActionHandle_t GetDigitalActionHandle( string name )
{
if ( DigitalHandles.TryGetValue( name, out var val ) )