private void OnGUI()
 {
     if (showUI)
     {
         winPos = GUILayout.Window(winID, winPos, windowGUI, "SmokeScreen", GUILayout.MinWidth(300));
     }
 }
 private void drawGUI()
 {
     windowPos = GUILayout.Window(airshipWindowID, windowPos, WindowGUI, "HLAirships Build Aid", GUILayout.MinWidth(200));
 }
        public void drawGUI()
        {
            if (HideFMRSUI)
            {
                return;
            }
            if (!skin_init)
            {
                init_skin();
            }
            GUI.skin = HighLogic.Skin;

            if (main_ui_active)
            {
                windowPos   = GUILayout.Window(baseWindowID + 1, windowPos, MainGUI, "FMRS " /* + mod_vers */, GUILayout.MinWidth(100));
                windowPos.x = Mathf.Clamp(windowPos.x, 0, Screen.width - windowPos.width);
                windowPos.y = Mathf.Clamp(windowPos.y, 0, Screen.height - windowPos.height);

#if BETA && !DEBUG //**************************
                beta_windowPos.x = windowPos.x;
                beta_windowPos.y = windowPos.y + windowPos.height;
                beta_windowPos   = ClickThruBlocker.GUILayoutWindow(baseWindowID = 3, beta_windowPos, BetaGUI, "FMRS Beta");
#endif //**************************
            }

#if DEBUG //**************************
            if (main_ui_active)
            {
                debug_windowPos.x = windowPos.x;
                debug_windowPos.y = windowPos.y + windowPos.height;
                debug_windowPos   = GUILayout.Window(baseWindowID + 2, debug_windowPos, DebugGUI, "FMRS Debug Info");
            }
#endif //**************************
        }
Exemple #4
0
        private void Window(int id)
        {
            if (!cfgWinData)
            {
                cfgWinData = true;
//				newScreenshotAtIntervals = AS.configuration.screenshotAtIntervals;
                newInterval          = AS.configuration.screenshotInterval;
                interval             = newInterval.ToString();
                newConvertToJPG      = AS.configuration.convertToJPG;
                newKeepOrginalPNG    = AS.configuration.keepOrginalPNG;
                newNoGUIOnScreenshot = AS.configuration.noGUIOnScreenshot;
                newGUIOnScreenshot   = AS.configuration.guiOnScreenshot;

                newScreenshotPath          = AS.configuration.screenshotPath;
                newFilename                = AS.configuration.filename;
                newJPGQuality              = AS.configuration.JPGQuality;
                JPGQuality                 = newJPGQuality.ToString();
                newScreenshotOnSceneChange = AS.configuration.screenshotOnSceneChange;
                newOnSpecialEvent          = AS.configuration.onSpecialEvent;
                newKeycode                 = AS.configuration.keycode;

                newprecrashSnapshots    = AS.configuration.precrashSnapshots;
                newsecondsUntilImpact   = AS.configuration.secondsUntilImpact;
                newhsAltitudeLimit      = AS.configuration.hsAltitudeLimit;
                newhsMinVerticalSpeed   = AS.configuration.hsMinVerticalSpeed;
                newhsScreenshotInterval = AS.configuration.hsScreenshotInterval;

                secondsUntilImpact   = AS.configuration.secondsUntilImpact.ToString();
                hsAltitudeLimit      = AS.configuration.hsAltitudeLimit.ToString();
                hsMinVerticalSpeed   = AS.configuration.hsMinVerticalSpeed.ToString();
                hsScreenshotInterval = AS.configuration.hsScreenshotInterval.ToString();

                newsupersize = AS.configuration.supersize;
                strsupersize = AS.configuration.supersize.ToString();

                newautoSave            = AS.configuration.autoSave;
                newminBetweenSaves     = AS.configuration.minBetweenSaves;
                minBetweenSaves        = AS.configuration.minBetweenSaves.ToString();
                newsavePrefix          = AS.configuration.savePrefix;
                newnumToRotate         = AS.configuration.numToRotate;
                numToRotate            = AS.configuration.numToRotate.ToString();
                newautoSaveOnGameStart = AS.configuration.autoSaveOnGameStart;
            }

            SetVisible(true);
            GUI.enabled = true;

            GUILayout.BeginHorizontal();
            GUILayout.EndHorizontal();
            //DrawTitle ("Options");
            GUILayout.BeginArea(new Rect(10, 50, 375, 450));

            GUILayout.BeginVertical();

            DrawTitle("Screenshot Options");

            //GUILayout.BeginHorizontal ();
            //GUILayout.Label ("Take screenshots at specified intervals: ");
            //GUILayout.FlexibleSpace ();
            //newScreenshotAtIntervals = GUILayout.Toggle (newScreenshotAtIntervals, "");
            //GUILayout.EndHorizontal ();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Screenshot Interval in seconds: ");
            GUILayout.FlexibleSpace();
            interval = GUILayout.TextField(interval, GUILayout.MinWidth(30.0F), GUILayout.MaxWidth(30.0F));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Convert to JPG: ");
            GUILayout.FlexibleSpace();
            newConvertToJPG = GUILayout.Toggle(newConvertToJPG, "");
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Keep original PNG: ");
            GUILayout.FlexibleSpace();
            newKeepOrginalPNG = GUILayout.Toggle(newKeepOrginalPNG, "");
            GUILayout.EndHorizontal();


            GUILayout.BeginHorizontal();
            GUILayout.Label("JPEG Quality (1-100):");
            GUILayout.FlexibleSpace();
            JPGQuality = GUILayout.TextField(JPGQuality, GUILayout.MinWidth(30.0F), GUILayout.MaxWidth(30.0F));
            GUILayout.EndHorizontal();


            GUILayout.BeginHorizontal();
            GUILayout.Label("Supersize images (0-4):");
            GUILayout.FlexibleSpace();
            strsupersize = GUILayout.TextField(strsupersize, GUILayout.MinWidth(30.0F), GUILayout.MaxWidth(30.0F));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Screenshot path:");
            GUILayout.FlexibleSpace();
//			GUILayout.EndHorizontal ();

//			GUILayout.BeginHorizontal ();
//			GUILayout.FlexibleSpace ();
            newScreenshotPath = GUILayout.TextField(newScreenshotPath, GUILayout.MinWidth(50F), GUILayout.MaxWidth(250F));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Filename Format:");
            GUILayout.FlexibleSpace();
            newFilename = GUILayout.TextField(newFilename, GUILayout.MinWidth(30F), GUILayout.MaxWidth(160F));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Screenshot after scene change:");
            GUILayout.FlexibleSpace();
            newScreenshotOnSceneChange = GUILayout.Toggle(newScreenshotOnSceneChange, "");
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Screenshot after special event:");
            GUILayout.FlexibleSpace();
            newOnSpecialEvent = GUILayout.Toggle(newOnSpecialEvent, "");
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Use Blizzy Toolbar if available:");
            GUILayout.FlexibleSpace();
            newUseBlizzyToolbar = GUILayout.Toggle(newUseBlizzyToolbar, "");
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Activation Keycode:");
            GUILayout.FlexibleSpace();
            newKeycode = GUILayout.TextField(newKeycode, GUILayout.MinWidth(30F), GUILayout.MaxWidth(40F));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("No GUI on screenshot:");
            GUILayout.FlexibleSpace();
            newNoGUIOnScreenshot = GUILayout.Toggle(newNoGUIOnScreenshot, "");
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("GUI on screenshot:   ");
            GUILayout.FlexibleSpace();
            newGUIOnScreenshot = GUILayout.Toggle(newGUIOnScreenshot, "");
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
            GUILayout.EndArea();


            GUILayout.BeginArea(new Rect(400, 50, 300, 400));
            GUILayout.BeginVertical();

            DrawTitle("Pre-Crash Settings");

            GUILayout.BeginHorizontal();
            GUILayout.Label("Take pre-crash snapshots:");
            GUILayout.FlexibleSpace();
            newprecrashSnapshots = GUILayout.Toggle(newprecrashSnapshots, "");
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Seconds until impact:");
            secondsUntilImpact = GUILayout.TextField(secondsUntilImpact, GUILayout.MinWidth(30.0F), GUILayout.MaxWidth(30.0F));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Altitude limit (meters):");
            hsAltitudeLimit = GUILayout.TextField(hsAltitudeLimit, GUILayout.MinWidth(30.0F), GUILayout.MaxWidth(60.0F));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Minimum vertical speed:");
            hsMinVerticalSpeed = GUILayout.TextField(hsMinVerticalSpeed, GUILayout.MinWidth(30.0F), GUILayout.MaxWidth(30.0F));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Screenshot interval (pre-crash):");
            hsScreenshotInterval = GUILayout.TextField(hsScreenshotInterval, GUILayout.MinWidth(30.0F), GUILayout.MaxWidth(30.0F));
            GUILayout.EndHorizontal();


            GUILayout.BeginHorizontal();
            GUILayout.Label("");
            GUILayout.EndHorizontal();

            DrawTitle("Automatic Save Settings");

            GUILayout.BeginHorizontal();
            GUILayout.Label("Activation Key (not configurable):");
            GUILayout.FlexibleSpace();
            GUILayout.Label("Ctrl-F6");
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Minutes between saves:");
            minBetweenSaves = GUILayout.TextField(minBetweenSaves, GUILayout.MinWidth(30.0F), GUILayout.MaxWidth(30.0F));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Save file format:");
            newsavePrefix = GUILayout.TextField(newsavePrefix, GUILayout.MinWidth(30.0F), GUILayout.MaxWidth(160.0F));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Max save files:");
            numToRotate = GUILayout.TextField(numToRotate, GUILayout.MinWidth(30.0F), GUILayout.MaxWidth(30.0F));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Autosave on at game start:");
            GUILayout.FlexibleSpace();
            newautoSaveOnGameStart = GUILayout.Toggle(newautoSaveOnGameStart, "");
            GUILayout.EndHorizontal();



            GUILayout.EndVertical();
            GUILayout.EndArea();


            //
            // I probably don't need to have the "finally" sections, but
            // it doesn't hurt and will be there if I need it in the future
            //
            try {
                newInterval = Convert.ToSingle(Convert.ToDouble(interval));
            } catch (Exception) {
            } finally {     }

            try {
                newJPGQuality = Convert.ToUInt16(JPGQuality);
            } catch (Exception) {
            } finally {     }


            try {
                newsecondsUntilImpact = Convert.ToUInt16(secondsUntilImpact);
            } catch (Exception) {
            } finally {     }
            try {
                newhsAltitudeLimit = Convert.ToUInt16(hsAltitudeLimit);
            } catch (Exception) {
            } finally {     }
            try {
                newhsMinVerticalSpeed = Convert.ToUInt16(hsMinVerticalSpeed);
            } catch (Exception) {
            } finally {     }
            try {
                newhsScreenshotInterval = Convert.ToSingle(Convert.ToDouble(hsScreenshotInterval));
            } catch (Exception) {
            } finally {     }

            try {
                newsupersize = Convert.ToUInt16(strsupersize);
                if (newsupersize < 0)
                {
                    newsupersize = 0;
                }
                if (newsupersize > AS.configuration.MAX_SUPERSIZE)
                {
                    newsupersize = AS.configuration.MAX_SUPERSIZE;
                }
            } catch (Exception) {
            } finally {     }

            try {
                newminBetweenSaves = Convert.ToUInt16(minBetweenSaves);
            } catch (Exception) {
            } finally {     }

            try {
                newnumToRotate = Convert.ToUInt16(numToRotate);
            } catch (Exception) {
            } finally {     }

            GUI.DragWindow();
        }
        private void OnGUI()
        {
            if (WindowVisable)
            {
                //Set the GUI Skin
                //GUI.skin = HighLogic.Skin;
                CLSStyles.SetupGuiStyles();

                _windowPosition = GUILayout.Window(947695, _windowPosition, OnWindow, _clsLocTitle, _windowStyle, GUILayout.MinHeight(80), GUILayout.MinWidth(400), GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true), GUILayout.Width(400), GUILayout.Height(80));
                if (!_optionsVisible)
                {
                    return;
                }
                if (_windowOptionsPosition == new Rect(0, 0, 0, 0))
                {
                    _windowOptionsPosition = new Rect(_windowPosition.x + _windowPosition.width + 10, _windowPosition.y, 260, 120);
                }
                _windowOptionsPosition = GUILayout.Window(947696, _windowOptionsPosition, DisplayOptionWindow, _clsLocOptions, _windowStyle, GUILayout.MinHeight(120), GUILayout.ExpandWidth(true));
            }
            else
            {
                if (WindowSelectedSpace <= -1)
                {
                    return;
                }
                _vessel.Spaces[WindowSelectedSpace].Highlight(false);
                WindowSelectedSpace = -1;
            }
        }