init() public static méthode

public static init ( double liquid, double mono, double solid, double xenon, double mass, double oxidizer, double engines ) : void
liquid double
mono double
solid double
xenon double
mass double
oxidizer double
engines double
Résultat void
Exemple #1
0
        private void drawKerbalnautWindow(int id)
        {
            GUI.skin = HighLogic.Skin;
            GUILayout.BeginVertical();

            GUILayout.Label("Kerbal Control Room", styleValueGreenBold);

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

            GUILayout.Label("Kerbonaut insurance cost: ", styleValueGreenBold);
            settings.kerbonautCost = GUILayout.TextField(settings.kerbonautCost);
            settings.kerbonautCost = Regex.Replace(settings.kerbonautCost, @"[^0-9]", "");
            GUILayout.Label("Insurance Is Charged At Launch. Gets Returned When Recovered long as the Kerbals Lived through the mission", styleValueName);

            if (GUILayout.Button("Save Kerbal Cost", styleButton))
            {
                Difficulty.init(settings.difficulty);

                SettingsManager.Manager.saveSettings();
            }

            GUILayout.Space(30);

            GUILayout.Label("Use This To Simulate Hired Kerbals, At this Point it is not connected to the Actual Hire Button in Astronaut Complex. It is up to you if you want to use this option at this time When You Do Hire An Applicant you can use this button to charge your space Program. The price can be adjusted above", styleValueName);
            if (GUILayout.Button(HireKerbal[kerbalCount], styleButtonYellow))
            {
                kerbalCount++;
                if (kerbalCount >= HireKerbal.Length)
                {
                    kerbalCount = 0;
                    manager.costs(res.kerbal());
                }
                if (kerbalCount != 1)
                {
                    settings.KerbalsHired++;
                }
            }
            showIntValue("Total Amount Kerbals Hired:", settings.KerbalsHired, styleValueGreen);
            GUILayout.Space(15);

            if (GUILayout.Button("Exit Window"))
            {
                Difficulty.init(settings.difficulty);

                SettingsManager.Manager.saveSettings();

                kerbalNautsWindow(false);
            }



            GUILayout.EndVertical();
            GUI.DragWindow();
        }
Exemple #2
0
 public void loadSettings()
 {
     try {
         settings = (Settings)parser.readFile("settings.cfg");
     } catch {
         settings = new Settings();
     }
     settings.changed = false;
     Difficulty.init(settings.difficulty);
 }
        private void drawSettingsWindow(int id)
        {
            GUI.skin = HighLogic.Skin;
            GUILayout.BeginVertical();

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


#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();
                GUISave();
            }

            GUILayout.EndVertical();
            GUI.DragWindow();
        }
Exemple #4
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();
        }