Skip to content

Commit 9618b4a

Browse files
authored
Merge branch 'develop' into isxb-1129-current-control-scheme-visibility
2 parents acc74c9 + 7f8d00f commit 9618b4a

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ however, it has to be formatted properly to pass verification tests.
2222
- Fixed missing documentation for source generated Input Action Assets. This is now generated as part of the source code generation step when "Generate C# Class" is checked in the importer inspector settings.
2323
- Fixed pasting into an empty map list raising an exception. [ISXB-1150](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1150)
2424
- Fixed pasting bindings into empty Input Action asset. [ISXB-1180](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1180)
25+
- Fixed missing '&' symbol in Control Scheme dropdown on Windows platform. [ISXB-1109](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1109)
26+
- Fixed icon scaling in Input Actions window.
2527
- Fixed `ArgumentOutOfRangeException` when adding a new Control Scheme with any Device selected. [ISXB-1129](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1129)
2628

2729
### Changed

Packages/com.unity.inputsystem/InputSystem/Editor/Internal/GUIHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static void DrawLineSeparator(string label = null)
4343
public static Texture2D LoadIcon(string name)
4444
{
4545
var skinPrefix = EditorGUIUtility.isProSkin ? "d_" : "";
46-
var scale = Mathf.Clamp((int)EditorGUIUtility.pixelsPerPoint, 0, 4);
46+
var scale = Mathf.Clamp(Mathf.CeilToInt(EditorGUIUtility.pixelsPerPoint), 0, 4);
4747
var scalePostFix = scale > 1 ? $"@{scale}x" : "";
4848
if (name.IndexOfAny(Path.GetInvalidFileNameChars()) > -1)
4949
name = string.Join("_", name.Split(Path.GetInvalidFileNameChars()));

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,18 @@ public override void RedrawUI(ViewState viewState)
138138
m_SaveButton.SetEnabled(InputEditorUserSettings.autoSaveInputActionAssets == false);
139139
}
140140

141+
private string SetupControlSchemeName(string name)
142+
{
143+
//On Windows the '&' is considered an accelerator character and will always be stripped.
144+
//Since the ControlScheme menu isn't creating hotkeys, it can be safely assumed that they are meant to be text
145+
//so we want to escape the character for MenuItem
146+
if (Application.platform == RuntimePlatform.WindowsEditor)
147+
{
148+
name = name.Replace("&", "&&");
149+
}
150+
return name;
151+
}
152+
141153
private void SetUpControlSchemesMenu(ViewState viewState)
142154
{
143155
m_ControlSchemesToolbar.menu.MenuItems().Clear();
@@ -151,7 +163,7 @@ private void SetUpControlSchemesMenu(ViewState viewState)
151163
m_ControlSchemesToolbar.menu.AppendAction("All Control Schemes", _ => SelectControlScheme(-1),
152164
viewState.selectedControlSchemeIndex == -1 ? DropdownMenuAction.Status.Checked : DropdownMenuAction.Status.Normal);
153165
viewState.controlSchemes.ForEach((scheme, i) =>
154-
m_ControlSchemesToolbar.menu.AppendAction(scheme.name, _ => SelectControlScheme(i),
166+
m_ControlSchemesToolbar.menu.AppendAction(SetupControlSchemeName(scheme.name), _ => SelectControlScheme(i),
155167
viewState.selectedControlSchemeIndex == i ? DropdownMenuAction.Status.Checked : DropdownMenuAction.Status.Normal));
156168
m_ControlSchemesToolbar.menu.AppendSeparator();
157169
}

0 commit comments

Comments
 (0)