public CustomUserActions() { // -------------- Camera Controls -------------- RotateCameraRight = CreatePlayerAction("Rotate Camera Right"); RotateCameraLeft = CreatePlayerAction("Rotate Camera Left"); // -------------- Movement -------------- moveUp = CreatePlayerAction("MoveUp"); moveDown = CreatePlayerAction("MoveDown"); moveLeft = CreatePlayerAction("MoveLeft"); moveRight = CreatePlayerAction("MoveRight"); MoveHorizontal = CreateOneAxisPlayerAction(moveLeft, moveRight); MoveVertical = CreateOneAxisPlayerAction(moveDown, moveUp); // -------------- Speed -------------- walk = CreatePlayerAction("Walk"); // -------------- Events -------------- harvest = CreatePlayerAction("Harvest"); use = CreatePlayerAction("Use"); pause = CreatePlayerAction("Pause"); // -------------- Rotation -------------- rotateUp = CreatePlayerAction("RotateUp"); rotateDown = CreatePlayerAction("RotateDown"); rotateLeft = CreatePlayerAction("RotateLeft"); rotateRight = CreatePlayerAction("RotateRight"); RotateHorizontal = CreateOneAxisPlayerAction(rotateLeft, rotateRight); RotateVertical = CreateOneAxisPlayerAction(rotateDown, rotateUp); }
public TwoAxisInputControl() { Left = new OneAxisInputControl(); Right = new OneAxisInputControl(); Up = new OneAxisInputControl(); Down = new OneAxisInputControl(); }
public static bool get_WasReleased(OneAxisInputControl @this) { if (settings.FastForwardKeyIsToggle) { return(false); } return(SpeedUpAction.WasReleased); }
private static void Prefix(OneAxisInputControl __instance, ref float value) { try { var source = OneAxis.GetValues(__instance).LastOrDefault(_ => _.Value != 0); if (source != null) { value = source.Value; } } catch (Exception exception) { Main.Logger.Exception(exception); } }
public static void Link(OneAxisInputControl source, OneAxisInputControl target) => OneAxis.Add(target, source);