Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMCL-1618: Fix default GameController mapping + zoom input functionality #1034

Merged
merged 16 commits into from
Jan 17, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated scroll input mapping
alexzaranek committed Jan 9, 2025
commit c58eb8f03f7ab65b32fd6e144503bed44ffedad3
Original file line number Diff line number Diff line change
@@ -47,6 +47,7 @@ static DefaultControlInitializer()
{
actionName = "CM Default/Zoom";
inputName = "Mouse ScrollWheel";
invertY = true;
}
if (axis.Name.Contains("Move"))
{
@@ -88,7 +89,7 @@ static DefaultControlInitializer()
#endif
#if ENABLE_LEGACY_INPUT_MANAGER
controller.Input.LegacyInput = inputName;
controller.Input.LegacyGain = isMomentary ? 1 : 200 * (invertY ? -1 : 1);
controller.Input.LegacyGain = isMomentary ? 1 : 50 * (invertY ? -1 : 1);
#endif
controller.Enabled = true;
};
Original file line number Diff line number Diff line change
@@ -142,7 +142,7 @@ void Reset()

static InputAxis DefaultHorizontal => new () { Value = 0, Range = new Vector2(-180, 180), Wrap = true, Center = 0, Recentering = InputAxis.RecenteringSettings.Default };
static InputAxis DefaultVertical => new () { Value = 17.5f, Range = new Vector2(-10, 45), Wrap = false, Center = 17.5f, Recentering = InputAxis.RecenteringSettings.Default };
static InputAxis DefaultRadial => new () { Value = 1, Range = new Vector2(1, 1), Wrap = false, Center = 1, Recentering = InputAxis.RecenteringSettings.Default };
static InputAxis DefaultRadial => new () { Value = 1, Range = new Vector2(1, 3), Wrap = false, Center = 1, Recentering = InputAxis.RecenteringSettings.Default };

/// <summary>True if component is enabled and has a valid Follow target</summary>
public override bool IsValid => enabled && FollowTarget != null;
@@ -163,7 +163,7 @@ void IInputAxisOwner.GetInputAxes(List<IInputAxisOwner.AxisDescriptor> axes)
{
axes.Add(new () { DrivenAxis = () => ref HorizontalAxis, Name = "Look Orbit X", Hint = IInputAxisOwner.AxisDescriptor.Hints.X });
axes.Add(new () { DrivenAxis = () => ref VerticalAxis, Name = "Look Orbit Y", Hint = IInputAxisOwner.AxisDescriptor.Hints.Y });
axes.Add(new () { DrivenAxis = () => ref RadialAxis, Name = "Orbit Scale" });
axes.Add(new () { DrivenAxis = () => ref RadialAxis, Name = "Orbit Scale", Hint = IInputAxisOwner.AxisDescriptor.Hints.Y });
}

/// <summary>Register a handler that will be called when input needs to be reset</summary>