Exemple #1
0
        public override void OnLoad(ConfigNode node)
        {
            // deserialize data
            DB.load(node);

            // 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();
                    sd.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();

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

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

            // force CommNet off when signal is enabled
            HighLogic.fetch.currentGame.Parameters.Difficulty.EnableCommNet &= !Features.Signal;
        }