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

Release 0.2.5 #777

Merged
merged 2 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Submodules/WindowsMixedReality
33 changes: 3 additions & 30 deletions XRTK-Core/Packages/com.xrtk.core/Editor/ControllerPopupWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using UnityEditor;
using UnityEngine;
using XRTK.Definitions.Controllers;
using XRTK.Definitions.Devices;
using XRTK.Definitions.Utilities;
using XRTK.Editor.Data;
using XRTK.Editor.PropertyDrawers;
Expand Down Expand Up @@ -343,35 +342,9 @@ private void RenderInteractionList(SerializedProperty interactionProfilesList, b
if (useCustomInteractionMapping ||
currentControllerTexture.IsNull())
{
bool skip = false;

if (ControllerType.Name == "WindowsMixedRealityMotionController" && Handedness == Handedness.None)
{
switch (description)
{
case "Grip Press":
case "Trigger Position":
case "Trigger Touched":
case "Touchpad Position":
case "Touchpad Touch":
case "Touchpad Press":
case "Menu Press":
case "Thumbstick Position":
case "Thumbstick Press":
skip = true;
break;
case "Trigger Press (Select)":
description = "Air Tap (Select)";
break;
}
}

if (!skip)
{
inputActionDropdown.OnGui(GUIContent.none, action, axisConstraint, GUILayout.Width(INPUT_ACTION_LABEL_WIDTH));
EditorGUILayout.LabelField(description, GUILayout.ExpandWidth(true));
GUILayout.FlexibleSpace();
}
inputActionDropdown.OnGui(GUIContent.none, action, axisConstraint, GUILayout.Width(INPUT_ACTION_LABEL_WIDTH));
EditorGUILayout.LabelField(description, GUILayout.ExpandWidth(true));
GUILayout.FlexibleSpace();
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using XRTK.Definitions.Controllers;
using XRTK.Definitions.Devices;
using XRTK.Definitions.Utilities;
using XRTK.Providers.Controllers;
using XRTK.Extensions;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using XRTK.Editor.Extensions;
using XRTK.Editor.PropertyDrawers;
using XRTK.Editor.Utilities;
using XRTK.Extensions;
using XRTK.Providers.Controllers;

namespace XRTK.Editor.Profiles.InputSystem.Controllers
{
Expand Down Expand Up @@ -266,32 +266,41 @@ private void DrawSimpleControllerMappingProfilesView()
}
}

private static int layoutIndex;

internal void RenderControllerMappingButton(MixedRealityControllerMappingProfile controllerMappingProfile)
{
var controllerType = controllerMappingProfile.ControllerType.Type;

if (controllerType == null)
{
return;
}

var handedness = controllerMappingProfile.Handedness;

if (handedness != Handedness.Right)
if (handedness != Handedness.Right && layoutIndex > 0)
{
GUILayout.BeginHorizontal();
layoutIndex = 0;
GUILayout.EndHorizontal();
}

var typeName = controllerType?.Name.ToProperCase();

if (controllerType?.Name == "WindowsMixedRealityMotionController" && controllerMappingProfile.Handedness == Handedness.None)
if (handedness == Handedness.Left)
{
typeName = "HoloLens 1";
layoutIndex++;
GUILayout.BeginHorizontal();
}

var buttonContent = new GUIContent($"Edit {typeName} Action Mapping", ControllerMappingUtilities.GetControllerTextureScaled(controllerMappingProfile));
var buttonContent = new GUIContent($"Edit {controllerType.Name.ToProperCase()} Action Mapping", ControllerMappingUtilities.GetControllerTextureScaled(controllerMappingProfile));

if (GUILayout.Button(buttonContent, ControllerButtonStyle, GUILayout.Height(128f), GUILayout.MinWidth(32f), GUILayout.ExpandWidth(true)))
{
EditorApplication.delayCall += () => ControllerPopupWindow.Show(controllerMappingProfile, new SerializedObject(controllerMappingProfile).FindProperty("interactionMappingProfiles"));
}

if (handedness != Handedness.Left)
if (handedness == Handedness.Right && layoutIndex == 1)
{
layoutIndex--;
GUILayout.EndHorizontal();
}
}
Expand Down
4 changes: 2 additions & 2 deletions XRTK-Core/Packages/com.xrtk.core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"Mixed Reality",
"DI"
],
"version": "0.2.4",
"version": "0.2.5",
"unity": "2019.4",
"license": "MIT",
"author": "XRTK Team (https://github.com/XRTK)",
Expand All @@ -22,4 +22,4 @@
"com.unity.xr.legacyinputhelpers": "2.1.7"
},
"unityRelease": "17f1"
}
}
2 changes: 1 addition & 1 deletion XRTK-Core/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
"depth": 0,
"source": "embedded",
"dependencies": {
"com.xrtk.core": "0.2.3",
"com.xrtk.core": "0.2.4",
"com.unity.xr.windowsmr.metro": "4.2.3"
}
},
Expand Down