コード例 #1
0
        private void drawSettingsWindow(int id)
        {
            GUI.skin = HighLogic.Skin;
            GUILayout.BeginVertical();

            settings.disablePlugin = GUILayout.Toggle(settings.disablePlugin, "Disable Plugin");

            GUILayout.Label("Kerbonaut insurance cost: ", styleValueGreenBold);
            settings.kerbonautCost = GUILayout.TextField(settings.kerbonautCost);
            settings.kerbonautCost = Regex.Replace(settings.kerbonautCost, @"[^0-9]", "");

#if DEBUG
            GUILayout.Label("Liquid Fuel: ", styleCaption);
            dLiquid = GUILayout.TextField(dLiquid);
            GUILayout.Label("Mono Fuel: ", styleCaption);
            dMono = GUILayout.TextField(dMono);
            GUILayout.Label("Solid Fuel: ", styleCaption);
            dSolid = GUILayout.TextField(dSolid);
            GUILayout.Label("Xenon Fuel: ", styleCaption);
            dXenon = GUILayout.TextField(dXenon);
            GUILayout.Label("Materials Construction: ", styleCaption);
            dMass = GUILayout.TextField(dMass);
            GUILayout.Label("Engine Cost And Cooling: ", styleCaption);
            dEngine = GUILayout.TextField(dEngine);
            GUILayout.Label("dOxizier: ", styleCaption);
            dOxidizer = GUILayout.TextField(dOxidizer);

            dLiquid   = Regex.Replace(dLiquid, "[^0-9\\.]", "");
            dMono     = Regex.Replace(dMono, "[^0-9\\.]", "");
            dSolid    = Regex.Replace(dSolid, "[^0-9\\.]", "");
            dXenon    = Regex.Replace(dXenon, "[^0-9\\.]", "");
            dMass     = Regex.Replace(dMass, "[^0-9\\.]", "");
            dEngine   = Regex.Replace(dEngine, "[^0-9\\.]", "");
            dOxidizer = Regex.Replace(dOxidizer, "[^0-9\\.]", "");
#else
            // Edited Malkuth add captions for info on how modes work
            GUILayout.Label("Chose Your Game Modes", styleValueGreenBold);
            settings.difficulty = GUILayout.SelectionGrid(settings.difficulty, difficulties, 3);
            GUILayout.Label("Flight Test Mode Is 3% Cost To Test Craft No Missions", styleValueGreenBold);
            GUILayout.Label("Launch Mode is Regular Gameplay Full Cost And Missions", styleValueGreenBold);
            GUILayout.Label("HardCore Mode Is 40% Reduction in Mission Payouts", styleValueGreenBold);
#endif

            GUILayout.Space(30);

            GUILayout.Label(contributions, styleText);



            if (GUILayout.Button(rewindStrings[rewindCount], styleButtonWordWrap))
            {
                rewindCount++;
                if (rewindCount >= rewindStrings.Length)
                {
                    rewindCount = 0;
                    manager.rewind();
                }
            }

            if (GUILayout.Button(resetStrings[resetCount], styleButtonWordWrap))
            {
                resetCount++;
                if (resetCount >= resetStrings.Length)
                {
                    resetCount = 0;
                    manager.resetSpaceProgram();
                }
            }

            if (GUILayout.Button("Save and Close Settings", styleButton))
            {
                settingsWindow(false);

#if DEBUG
                Difficulty.init(double.Parse(dLiquid), double.Parse(dMono), double.Parse(dSolid), double.Parse(dXenon),
                                double.Parse(dMass), double.Parse(dOxidizer), double.Parse(dEngine));
#else
                Difficulty.init(settings.difficulty);
#endif

                SettingsManager.Manager.saveSettings();
            }

            GUILayout.EndVertical();
            GUI.DragWindow();
        }
コード例 #2
0
        private void drawSettingsWindow(int id)
        {
            GUI.skin = HighLogic.Skin;
            GUILayout.BeginVertical();

            settings.disablePlugin = GUILayout.Toggle(settings.disablePlugin, "Disable plugin. No launch costs");

            GUILayout.Label("Kerbonaut insurance cost: ", styleCaption);
            settings.kerbonautCost = GUILayout.TextField(settings.kerbonautCost);
            settings.kerbonautCost = Regex.Replace(settings.kerbonautCost, @"[^0-9]", "");

#if DEBUG
            GUILayout.Label("Liquid Fuel: ", styleCaption);
            dLiquid = GUILayout.TextField(dLiquid);
            GUILayout.Label("Mono Fuel: ", styleCaption);
            dMono = GUILayout.TextField(dMono);
            GUILayout.Label("Solid Fuel: ", styleCaption);
            dSolid = GUILayout.TextField(dSolid);
            GUILayout.Label("Xenon Fuel: ", styleCaption);
            dXenon = GUILayout.TextField(dXenon);
            GUILayout.Label("Mass: ", styleCaption);
            dMass = GUILayout.TextField(dMass);
            GUILayout.Label("Liquid Engine: ", styleCaption);
            dEngine = GUILayout.TextField(dEngine);
            GUILayout.Label("dOxizier: ", styleCaption);
            dOxidizer = GUILayout.TextField(dOxidizer);

            dLiquid   = Regex.Replace(dLiquid, "[^0-9\\.]", "");
            dMono     = Regex.Replace(dMono, "[^0-9\\.]", "");
            dSolid    = Regex.Replace(dSolid, "[^0-9\\.]", "");
            dXenon    = Regex.Replace(dXenon, "[^0-9\\.]", "");
            dMass     = Regex.Replace(dMass, "[^0-9\\.]", "");
            dEngine   = Regex.Replace(dEngine, "[^0-9\\.]", "");
            dOxidizer = Regex.Replace(dOxidizer, "[^0-9\\.]", "");
#else
            GUILayout.Label("Difficulty: ", styleCaption);
            settings.difficulty = GUILayout.SelectionGrid(settings.difficulty, difficulties, 3);
#endif

            GUILayout.Space(30);

            GUILayout.Label(contributions, styleText);

            if (GUILayout.Button(rewindStrings[rewindCount], styleButtonWordWrap))
            {
                rewindCount++;
                if (rewindCount >= rewindStrings.Length)
                {
                    rewindCount = 0;
                    manager.rewind();
                }
            }

            if (GUILayout.Button(resetStrings[resetCount], styleButtonWordWrap))
            {
                resetCount++;
                if (resetCount >= resetStrings.Length)
                {
                    resetCount = 0;
                    manager.resetSpaceProgram();
                }
            }

            if (GUILayout.Button("Save and Close Settings", styleButton))
            {
                settingsWindow(false);

#if DEBUG
                Difficulty.init(double.Parse(dLiquid), double.Parse(dMono), double.Parse(dSolid), double.Parse(dXenon),
                                double.Parse(dMass), double.Parse(dOxidizer), double.Parse(dEngine));
#else
                Difficulty.init(settings.difficulty);
#endif

                SettingsManager.Manager.saveSettings();
            }

            GUILayout.EndVertical();
            GUI.DragWindow();
        }