public void Awake() { instance = this; PluginConfiguration config = PluginConfiguration.CreateForType <PrefLoader>(); config.load(); //float.TryParse(config.GetValue("buoyancyMultiplicator", Preferences.buoyancyMultiplicator.ToString()), out Preferences.buoyancyMultiplicator); //config.TryGetFloat("buoyancyMultiplicator", ref Preferences.buoyancyMultiplicator); config.TryGetBool("showVolumeInfoInEditor", ref Preferences.showVolumeInfoInEditor); config.TryGetBool("showVolumeInfoInFlight", ref Preferences.showVolumeInfoInFlight); config.TryGetBool("showTemperatureInEditor", ref Preferences.showTemperatureInEditor); //config.TryGetBool("showTemperatureInFlight", ref Preferences.showTemperatureInFlight); config.TryGetBool("showAbsPressureInEditor", ref Preferences.showAbsPressureInEditor); config.TryGetBool("showAbsPressureInFlight", ref Preferences.showAbsPressureInFlight); config.TryGetBool("showBuoyancyInEditor", ref Preferences.showBuoyancyInEditor); config.TryGetBool("showBuoyancyInFlight", ref Preferences.showBuoyancyInFlight); config.TryGetBool("showVesselBuoyancyInEditor", ref Preferences.showVesselBuoyancyInEditor); config.TryGetBool("showVesselBuoyancyInFlight", ref Preferences.showVesselBuoyancyInFlight); config.TryGetBool("showVesselMassInEditor", ref Preferences.showVesselMassInEditor); config.TryGetBool("showVesselMassInFlight", ref Preferences.showVesselMassInFlight); config.TryGetBool("showGravPullInEditor", ref Preferences.showGravPullInEditor); config.TryGetBool("showGravPullInFlight", ref Preferences.showGravPullInFlight); config.TryGetUInt("debugLevel", ref Preferences.debugLevel); //config.TryGetBool("pressureDestruction", ref Preferences.pressureDestruction); //config.TryGetBool("alwaysControllable", ref Preferences.alwaysControllable); }
public void optionsFunc(int id) { GUILayout.Space(3); GUILayout.Label(" --- Save Game Preferences --- ", GUILayout.ExpandWidth(true)); GUILayout.Space(3); GUILayout.BeginHorizontal(); GUILayout.Label(String.Format("Buoyancy: {0:N} x", ProcAirships.Instance.buoyancyMultiplicator)); ProcAirships.Instance.buoyancyMultiplicator = (float)Math.Truncate((Double)GUILayout.HorizontalSlider(ProcAirships.Instance.buoyancyMultiplicator, 1.0f, 15.0f, GUILayout.ExpandWidth(true))); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); ProcAirships.Instance.pressureDestruction = GUILayout.Toggle(ProcAirships.Instance.pressureDestruction, "Pressure Damage"); ProcAirships.Instance.alwaysControllable = GUILayout.Toggle(ProcAirships.Instance.alwaysControllable, "Always Controllable"); GUILayout.EndVertical(); GUILayout.BeginVertical(); ProcAirships.Instance.showTemperatureInFlight = GUILayout.Toggle(ProcAirships.Instance.showTemperatureInFlight, "Show temperature in flight"); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.Space(3); GUILayout.Label(" --- Debug Preferences --- ", GUILayout.ExpandWidth(true)); GUILayout.Space(3); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); Preferences.showVolumeInfoInEditor = GUILayout.Toggle(Preferences.showVolumeInfoInEditor, "Show volume in editor"); Preferences.showVolumeInfoInFlight = GUILayout.Toggle(Preferences.showVolumeInfoInFlight, "Show volume in flight"); Preferences.showBuoyancyInEditor = GUILayout.Toggle(Preferences.showBuoyancyInEditor, "Show buoyancy in editor"); Preferences.showBuoyancyInFlight = GUILayout.Toggle(Preferences.showBuoyancyInFlight, "Show buoyancy in flight"); Preferences.showVesselMassInEditor = GUILayout.Toggle(Preferences.showVesselMassInEditor, "Show vessel mass in editor"); Preferences.showVesselMassInFlight = GUILayout.Toggle(Preferences.showVesselMassInFlight, "Show vessel mass in flight"); Preferences.showTemperatureInEditor = GUILayout.Toggle(Preferences.showTemperatureInEditor, "Show temperature in editor"); GUILayout.EndVertical(); GUILayout.BeginVertical(); Preferences.showAbsPressureInEditor = GUILayout.Toggle(Preferences.showAbsPressureInEditor, "Show abs. pressure in editor"); Preferences.showAbsPressureInFlight = GUILayout.Toggle(Preferences.showAbsPressureInFlight, "Show abs. pressure in flight"); Preferences.showVesselBuoyancyInEditor = GUILayout.Toggle(Preferences.showVesselBuoyancyInEditor, "Show vessel buoyancy in editor"); Preferences.showVesselBuoyancyInFlight = GUILayout.Toggle(Preferences.showVesselBuoyancyInFlight, "Show vessel buoyancy in flight"); Preferences.showGravPullInEditor = GUILayout.Toggle(Preferences.showGravPullInEditor, "Show grav. pull in editor"); Preferences.showGravPullInFlight = GUILayout.Toggle(Preferences.showGravPullInFlight, "Show grav. pull in flight"); /*Preferences.debugLevel = */ //GUILayout.Label(((LogLevel)Preferences.debugLevel).ToString()); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.Label(String.Format("Logging Level: {0}", LogLevelNames[(LogLevel)Preferences.debugLevel])); GUILayout.BeginHorizontal(); foreach (LogLevel ll in LogLevelNames.Keys) { if (GUILayout.Button(LogLevelNames[ll])) { Preferences.debugLevel = (uint)ll; } } GUILayout.EndHorizontal(); if (GUILayout.Button("Save Debug Settings", GUILayout.ExpandWidth(true))) { PrefLoader.SavePreferences(); } // Do stuff before windows dragging UnityEngine.GUI.DragWindow(); }