From a9be00bae20ee7848e0018cfe8d5fed25925448a Mon Sep 17 00:00:00 2001 From: Eusth Date: Wed, 28 Sep 2016 22:52:48 +0200 Subject: [PATCH] Change ApplyShaders default value. --- HoneySelectVR/HoneySelectVR.cs | 19 ++++++++++++++++--- HoneySelectVR/HoneySettings.cs | 3 ++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/HoneySelectVR/HoneySelectVR.cs b/HoneySelectVR/HoneySelectVR.cs index 0e77cf0..d9f1743 100644 --- a/HoneySelectVR/HoneySelectVR.cs +++ b/HoneySelectVR/HoneySelectVR.cs @@ -1,6 +1,7 @@ using IllusionPlugin; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using UnityEngine; @@ -11,6 +12,8 @@ namespace HoneySelectVR { public class HoneySelectVR : IEnhancedPlugin { + private const String NEW_DEFAULT_TOKEN = "Plugins\\VR\\.vr2"; + public string[] Filter { get @@ -41,9 +44,19 @@ public void OnApplicationQuit() public void OnApplicationStart() { - if (Environment.CommandLine.Contains("--vr")) - { - VRManager.Create(new HoneyContext()); + if (Environment.CommandLine.Contains("--vr")) { + var context = new HoneyContext(); + var settings = context.Settings as HoneySettings; + + // Enforce new default + if(!File.Exists(NEW_DEFAULT_TOKEN)) { + File.Create(NEW_DEFAULT_TOKEN); + + settings.ApplyShaders = true; + settings.Save(); + } + + VRManager.Create(context); VR.Manager.SetMode(); } } diff --git a/HoneySelectVR/HoneySettings.cs b/HoneySelectVR/HoneySettings.cs index 6172f4e..c94ee95 100644 --- a/HoneySelectVR/HoneySettings.cs +++ b/HoneySelectVR/HoneySettings.cs @@ -10,6 +10,7 @@ namespace HoneySelectVR [XmlRoot("Settings")] public class HoneySettings : VRSettings { - public bool ApplyShaders { get; set; } + public bool ApplyShaders { get { return _ApplyShaders; } set { _ApplyShaders = value; } } + private bool _ApplyShaders = true; } }