Moved ActiveVessel check from UpdateModules to FixedUpdate
[VesselSimulator.git] / KerbalEngineer / Settings / SettingsWindow.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
namespace KerbalEngineer.Settings
{
    using KeyBinding;
    using Unity;
    using Unity.UI;
 
    public static class SettingsWindow
    {
        private static Window m_Window;
 
        public static void Close()
        {
            if (m_Window != null)
            {
                m_Window.Close();
            }
        }
 
        public static void Open()
        {
            if (m_Window == null)
            {
                m_Window = StyleManager.CreateWindow("SETTINGS", 400.0f);
                Setting keyBindings = StyleManager.CreateSetting("Key Bindings", m_Window);
                if (keyBindings != null)
                {
                    keyBindings.AddButton("EDIT KEY BINDINGS", KeyBinder.Show);
                }
                StyleManager.Process(m_Window);
            }
        }
    }
}