Beispiel #1
0
 public void ReviewData()
 {
     UI.Open((p) => p.Fileman(vessel));
 }
Beispiel #2
0
        void Render_menu(Vessel v)
        {
            const string tooltip = "\n<i>(middle-click to popout in a window, middle-click again to close popout)</i>";
            VesselData   vd      = DB.Vessel(v);

            GUILayout.BeginHorizontal(Styles.entry_container);
            GUILayout.Label(new GUIContent(page == MonitorPage.telemetry ? " <color=#00ffff>INFO</color> " : " INFO ", Icons.small_info, "Telemetry readings" + tooltip), config_style);
            if (Lib.IsClicked())
            {
                page = MonitorPage.telemetry;
            }
            else if (Lib.IsClicked(2))
            {
                if (UI.window.PanelType == Panel.PanelType.telemetry)
                {
                    UI.window.Close();
                }
                else
                {
                    UI.Open((p) => p.TelemetryPanel(v));
                }
            }
            if (Features.Science)
            {
                GUILayout.Label(new GUIContent(page == MonitorPage.data ? " <color=#00ffff>DATA</color> " : " DATA ", Icons.small_folder, "Stored files and samples" + tooltip), config_style);
                if (Lib.IsClicked())
                {
                    page = MonitorPage.data;
                }
                else if (Lib.IsClicked(2))
                {
                    if (UI.window.PanelType == Panel.PanelType.data)
                    {
                        UI.window.Close();
                    }
                    else
                    {
                        UI.Open((p) => p.Fileman(v));
                    }
                }
            }
            if (Features.Automation)
            {
                GUILayout.Label(new GUIContent(page == MonitorPage.scripts ? " <color=#00ffff>AUTO</color> " : " AUTO ", Icons.small_console, "Control and automate components" + tooltip), config_style);
                if (Lib.IsClicked())
                {
                    page = MonitorPage.scripts;
                }
                else if (Lib.IsClicked(2))
                {
                    if (UI.window.PanelType == Panel.PanelType.scripts)
                    {
                        UI.window.Close();
                    }
                    else
                    {
                        UI.Open((p) => p.Devman(v));
                    }
                }
            }
            if (PreferencesMessages.Instance.stockMessages != true)
            {
                GUILayout.Label(new GUIContent(page == MonitorPage.log ? " <color=#00ffff>LOG</color> " : " LOG ", Icons.small_notes, "See previous notifications" + tooltip), config_style);
                if (Lib.IsClicked())
                {
                    page = MonitorPage.log;
                }
                else if (Lib.IsClicked(2))
                {
                    if (UI.window.PanelType == Panel.PanelType.log)
                    {
                        UI.window.Close();
                    }
                    else
                    {
                        UI.Open((p) => p.Logman(v));
                    }
                }
            }
            GUILayout.Label(new GUIContent(page == MonitorPage.config ? " <color=#00ffff>CFG</color> " : " CFG ", Icons.small_config, "Configure the vessel" + tooltip), config_style);
            if (Lib.IsClicked())
            {
                page = MonitorPage.config;
            }
            else if (Lib.IsClicked(2))
            {
                if (UI.window.PanelType == Panel.PanelType.config)
                {
                    UI.window.Close();
                }
                else
                {
                    UI.Open((p) => p.Config(v));
                }
            }
            GUILayout.Label(new GUIContent(" GROUP ", Icons.small_search, "Organize in groups"), config_style);
            vd.group = Lib.TextFieldPlaceholder("Kerbalism_group", vd.group, "NONE", group_style).ToUpper();
            GUILayout.EndHorizontal();
            GUILayout.Space(Styles.ScaleFloat(10.0f));
        }
Beispiel #3
0
 public void ToggleUI()
 {
     UI.Open((Panel p) => p.Fileman(vessel));
 }
Beispiel #4
0
 void OnGUI()
 {
     UI.On_gui(Callbacks.visible);
 }
Beispiel #5
0
        public override void OnLoad(ConfigNode node)
        {
            // everything in there will be called only one time : the first time a game is loaded from the main menu
            if (!IsCoreGameInitDone)
            {
                // core game systems
                Sim.Init();                         // find suns (Kopernicus support)
                Radiation.Init();                   // create the radiation fields
                ScienceDB.Init();                   // build the science database (needs Sim.Init() and Radiation.Init() first)
                Science.Init();                     // register the science hijacker

                // static graphic components
                LineRenderer.Init();
                ParticleRenderer.Init();
                Highlighter.Init();

                // UI
                Textures.Init();                                      // set up the icon textures
                UI.Init();                                            // message system, main gui, launcher
                KsmGui.KsmGuiMasterController.Init();                 // setup the new gui framework

                // part prefabs hacks
                Profile.SetupPods();                 // add supply resources to pods
                Misc.TweakPartIcons();               // various tweaks to the part icons in the editor

                // Create KsmGui windows
                new ScienceArchiveWindow();

                // GameEvents callbacks
                Callbacks = new Callbacks();

                IsCoreGameInitDone = true;
            }

            // everything in there will be called every time a savegame (or a new game) is loaded from the main menu
            if (!IsSaveGameInitDone)
            {
                Cache.Init();
                ResourceCache.Init();

                // prepare storm data
                foreach (CelestialBody body in FlightGlobals.Bodies)
                {
                    if (Storm.Skip_body(body))
                    {
                        continue;
                    }
                    Storm_data sd = new Storm_data {
                        body = body
                    };
                    storm_bodies.Add(sd);
                }

                IsSaveGameInitDone = true;
            }

            // eveything else will be called on every OnLoad() call :
            // - save/load
            // - every scene change
            // - in various semi-random situations (thanks KSP)

            // Fix for background IMGUI textures being dropped on scene changes since KSP 1.8
            Styles.ReloadBackgroundStyles();

            // always clear the caches
            Cache.Clear();
            ResourceCache.Clear();

            // deserialize our database
            UnityEngine.Profiling.Profiler.BeginSample("Kerbalism.DB.Load");
            DB.Load(node);
            UnityEngine.Profiling.Profiler.EndSample();

            // I'm smelling the hacky mess in here.
            Communications.NetworkInitialized  = false;
            Communications.NetworkInitializing = false;

            // detect if this is a different savegame
            if (DB.uid != savegame_uid)
            {
                // clear caches
                Message.all_logs.Clear();

                // sync main window pos from db
                UI.Sync();

                // remember savegame id
                savegame_uid = DB.uid;
            }

            Kerbalism.gameLoadTime = Time.time;
        }
Beispiel #6
0
        public override void OnLoad(ConfigNode node)
        {
            // deserialize data
            DB.Load(node);

            Communications.NetworkInitialized  = false;
            Communications.NetworkInitializing = false;

            // initialize everything just once
            if (!initialized)
            {
                // add supply resources to pods
                Profile.SetupPods();

                // initialize subsystems
                Cache.Init();
                ResourceCache.Init();
                Radiation.Init();
                Science.Init();
                LineRenderer.Init();
                ParticleRenderer.Init();
                Highlighter.Init();
                UI.Init();

                // prepare storm data
                foreach (CelestialBody body in FlightGlobals.Bodies)
                {
                    if (Storm.Skip_body(body))
                    {
                        continue;
                    }
                    Storm_data sd = new Storm_data
                    {
                        body = body
                    };
                    storm_bodies.Add(sd);
                }

                // various tweaks to the part icons in the editor
                Misc.TweakPartIcons();

                // setup callbacks
                callbacks = new Callbacks();

                // everything was initialized
                initialized = true;
            }

            // detect if this is a different savegame
            if (DB.uid != savegame_uid)
            {
                // clear caches
                Cache.Clear();
                ResourceCache.Clear();
                Message.all_logs.Clear();

                // sync main window pos from db
                UI.Sync();

                // remember savegame id
                savegame_uid = DB.uid;
            }
        }
Beispiel #7
0
 void OnGUI()
 {
     UI.on_gui(callbacks.visible);
 }