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

Change SteamVR default settings to prevent them from getting overwritten on initial import #12

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 2 additions & 1 deletion Assets/Actions/Scripts/SeatedPositionResetAction.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections;
using UnityEngine;
using Valve.VR;

namespace EVRC.Core.Actions
{
Expand Down Expand Up @@ -32,7 +33,7 @@ private IEnumerator HoldingMenuButtons()
{
yield return new WaitForSeconds(holdForSeconds);
Debug.Log("Resetting seated position");
// OpenVR.System.ResetSeatedZeroPose();
OpenVR.Chaperone.ResetZeroPose(SteamVR.settings.trackingSpace);
}
}
}
2 changes: 1 addition & 1 deletion Assets/Core/Assets/GameState/Elite Dangerous State.asset
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 02dc692eea0eb8e4aa9506ebd427e1b4, type: 3}
m_Name: Elite Dangerous State
m_EditorClassIdentifier:
gameEvent: {fileID: 0}
gameEvent: {fileID: 11400000, guid: 1e32b9862c3503c4db55b246757a21f7, type: 2}
running: 0
processId: 0
processName:
Expand Down
4 changes: 2 additions & 2 deletions Assets/Core/Scripts/CockpitUIMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public enum CockpitModeOverride : ushort

void OnEnable()
{
// EDStateManager.eliteDangerousStarted.Listen(OnGameStartedOrStopped);
EDStateManager.EliteDangerousStarted.Listen(OnGameStartedOrStopped);
EDStateManager.EliteDangerousStopped.Listen(OnGameStartedOrStopped);
EDStateManager.GuiFocusChanged.Listen(OnGuiFocusChanged);
EDStateManager.FlagsChanged.Listen(OnFlagsChanged);
Expand All @@ -79,7 +79,7 @@ void OnEnable()

void OnDisable()
{
// EDStateManager.eliteDangerousStarted.Remove(OnGameStartedOrStopped);
EDStateManager.EliteDangerousStarted.Remove(OnGameStartedOrStopped);
EDStateManager.EliteDangerousStopped.Remove(OnGameStartedOrStopped);
EDStateManager.GuiFocusChanged.Remove(OnGuiFocusChanged);
EDStateManager.FlagsChanged.Remove(OnFlagsChanged);
Expand Down
4 changes: 3 additions & 1 deletion Assets/Core/Scripts/EDStateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class EDStateManager : MonoBehaviour
public GameEvent eliteDangerousStarted;
// Replace these Steam Events with GameEvents
public static Events.Event EliteDangerousStopped = new Events.Event();
public static Events.Event EliteDangerousStarted = new Events.Event();
public static Events.Event<uint, string> CurrentProcessChanged = new Events.Event<uint, string>();
public static Events.Event<EDGuiFocus> GuiFocusChanged = new Events.Event<EDGuiFocus>();
public static Events.Event<EDStatusFlags> FlagsChanged = new Events.Event<EDStatusFlags>();
Expand Down Expand Up @@ -116,7 +117,7 @@ internal void SetCurrentProcess(uint pid)

internal void SetIsEliteDangerousRunning(bool running)
{
if (eliteDangerousState.running == running) return;
//if (eliteDangerousState.running == running) return;
eliteDangerousState.running = running;
eliteDangerousState.processId = currentProcessId;
eliteDangerousState.processName = currentProcessName;
Expand All @@ -125,6 +126,7 @@ internal void SetIsEliteDangerousRunning(bool running)
{
StartCoroutine(WatchStatusFile());
eliteDangerousStarted.Raise();
EliteDangerousStarted.Send();
}
else
{
Expand Down
2 changes: 2 additions & 0 deletions Assets/Core/Scripts/GameFocusVisibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ private void OnEnable()
windowFocusManager.eliteDangerousState = eliteDangerousState;

EDStateManager.EliteDangerousStopped.Listen(OnGameStartedOrStopped);
EDStateManager.EliteDangerousStarted.Listen(OnGameStartedOrStopped);
WindowFocusManager.ForegroundWindowProcessChanged.Listen(OnForegroundWindowProcessChanged);

Refresh();
Expand All @@ -28,6 +29,7 @@ private void OnEnable()
void OnDisable()
{
EDStateManager.EliteDangerousStopped.Remove(OnGameStartedOrStopped);
EDStateManager.EliteDangerousStarted.Remove(OnGameStartedOrStopped);
WindowFocusManager.ForegroundWindowProcessChanged.Remove(OnForegroundWindowProcessChanged);
}

Expand Down
53 changes: 51 additions & 2 deletions Assets/Scenes/EVRC.unity
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: af22bd791bcd75f4b9078393c57c4c5e, type: 3}
m_Name:
m_EditorClassIdentifier:
controlBindingsState: {fileID: 11400000, guid: 1de2906d06cd6f745bab03c953c45a3a,
type: 2}
--- !u!114 &59438901
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1116,6 +1114,52 @@ Transform:
m_Father: {fileID: 1074601785}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &516072241 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 9098288760151393727, guid: 13dfd2ff77290bb4faf75012641f360d,
type: 3}
m_PrefabInstance: {fileID: 1749688776}
m_PrefabAsset: {fileID: 0}
--- !u!114 &516072243 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5625217958891209880, guid: 13dfd2ff77290bb4faf75012641f360d,
type: 3}
m_PrefabInstance: {fileID: 1749688776}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 516072241}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cf32f9d7c93175745bcf1ee89d900bc9, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &516072244
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 516072241}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f1ef366d1adba714aa9442631db4e0b7, type: 3}
m_Name:
m_EditorClassIdentifier:
Source: {fileID: 11400000, guid: 1e32b9862c3503c4db55b246757a21f7, type: 2}
Response:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 516072243}
m_TargetAssemblyTypeName: EVRC.Desktop.StatusView, EVRC.Desktop
m_MethodName: Refresh
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &569466639
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -2659,6 +2703,11 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114168438288787448, guid: 71fe574d30e93584e986026484e39e7f,
type: 3}
propertyPath: deadzonePercentage
value: 3
objectReference: {fileID: 0}
- target: {fileID: 114532849731444944, guid: 71fe574d30e93584e986026484e39e7f,
type: 3}
propertyPath: editLockState
Expand Down
10 changes: 5 additions & 5 deletions Assets/SteamVR/Scripts/SteamVR_Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public ETrackingUniverseOrigin trackingSpace

[SerializeField]
[FormerlySerializedAsAttribute("trackingSpace")]
private ETrackingUniverseOrigin trackingSpaceOrigin = ETrackingUniverseOrigin.TrackingUniverseStanding;
private ETrackingUniverseOrigin trackingSpaceOrigin = ETrackingUniverseOrigin.TrackingUniverseSeated;

[Tooltip("Filename local to StreamingAssets/SteamVR/ folder")]
public string actionsFilePath = "actions.json";
Expand All @@ -60,16 +60,16 @@ public ETrackingUniverseOrigin trackingSpace

[Space()]
[Tooltip("This determines if we use legacy mixed reality mode (3rd controller/tracker device connected) or the new input system mode (pose / input source)")]
public bool legacyMixedRealityCamera = true;
public bool legacyMixedRealityCamera = false;

[Tooltip("[NON-LEGACY] This is the pose action that will be used for positioning a mixed reality camera if connected")]
public SteamVR_Action_Pose mixedRealityCameraPose = SteamVR_Input.GetPoseAction("ExternalCamera");
public SteamVR_Action_Pose mixedRealityCameraPose = SteamVR_Input.GetPoseAction("Pose");

[Tooltip("[NON-LEGACY] This is the input source to check on the pose for the mixed reality camera")]
public SteamVR_Input_Sources mixedRealityCameraInputSource = SteamVR_Input_Sources.Camera;
public SteamVR_Input_Sources mixedRealityCameraInputSource = SteamVR_Input_Sources.Head;

[Tooltip("[NON-LEGACY] Auto enable mixed reality action set if file exists")]
public bool mixedRealityActionSetAutoEnable = true;
public bool mixedRealityActionSetAutoEnable = false;

[Tooltip("[EDITOR ONLY] The (left) prefab to be used for showing previews while posing hands")]
public GameObject previewHandLeft;
Expand Down
6 changes: 2 additions & 4 deletions Assets/SteamVR_Resources/Resources/SteamVR_Settings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,5 @@ MonoBehaviour:
needsReinit: 0
mixedRealityCameraInputSource: 9
mixedRealityActionSetAutoEnable: 0
previewHandLeft: {fileID: 1000013348574242, guid: 638779290bce1af49b356f33dcc6fccf,
type: 3}
previewHandRight: {fileID: 1000010304998954, guid: 6def53d002137b747aec0b29551e0e25,
type: 3}
previewHandLeft: {fileID: 0}
previewHandRight: {fileID: 0}
3 changes: 2 additions & 1 deletion ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ PlayerSettings:
16:9: 1
Others: 1
bundleVersion: .8
preloadedAssets: []
preloadedAssets:
- {fileID: -8947760093551166720, guid: 5a4599796d93a8949bb8d40ecedf8c44, type: 2}
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1
Expand Down