Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
  void Start()
  {
    // create subsystems
    cache           = new Cache();
    resource_cache  = new ResourceCache();
    background      = new Background();
    signal          = new Signal();
    storm           = new Storm();
    launcher        = new Launcher();
    info            = new Info();
    body_info       = new BodyInfo();
    message         = new Message();
    console         = new Console();
    editor          = new Editor();
    Radiation.init();
    LineRenderer.init();
    ParticleRenderer.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);
    }
  }