forked from MoonsideGames/MoonWorks
add no-op delegate to gamepad connect events
parent
6c93350f7f
commit
36a88afe52
|
@ -41,7 +41,7 @@ namespace MoonWorks.Input
|
||||||
/// Called when a gamepad has been connected.
|
/// Called when a gamepad has been connected.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="slot">The slot where the connection occurred.</param>
|
/// <param name="slot">The slot where the connection occurred.</param>
|
||||||
public OnGamepadConnectedFunc OnGamepadConnected;
|
public OnGamepadConnectedFunc OnGamepadConnected = delegate { };
|
||||||
|
|
||||||
public delegate void OnGamepadDisconnectedFunc(int slot);
|
public delegate void OnGamepadDisconnectedFunc(int slot);
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ namespace MoonWorks.Input
|
||||||
/// Called when a gamepad has been disconnected.
|
/// Called when a gamepad has been disconnected.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="slot">The slot where the disconnection occurred.</param>
|
/// <param name="slot">The slot where the disconnection occurred.</param>
|
||||||
public OnGamepadDisconnectedFunc OnGamepadDisconnected;
|
public OnGamepadDisconnectedFunc OnGamepadDisconnected = delegate { };
|
||||||
|
|
||||||
internal Inputs()
|
internal Inputs()
|
||||||
{
|
{
|
||||||
|
@ -142,8 +142,12 @@ namespace MoonWorks.Input
|
||||||
{
|
{
|
||||||
Gamepads[slot].Register(openResult);
|
Gamepads[slot].Register(openResult);
|
||||||
Logger.LogInfo($"Gamepad added to slot {slot}!");
|
Logger.LogInfo($"Gamepad added to slot {slot}!");
|
||||||
|
|
||||||
|
if (OnGamepadConnected != null)
|
||||||
|
{
|
||||||
OnGamepadConnected(slot);
|
OnGamepadConnected(slot);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue