private void InitUI() { apply = false; //Init any of the UI values, don't notify if possible useLegacyCapture.toggle.SetValueWithoutNotify(!DPSettings.config.useDDA, true); autoFocusGame.toggle.SetValueWithoutNotify(DPSettings.config.focusGameWhenNotInteracting, true); EVRSettingsError error = new EVRSettingsError(); bool globalOverlayInput = OpenVR.Settings.GetBool(OpenVR.k_pch_SteamVR_Section, OpenVR.k_pch_SteamVR_AllowGlobalActionSetPriority, ref error); blockInput.toggle.SetValueWithoutNotify(globalOverlayInput, true); dimGame.slider.value = Mathf.RoundToInt(Maths.Linear(DPSettings.config.dimGameAmount, 0, 1, dimGame.min, dimGame.max)); lockWatch.toggle.SetValue(DPSettings.config.lockWatch, true); minimizeStartup.toggle.SetValueWithoutNotify(DPSettings.config.minimizeAtStartup, true); apply = true; }
private void Awake() { WebCamDevice[] avaliableWebCams = WebCamTexture.devices; webcamTexture = new WebCamTexture(); hasDualCameras = false; webcamName = ""; foreach (var _ in avaliableWebCams.Where(webcam => dualcameraDevices.Contains(webcam.name)).Select(webcam => new { })) { hasDualCameras = true; } if (XRSettings.loadedDeviceName == "OpenVR") { SteamVR_TrackedCamera.VideoStreamTexture camSource = SteamVR_TrackedCamera.Source(false); bool openvrHasCamera = camSource.hasCamera; EVRSettingsError error = EVRSettingsError.None; bool cameraIsEnabled = OpenVR.Settings.GetBool(OpenVR.k_pch_Camera_Section, OpenVR.k_pch_Camera_EnableCamera_Bool, ref error); if (Settings.instance.SelectedWebcam == "Auto" && cameraIsEnabled && openvrHasCamera) { Settings.instance.SelectedWebcam = "SteamVR"; if (Settings.instance.ProjectionScale < 32) { new CameraOffsetMenu().SetPreset("OpenVR Projection"); } } } }
private void SetupWebcamList() { if (!_WebcamList.Contains("None")) { bool hmdHasCamera = false; OpenVR.TrackedCamera.HasCamera(OpenVR.k_unTrackedDeviceIndex_Hmd, ref hmdHasCamera); Sprite autoicon = UIUtilities.LoadSpriteFromResources("ARCompanion.Resources.Icons.auto.png"); CustomListTableData.CustomCellInfo defaultcamCellInfo = new CustomListTableData.CustomCellInfo("None", "No camera"); CustomListTableData.CustomCellInfo autocamCellInfo = new CustomListTableData.CustomCellInfo("Auto", "Automatically find any headset cameras.", autoicon); webcamList.data.Add(defaultcamCellInfo); webcamList.data.Add(autocamCellInfo); _WebcamList.Add("None"); _WebcamList.Add("Auto"); EVRSettingsError error = EVRSettingsError.None; bool cameraIsEnabled = OpenVR.Settings.GetBool(OpenVR.k_pch_Camera_Section, OpenVR.k_pch_Camera_EnableCamera_Bool, ref error); if (error != EVRSettingsError.None) { Logger.Log("Error getting OpenVR camera settings: " + error, IPA.Logging.Logger.Level.Error); } else if (hmdHasCamera && cameraIsEnabled) { Sprite openvricon = UIUtilities.LoadSpriteFromResources("ARCompanion.Resources.Icons.openvr.png"); CustomListTableData.CustomCellInfo openvrcamCellInfo = new CustomListTableData.CustomCellInfo("SteamVR", "Use SteamVR's camera system. (Recommended)", openvricon); webcamList.data.Add(openvrcamCellInfo); _WebcamList.Add("SteamVR"); } } RefreshWebcamList(); }
public void SetGamma(ColorConfiguration configuration) { if (!IsGammaStale() && !IsSignificantChange(configuration)) { return; } if (VRSettings == null) { Debug.LogError("VR Settings is not initialized. Make sure a compatible VR headet is plugged in."); return; } //EnsureValidDeviceContext(); EVRSettingsError vrSettingsError = EVRSettingsError.None; Color color = GetColor(configuration); VRSettings.SetFloat(OpenVR.k_pch_SteamVR_Section, k_pch_SteamVR_HmdDisplayColorGainR_Float, color.r, ref vrSettingsError); VRSettings.SetFloat(OpenVR.k_pch_SteamVR_Section, k_pch_SteamVR_HmdDisplayColorGainG_Float, color.g, ref vrSettingsError); VRSettings.SetFloat(OpenVR.k_pch_SteamVR_Section, k_pch_SteamVR_HmdDisplayColorGainB_Float, color.b, ref vrSettingsError); if (vrSettingsError != EVRSettingsError.None) { Debug.LogError("SetFloat Error [HmdDisplayColorGain]: " + vrSettingsError.ToString()); } _isGammaValid = true; _lastConfiguration = configuration; _lastUpdateTimestamp = DateTimeOffset.Now; //Debug.Log($"Updated gamma to {configuration}."); }
public static void ShowBindingsForEditor() { bool temporarySession = InitializeTemporarySession(false); EVRSettingsError bindingFlagError = EVRSettingsError.None; OpenVR.Settings.SetBool(OpenVR.k_pch_SteamVR_Section, OpenVR.k_pch_SteamVR_DebugInputBinding, true, ref bindingFlagError); if (bindingFlagError != EVRSettingsError.None) { Debug.LogError("<b>[SteamVR]</b> Error turning on the debug input binding flag in steamvr: " + bindingFlagError.ToString()); } if (Application.isPlaying == false) { IdentifyEditorApplication(); SteamVR_Input.IdentifyActionsFile(); } OpenVR.Input.OpenBindingUI(SteamVR_Settings.instance.editorAppKey, 0, 0, true); if (temporarySession) { ExitTemporarySession(); } }
EVRSettingsError SetTronMode(bool enable) { EVRSettingsError e = EVRSettingsError.None; OpenVR.Settings.SetBool(OpenVR.k_pch_Camera_Section, OpenVR.k_pch_Camera_EnableCameraForCollisionBounds_Bool, enable, ref e); OpenVR.Settings.Sync(true, ref e); return(e); }
private void BlockInputToggleCallback() { EVRSettingsError error = new EVRSettingsError(); bool globalOverlayInput = OpenVR.Settings.GetBool(OpenVR.k_pch_SteamVR_Section, OpenVR.k_pch_SteamVR_AllowGlobalActionSetPriority, ref error); OpenVR.Settings.SetBool(OpenVR.k_pch_SteamVR_Section, OpenVR.k_pch_SteamVR_AllowGlobalActionSetPriority, !globalOverlayInput, ref error); if (error != EVRSettingsError.None) { Debug.LogError("Error setting GlobalActionSetPriority! " + error.ToString()); } DPRestartManager.Restart(); }
EVRSettingsError SetTronMode(bool enable) { EVRSettingsError e = EVRSettingsError.None; OpenVR.Settings.SetBool(OpenVR.k_pch_Camera_Section, OpenVR.k_pch_Camera_EnableCameraForCollisionBounds_Bool, enable, ref e); OpenVR.Settings.Sync(true, ref e); if (e == EVRSettingsError.None) { Debug.LogError("error settingn tron mode"); } return(e); }
/* * //今まで一度もトラッキングされたことがないかどうかをチェックする(True=全く位置情報がない, False=過去一度でも位置情報がある) * public bool GetNeverTracked(uint deviceIndex) * { * if (openVR == null) * { * return true; * } * * var error = default(ETrackedPropertyError); * //Prop_NeverTracked_Bool取得 * bool NeverTracked = openVR.GetBoolTrackedDeviceProperty(deviceIndex, ETrackedDeviceProperty.Prop_NeverTracked_Bool, ref error); * if (error != ETrackedPropertyError.TrackedProp_Success) return true; * return NeverTracked; * } */ public bool GetIsSafeMode() { if (openVR == null) { return(false); } CVRSettings cVRSettings = OpenVR.Settings; EVRSettingsError eVRSettingsError = EVRSettingsError.None; bool en = cVRSettings.GetBool(OpenVR.k_pch_SteamVR_Section, OpenVR.k_pch_SteamVR_EnableSafeMode, ref eVRSettingsError); if (eVRSettingsError != EVRSettingsError.None) { Debug.LogError("GetIsSafeMode Failed: " + eVRSettingsError.ToString()); return(false); } return(en); }
// Token: 0x06005ED9 RID: 24281 RVA: 0x00213320 File Offset: 0x00211720 private void OnEnable() { this.usingSpeakers = false; CVRSettings settings = OpenVR.Settings; if (settings != null) { EVRSettingsError evrsettingsError = EVRSettingsError.None; if (settings.GetBool("steamvr", "usingSpeakers", ref evrsettingsError)) { this.usingSpeakers = true; float @float = settings.GetFloat("steamvr", "speakersForwardYawOffsetDegrees", ref evrsettingsError); this.offset = Quaternion.Euler(0f, @float, 0f); } } if (this.usingSpeakers) { SteamVR_Events.NewPosesApplied.Listen(new UnityAction(this.OnNewPosesApplied)); } }
private void OnEnable() { this.usingSpeakers = false; CVRSettings settings = OpenVR.Settings; if (settings != null) { EVRSettingsError eVRSettingsError = EVRSettingsError.None; if (settings.GetBool("steamvr", "usingSpeakers", false, ref eVRSettingsError)) { this.usingSpeakers = true; float @float = settings.GetFloat("steamvr", "speakersForwardYawOffsetDegrees", 0f, ref eVRSettingsError); this.offset = Quaternion.Euler(0f, @float, 0f); } } if (this.usingSpeakers) { SteamVR_Utils.Event.Listen("new_poses_applied", new SteamVR_Utils.Event.Handler(this.OnNewPosesApplied)); } }
public override int GetInt32(string pchSection,string pchSettingsKey,int nDefaultValue,ref EVRSettingsError peError) { CheckIfUsable(); int result = VRNativeEntrypoints.VR_IVRSettings_GetInt32(m_pVRSettings,pchSection,pchSettingsKey,nDefaultValue,ref peError); return result; }
public override void Sync(ref EVRSettingsError peError) { CheckIfUsable(); VRNativeEntrypoints.VR_IVRSettings_Sync(m_pVRSettings,ref peError); }
} // 0x00000001811DFCE0-0x00000001811DFD10 public void SetString(string pchSection, string pchSettingsKey, string pchValue, ref EVRSettingsError peError) { } // 0x00000001811DFD40-0x00000001811DFD70
public bool GetBool(string pchSection, string pchSettingsKey, ref EVRSettingsError peError) => default; // 0x00000001811DFB20-0x00000001811DFB50 public int GetInt32(string pchSection, string pchSettingsKey, ref EVRSettingsError peError) => default; // 0x00000001811DFB80-0x00000001811DFBB0
public void SetString(string pchSection, string pchSettingsKey, string pchValue, ref EVRSettingsError peError) { this.FnTable.SetString(pchSection, pchSettingsKey, pchValue, ref peError); }
public abstract string GetSettingsErrorNameFromEnum(EVRSettingsError eError);
internal static extern int VR_IVRSettings_GetInt32(IntPtr instancePtr, string pchSection, string pchSettingsKey, int nDefaultValue, ref EVRSettingsError peError);
// Token: 0x06001FE8 RID: 8168 RVA: 0x0009E30B File Offset: 0x0009C50B public void SetFloat(string pchSection, string pchSettingsKey, float flValue, ref EVRSettingsError peError) { this.FnTable.SetFloat(pchSection, pchSettingsKey, flValue, ref peError); }
// Token: 0x06001FE7 RID: 8167 RVA: 0x0009E2F4 File Offset: 0x0009C4F4 public void SetInt32(string pchSection, string pchSettingsKey, int nValue, ref EVRSettingsError peError) { this.FnTable.SetInt32(pchSection, pchSettingsKey, nValue, ref peError); }
// Token: 0x06001FE6 RID: 8166 RVA: 0x0009E2DD File Offset: 0x0009C4DD public void SetBool(string pchSection, string pchSettingsKey, bool bValue, ref EVRSettingsError peError) { this.FnTable.SetBool(pchSection, pchSettingsKey, bValue, ref peError); }
// Token: 0x06001FE5 RID: 8165 RVA: 0x0009E2C9 File Offset: 0x0009C4C9 public bool Sync(bool bForce, ref EVRSettingsError peError) { return(this.FnTable.Sync(bForce, ref peError)); }
// Token: 0x06001FE4 RID: 8164 RVA: 0x0009E2B1 File Offset: 0x0009C4B1 public string GetSettingsErrorNameFromEnum(EVRSettingsError eError) { return(Marshal.PtrToStringAnsi(this.FnTable.GetSettingsErrorNameFromEnum(eError))); }
public string GetSettingsErrorNameFromEnum(EVRSettingsError eError) { IntPtr ptr = this.FnTable.GetSettingsErrorNameFromEnum(eError); return((string)Marshal.PtrToStructure(ptr, typeof(string))); }
} // 0x00000001811DFC90-0x00000001811DFCB0 public void RemoveKeyInSection(string pchSection, string pchSettingsKey, ref EVRSettingsError peError) { } // 0x00000001811DFC60-0x00000001811DFC90
public override void SetString(string pchSection,string pchSettingsKey,string pchValue,ref EVRSettingsError peError) { CheckIfUsable(); VRNativeEntrypoints.VR_IVRSettings_SetString(m_pVRSettings,pchSection,pchSettingsKey,pchValue,ref peError); }
internal static extern void VR_IVRSettings_Sync(IntPtr instancePtr, ref EVRSettingsError peError);
// Token: 0x06001FE9 RID: 8169 RVA: 0x0009E322 File Offset: 0x0009C522 public void SetString(string pchSection, string pchSettingsKey, string pchValue, ref EVRSettingsError peError) { this.FnTable.SetString(pchSection, pchSettingsKey, pchValue, ref peError); }
internal static extern void VR_IVRSettings_GetString(IntPtr instancePtr, string pchSection, string pchSettingsKey, string pchValue, uint unValueLen, string pchDefaultValue, ref EVRSettingsError peError);
// Token: 0x06001FEA RID: 8170 RVA: 0x0009E339 File Offset: 0x0009C539 public bool GetBool(string pchSection, string pchSettingsKey, ref EVRSettingsError peError) { return(this.FnTable.GetBool(pchSection, pchSettingsKey, ref peError)); }
} // 0x00000001811DFC30-0x00000001811DFC60 public void RemoveSection(string pchSection, ref EVRSettingsError peError) { } // 0x00000001811DFC90-0x00000001811DFCB0
// Token: 0x06001FEB RID: 8171 RVA: 0x0009E34E File Offset: 0x0009C54E public int GetInt32(string pchSection, string pchSettingsKey, ref EVRSettingsError peError) { return(this.FnTable.GetInt32(pchSection, pchSettingsKey, ref peError)); }
public bool Sync(bool bForce, ref EVRSettingsError peError) { return this.FnTable.Sync(bForce, ref peError); }
// Token: 0x06001FEC RID: 8172 RVA: 0x0009E363 File Offset: 0x0009C563 public float GetFloat(string pchSection, string pchSettingsKey, ref EVRSettingsError peError) { return(this.FnTable.GetFloat(pchSection, pchSettingsKey, ref peError)); }
} // 0x00000001811DFD40-0x00000001811DFD70 public bool GetBool(string pchSection, string pchSettingsKey, ref EVRSettingsError peError) => default; // 0x00000001811DFB20-0x00000001811DFB50
// Token: 0x06001FED RID: 8173 RVA: 0x0009E378 File Offset: 0x0009C578 public void GetString(string pchSection, string pchSettingsKey, StringBuilder pchValue, uint unValueLen, ref EVRSettingsError peError) { this.FnTable.GetString(pchSection, pchSettingsKey, pchValue, unValueLen, ref peError); }
public override string GetSettingsErrorNameFromEnum(EVRSettingsError eError) { CheckIfUsable(); IntPtr result = VRNativeEntrypoints.VR_IVRSettings_GetSettingsErrorNameFromEnum(m_pVRSettings,eError); return (string) Marshal.PtrToStructure(result, typeof(string)); }
// Token: 0x06001FEF RID: 8175 RVA: 0x0009E3A5 File Offset: 0x0009C5A5 public void RemoveKeyInSection(string pchSection, string pchSettingsKey, ref EVRSettingsError peError) { this.FnTable.RemoveKeyInSection(pchSection, pchSettingsKey, ref peError); }
public override bool GetBool(string pchSection,string pchSettingsKey,bool bDefaultValue,ref EVRSettingsError peError) { CheckIfUsable(); bool result = VRNativeEntrypoints.VR_IVRSettings_GetBool(m_pVRSettings,pchSection,pchSettingsKey,bDefaultValue,ref peError); return result; }
public int GetInt32(string pchSection, string pchSettingsKey, ref EVRSettingsError peError) => default; // 0x00000001811DFB80-0x00000001811DFBB0 public float GetFloat(string pchSection, string pchSettingsKey, ref EVRSettingsError peError) => default; // 0x00000001811DFB50-0x00000001811DFB80
public override float GetFloat(string pchSection,string pchSettingsKey,float flDefaultValue,ref EVRSettingsError peError) { CheckIfUsable(); float result = VRNativeEntrypoints.VR_IVRSettings_GetFloat(m_pVRSettings,pchSection,pchSettingsKey,flDefaultValue,ref peError); return result; }
public abstract bool GetBool(string pchSection,string pchSettingsKey,bool bDefaultValue,ref EVRSettingsError peError);
internal static extern IntPtr VR_IVRSettings_GetSettingsErrorNameFromEnum(IntPtr instancePtr, EVRSettingsError eError);
public abstract int GetInt32(string pchSection,string pchSettingsKey,int nDefaultValue,ref EVRSettingsError peError);
internal static extern bool VR_IVRSettings_GetBool(IntPtr instancePtr, string pchSection, string pchSettingsKey, bool bDefaultValue, ref EVRSettingsError peError);
public abstract float GetFloat(string pchSection,string pchSettingsKey,float flDefaultValue,ref EVRSettingsError peError);
internal static extern float VR_IVRSettings_GetFloat(IntPtr instancePtr, string pchSection, string pchSettingsKey, float flDefaultValue, ref EVRSettingsError peError);
public abstract void GetString(string pchSection,string pchSettingsKey,string pchValue,uint unValueLen,string pchDefaultValue,ref EVRSettingsError peError);
internal static extern void VR_IVRSettings_SetString(IntPtr instancePtr, string pchSection, string pchSettingsKey, string pchValue, ref EVRSettingsError peError);
public void SetInt32(string pchSection, string pchSettingsKey, int nValue, ref EVRSettingsError peError) { this.FnTable.SetInt32(pchSection, pchSettingsKey, nValue, ref peError); }
public abstract void Sync(ref EVRSettingsError peError);
public float GetFloat(string pchSection, string pchSettingsKey, ref EVRSettingsError peError) => default; // 0x00000001811DFB50-0x00000001811DFB80 public void GetString(string pchSection, string pchSettingsKey, StringBuilder pchValue, uint unValueLen, ref EVRSettingsError peError) { } // 0x00000001811DFC30-0x00000001811DFC60
public abstract void SetBool(string pchSection,string pchSettingsKey,bool bValue,ref EVRSettingsError peError);
public void GetString(string pchSection, string pchSettingsKey, string pchValue, uint unValueLen, string pchDefaultValue, ref EVRSettingsError peError) { this.FnTable.GetString(pchSection, pchSettingsKey, pchValue, unValueLen, pchDefaultValue, ref peError); }
public abstract void SetInt32(string pchSection,string pchSettingsKey,int nValue,ref EVRSettingsError peError);
public void RemoveSection(string pchSection, ref EVRSettingsError peError) { this.FnTable.RemoveSection(pchSection, ref peError); }
public abstract void SetFloat(string pchSection,string pchSettingsKey,float flValue,ref EVRSettingsError peError);
public void SetBool(string pchSection, string pchSettingsKey, bool bValue, ref EVRSettingsError peError) { this.FnTable.SetBool(pchSection, pchSettingsKey, bValue, ref peError); }
public abstract void SetString(string pchSection,string pchSettingsKey,string pchValue,ref EVRSettingsError peError);
public void SetFloat(string pchSection, string pchSettingsKey, float flValue, ref EVRSettingsError peError) { this.FnTable.SetFloat(pchSection, pchSettingsKey, flValue, ref peError); }