72 lines
2.3 KiB
C#
72 lines
2.3 KiB
C#
using InControl;
|
|
using System.Collections.Generic;
|
|
public class PlayerActionsRebirth : CustomPlayerActionVersionBase
|
|
{
|
|
PlayerAction ActivateSlot1;
|
|
public readonly List<PlayerAction> ActivateActions = new List<PlayerAction>();
|
|
|
|
public int ActivateSlotIsPressed
|
|
{
|
|
get
|
|
{
|
|
for (int i = 0; i < ActivateActions.Count; i++)
|
|
if (ActivateActions[i].IsPressed)
|
|
return i;
|
|
return -1;
|
|
}
|
|
}
|
|
public int ActivateSlotWasPressed
|
|
{
|
|
get
|
|
{
|
|
for (int i = 0; i < ActivateActions.Count; i++)
|
|
if (ActivateActions[i].WasPressed)
|
|
return i;
|
|
return -1;
|
|
}
|
|
}
|
|
public int ActivateSlotWasReleased
|
|
{
|
|
get
|
|
{
|
|
for (int i = 0; i < ActivateActions.Count; i++)
|
|
if (ActivateActions[i].WasReleased)
|
|
return i;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
public PlayerActionsRebirth()
|
|
{
|
|
Name = "vehicleRebirth";
|
|
Version = 1;
|
|
Instance = this;
|
|
Enabled = false;
|
|
ActivateActions.Add(ActivateSlot1);
|
|
var vehicleActions = Platform.PlatformManager.NativePlatform.Input.PrimaryPlayer.VehicleActions;
|
|
var permaActions = Platform.PlatformManager.NativePlatform.Input.PrimaryPlayer.PermanentActions;
|
|
UserData = new PlayerActionData.ActionSetUserData(new PlayerActionsBase[] { vehicleActions, permaActions });
|
|
vehicleActions.AddUniConflict(this);
|
|
permaActions.AddUniConflict(this);
|
|
}
|
|
|
|
public override void CreateActions()
|
|
{
|
|
ActivateSlot1 = CreatePlayerAction("ActivateSlot1");
|
|
ActivateSlot1.UserData = new PlayerActionData.ActionUserData("inputVehicleCruiseControl", "inputVehicleCruiseControlDesc", PlayerActionRebirthData.GroupRebirth, PlayerActionData.EAppliesToInputType.Both, true);
|
|
}
|
|
public override void CreateDefaultJoystickBindings()
|
|
{
|
|
//ActivateSlot1.AddDefaultBinding(InputControlType.DPadUp);
|
|
}
|
|
|
|
public override void CreateDefaultKeyboardBindings()
|
|
{
|
|
ActivateSlot1.AddDefaultBinding(new Key[] { Key.Q });
|
|
}
|
|
|
|
public static PlayerActionsRebirth Instance { get; private set; }
|
|
public override ControllerActionType ControllerActionDisplay => ControllerActionType.Vehicle;
|
|
}
|
|
|