Beispiel #1
0
 internal override void OnGUIOnceOnly()
 {
     Styles.InitStyles();
     Styles.InitSkins();
     SkinsLibrary.SetCurrent("SolarizedDark");
     SkinsLibrary.CurrentSkin.label.wordWrap = false;
 }
 internal override void OnGUIOnceOnly()
 {
     Log("Initializing GUI styles and skins");
     Styles.InitStyles();
     Styles.InitSkins();
     SkinsLibrary.SetCurrent("SolarizedDark");
     SkinsLibrary.CurrentSkin.label.wordWrap = true;
 }
Beispiel #3
0
        internal override void DrawWindow(int id)
        {
            base.DrawWindow(id);

            GameConfig config = scenarioModule.GetGameConfig();

            GUILayout.BeginVertical();

            GUILayout.BeginHorizontal();
            GUILayout.Label("KeepFit v" + Statics.GetDllVersion(this) + " : " + (config.enabled ? "Enabled" : "Disabled"));
            GUILayout.FlexibleSpace();
            if (GUILayout.Button((config.enabled ? "Disable" : "Enable"), GUILayout.Width(80)))
            {
                config.enabled = !config.enabled;
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Choose a Skin");
            GUILayout.FlexibleSpace();
            if (GUILayout.Button(new GUIContent("KSP Style", "Sets the style to be the default KSPStyle")))
            {
                SkinsLibrary.SetCurrent(SkinsLibrary.DefSkinType.KSP);
            }
            if (GUILayout.Button(new GUIContent("Unity Style", "Sets the style to be the default Unity Style")))
            {
                SkinsLibrary.SetCurrent(SkinsLibrary.DefSkinType.Unity);
            }
            GUILayout.EndHorizontal();

            config.wimpMode            = GUILayout.Toggle(config.wimpMode, "WimpMode: ", GUILayout.Width(80));
            config.useBestPartOnVessel = GUILayout.Toggle(config.useBestPartOnVessel, "Use Best Overall Part On Vessel: ", GUILayout.Width(80));
            if (scenarioModule.GetCLS() != null)
            {
                config.applyCLSLimitsIfAvailable = GUILayout.Toggle(config.applyCLSLimitsIfAvailable, "Apply CLS limits: ", GUILayout.Width(80));
            }

            showFloatEditor("Min Gee For Exercising when Landed", ref wipMinimumLandedGeeForExcercising, ref config.minimumLandedGeeForExcercising, ref config, true);
            showFloatEditor("Initial fitness level", ref wipInitialFitnessLevel, ref config.initialFitnessLevel, ref config, true);
            showFloatEditor("Min fitness level", ref wipMinFitnessLevel, ref config.minFitnessLevel, ref config, true);
            showFloatEditor("Max fitness level", ref wipMaxFitnessLevel, ref config.maxFitnessLevel, ref config, true);


            foreach (Period period in Enum.GetValues(typeof(Period)))
            {
                GeeToleranceConfig geeToleranceConfig = config.GetGeeTolerance(period);
                WipValuePair       wipValuePair       = wipGeeTolerances[period];
                showFloatPairEditor("Tolerance (" + period + ")", "Warn", "Fatal", ref wipValuePair, ref geeToleranceConfig.warn, ref geeToleranceConfig.fatal, ref config);
            }

            GUILayout.EndVertical();
        }
        internal override void OnGUIOnceOnly()
        {
            //Get the textures we need into Textures
            Resources.LoadTextures();

            //Set up the Styles
            Styles.InitStyles();

            //Set up the Skins
            Styles.InitSkins();

            //Set the current Skin
            SkinsLibrary.SetCurrent(settings.SelectedSkin.ToString());
        }
        internal override void DrawWindow(int id)
        {
            GUILayout.Label("Choose a Skin");

            if (GUILayout.Button(new GUIContent("KSP Style", "Sets the style to be the default KSPStyle")))
            {
                SkinsLibrary.SetCurrent(SkinsLibrary.DefSkinType.KSP);
            }
            if (GUILayout.Button(new GUIContent("Unity Style", "Sets the style to be the default Unity Style")))
            {
                SkinsLibrary.SetCurrent(SkinsLibrary.DefSkinType.Unity);
            }
            if (GUILayout.Button(new GUIContent("Custom Style", "Sets the style to be a custom style I just made up")))
            {
                SkinsLibrary.SetCurrent("CustomSkin");
            }

            GUILayout.Space(20);
            if (GUILayout.Button("Open New Window"))
            {
                SkinsWindow winTemp = gameObject.AddComponent <SkinsWindow>();
                skinsWindows.Add(winTemp);
            }
            if (GUILayout.Button("Destroy a Window"))
            {
                if (skinsWindows.Count > 0)
                {
                    skinsWindows[0].Visible = false;
                    skinsWindows[0]         = null;
                    skinsWindows.RemoveAt(0);
                }
            }
            if (GUILayout.Button("Toggle Drag for all TestWindows"))
            {
                foreach (SkinsWindow sw in skinsWindows)
                {
                    sw.DragEnabled = !sw.DragEnabled;
                }
            }

            GUILayout.Label("Tooltipwidth. 0 means nowrap");
            TooltipMaxWidth = Convert.ToInt32(GUILayout.TextField(TooltipMaxWidth.ToString()));
        }
Beispiel #6
0
        protected override void DrawWindow(int id)
        {
            GUILayout.Label("Choose a Skin");
            if (GUILayout.Button(textWithTT("KSP Style", "Sets the style to be the default KSPStyle.")))
            {
                SkinsLibrary.SetCurrent("KSP");
            }
            if (GUILayout.Button(textWithTT("Unity Style", "Sets the style to be the default Unity Style.")))
            {
                SkinsLibrary.SetCurrent("Unity");
            }
            if (GUILayout.Button(textWithTT("Custom Style", "Sets the style to be a custom style I just made up.")))
            {
                SkinsLibrary.SetCurrent("CustomSkin");
            }


            GUILayout.Space(20);
            if (GUILayout.Button(textWithTT("Open Skins Window", "Opens a window at a random location.")))
            {
                SkinsWindow winTemp = gameObject.AddComponent <SkinsWindow> ();
                skinsWindows.Add(winTemp);
            }
            if (GUILayout.Button(textWithTT("Destroy Skins Window", "Close a window (picks oldest first?).")))
            {
                if (skinsWindows.Count > 0)
                {
                    skinsWindows [0].Visible = false;
                    skinsWindows [0]         = null;
                    skinsWindows.RemoveAt(0);
                }
            }
            if (GUILayout.Button(textWithTT("Open Timer Window", "Opens a window at a random location.")))
            {
                LooperWindow winTemp = gameObject.AddComponent <LooperWindow> ();
                looperWindows.Add(winTemp);
            }
            if (GUILayout.Button(textWithTT("Destroy Timer Window", "Destroy one of the Timer Windows")))
            {
                if (looperWindows.Count > 0)
                {
                    looperWindows [0].Visible = false;
                    looperWindows [0]         = null;
                    looperWindows.RemoveAt(0);
                }
            }

            if (GUILayout.Button(textWithTT("Open Icons Window", "Opens a window at a random location.")))
            {
                IconWindow winTemp = gameObject.AddComponent <IconWindow> ();
                iconWindows.Add(winTemp);
            }
            if (GUILayout.Button(textWithTT("Destroy Icons Window", "Destroy one of the Icon Windows")))
            {
                if (iconWindows.Count > 0)
                {
                    iconWindows [0].Visible = false;
                    iconWindows [0]         = null;
                    iconWindows.RemoveAt(0);
                }
            }

            if (GUILayout.Button(textWithTT("Toggle Drag for all Windows", "Except this window, evidently.")))
            {
                foreach (SkinsWindow sw in skinsWindows)
                {
                    sw.DragEnabled = !sw.DragEnabled;
                }
                foreach (LooperWindow lw in looperWindows)
                {
                    lw.DragEnabled = !lw.DragEnabled;
                }
                foreach (IconWindow iw in iconWindows)
                {
                    iw.DragEnabled = !iw.DragEnabled;
                }
            }
            if (GUILayout.Button(textWithTT("Toggle Resize for all Windows", "This allows you to resize the window down to a minimum size and up to a maximum size.")))
            {
                foreach (SkinsWindow sw in skinsWindows)
                {
                    sw.ResizeEnabled = !sw.ResizeEnabled;
                }
                foreach (LooperWindow lw in looperWindows)
                {
                    lw.ResizeEnabled = !lw.ResizeEnabled;
                }
                foreach (IconWindow iw in iconWindows)
                {
                    iw.ResizeEnabled = !iw.ResizeEnabled;
                }
            }
            if (GUILayout.Button(textWithTT("Toggle Clamping for \" \" ", "Clamping prevents windows from going off of the screen.")))
            {
                foreach (SkinsWindow sw in skinsWindows)
                {
                    sw.ClampEnabled = !sw.ClampEnabled;
                }
                foreach (LooperWindow lw in looperWindows)
                {
                    lw.ClampEnabled = !lw.ClampEnabled;
                }
                foreach (IconWindow iw in iconWindows)
                {
                    iw.ClampEnabled = !iw.ClampEnabled;
                }
            }
            if (GUILayout.Button(textWithTT("Toggle Tooltips for \" \" ", "Tooltips are hovering help boxes which appear on mouseover.")))
            {
                foreach (SkinsWindow sw in skinsWindows)
                {
                    sw.TooltipsEnabled = !sw.TooltipsEnabled;
                }
                foreach (LooperWindow lw in looperWindows)
                {
                    lw.TooltipsEnabled = !lw.TooltipsEnabled;
                }
                foreach (IconWindow iw in iconWindows)
                {
                    iw.TooltipsEnabled = !iw.TooltipsEnabled;
                }
            }

            GUILayout.Label("Tooltipwidth. 0 means nowrap");
            var a = GUILayout.TextField(TooltipMaxWidth.ToString());

            TooltipMaxWidth = Convert.ToInt32(a);
        }
 void ddlSettingsSkin_SelectionChanged(DropDownList sender, int OldIndex, int NewIndex)
 {
     settings.SelectedSkin = (Settings.DisplaySkin)NewIndex;
     SkinsLibrary.SetCurrent(settings.SelectedSkin.ToString());
     settings.Save();
 }
Beispiel #8
0
 internal override void OnGUIOnceOnly()
 {
     Styles.InitStyles();
     Styles.InitSkins();
     SkinsLibrary.SetCurrent("TestFlightEditor");
 }
Beispiel #9
0
        internal override void DrawWindow(int id)
        {
            base.DrawWindow(id);

            GameConfig config = scenarioModule.GetGameConfig();

            GUILayout.BeginVertical();

            GUILayout.BeginHorizontal();
            GUILayout.Label("KeepFit v" + Statics.GetDllVersion(this) + " : " + (config.enabled ? "Enabled" : "Disabled"));
            GUILayout.FlexibleSpace();
            if (GUILayout.Button((config.enabled ? "Disable" : "Enable"), GUILayout.Width(80)))
            {
                config.enabled = !config.enabled;
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Choose a Skin");
            GUILayout.FlexibleSpace();
            if (GUILayout.Button(new GUIContent("KSP Style", "Sets the style to be the default KSPStyle")))
            {
                SkinsLibrary.SetCurrent(SkinsLibrary.DefSkinType.KSP);
            }
            if (GUILayout.Button(new GUIContent("Unity Style", "Sets the style to be the default Unity Style")))
            {
                SkinsLibrary.SetCurrent(SkinsLibrary.DefSkinType.Unity);
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("WimpMode: " + (config.wimpMode ? "Enabled" : "Disabled"));
            GUILayout.FlexibleSpace();
            if (GUILayout.Button((config.wimpMode ? "Disable" : "Enable"), GUILayout.Width(80)))
            {
                config.wimpMode = !config.wimpMode;
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Min Gee For Exercising when Landed: " + config.minimumLandedGeeForExcercising);
            GUILayout.FlexibleSpace();
            // TODO - need a float editor widget here for minimumLandedGeeForExcercising
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Initial fitness level:" + config.initialFitnessLevel.ToString());
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("+5", GUILayout.Width(80)))
            {
                config.initialFitnessLevel += 5;
                config.validate();
            }
            if (GUILayout.Button("-5", GUILayout.Width(80)))
            {
                config.initialFitnessLevel -= 5;
                config.validate();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Min fitness level:" + config.minFitnessLevel.ToString());
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("+5", GUILayout.Width(80)))
            {
                config.minFitnessLevel += 5;
                config.validate();
            }
            if (GUILayout.Button("-5", GUILayout.Width(80)))
            {
                config.minFitnessLevel -= 5;
                config.validate();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Max fitness level:" + config.maxFitnessLevel.ToString());
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("+5", GUILayout.Width(80)))
            {
                config.maxFitnessLevel += 5;
                config.validate();
            }
            if (GUILayout.Button("-5", GUILayout.Width(80)))
            {
                config.maxFitnessLevel -= 5;
                config.validate();
            }
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
        }
 internal override void OnGUIOnceOnly()
 {
     Styles.InitStyles();
     Styles.InitSkins();
     SkinsLibrary.SetCurrent("SolarizedDark");
 }