Esempio n. 1
0
        public void onDestroy(GameScenes g)
        {
            Log.dbg("NavUtils: Destorying App 1");

            GameEvents.onGUIApplicationLauncherReady.Remove(AddButton);

            if (appButton != null)
            {
                Log.dbg("NavUtils: Destorying App 2");

                ToolbarController.Instance.Destroy();

                //save settings to config
                ConfigLoader.SaveSettings();

                var.Settings.hsiState = false;

                KSP.UI.Screens.ApplicationLauncher.Instance.RemoveModApplication(appButton);
            }
        }
Esempio n. 2
0
        public void Activate(bool state)
        {
            Log.dbg("NavUtils: NavUtilLibApp.Activate()");

            if (state)
            {
                rt = new RenderTexture(640, 640, 24, RenderTextureFormat.ARGB32);
                rt.Create();

                Log.dbg("NavUtil: Starting systems...");
                if (!var.Settings.navAidsIsLoaded)
                {
                    var.Settings.loadNavAids();
                }

                if (!var.Materials.isLoaded)
                {
                    var.Materials.loadMaterials();
                }

                //load settings to config
                //ConfigLoader.LoadSettings(var.Settings.settingsFileURL);

                //ConfigureCamera();
                windowPosition.x = var.Settings.hsiPosition.x;
                windowPosition.y = var.Settings.hsiPosition.y;


                Log.dbg("NavUtil: Systems started successfully!");
            }
            else
            {
                state = false;
                //RenderingManager.RemoveFromPostDrawQueue(3, OnDraw); //close the GUI
                var.Settings.hsiPosition.x = windowPosition.x;
                var.Settings.hsiPosition.y = windowPosition.y;

                ConfigLoader.SaveSettings();
            }
        }