Пример #1
0
        private void scenario_SelectedChanged(MyGuiControlRadioButtonGroup group)
        {
            SetDefaultName();

            // If the scenario selected is "Empty World" it will select Safe as the default environment, but only if this setting wasn't changed before
            if (!m_isHostilityChanged)
            {
                m_environment.SelectItemByKey((int)(m_scenarioTypesGroup.SelectedButton as MyGuiControlScenarioButton).Scenario.DefaultEnvironment);
                // It will change with the above code to true
                m_isHostilityChanged = false;
            }

            if (MyFakes.ENABLE_PLANETS)
            {
                m_worldGeneratorButton.Enabled = (m_scenarioTypesGroup.SelectedButton as MyGuiControlScenarioButton).Scenario.AsteroidClustersEnabled;
                if (m_worldGeneratorButton.Enabled)
                {
                    if (WorldGenerator != null)
                    {
                        WorldGenerator.GetSettings(m_settings);
                        AsteroidAmount = WorldGenerator.AsteroidAmount;
                    }
                }
                else if (m_settings != null)
                {
                    AsteroidAmount         = 0;
                    m_settings.EnableFlora = true;
                }
            }
            else
            {
                UpdateAsteroidAmountEnabled((m_scenarioTypesGroup.SelectedButton as MyGuiControlScenarioButton).Scenario.AsteroidClustersEnabled);
            }
        }
 private void scenario_SelectedChanged(MyGuiControlRadioButtonGroup group)
 {
     SetDefaultName();
     if (MyFakes.ENABLE_PLANETS)
     {
         m_worldGeneratorButton.Enabled = (m_scenarioTypesGroup.SelectedButton as MyGuiControlScenarioButton).Scenario.AsteroidClustersEnabled;
         if (m_worldGeneratorButton.Enabled)
         {
             if (WorldGenerator != null)
             {
                 WorldGenerator.GetSettings(m_settings);
                 AsteroidAmount = WorldGenerator.AsteroidAmount;
             }
         }
         else if (m_settings != null)
         {
             AsteroidAmount           = 0;
             m_settings.EnableFlora   = false;
             m_settings.EnablePlanets = false;
         }
     }
     else
     {
         UpdateAsteroidAmountEnabled((m_scenarioTypesGroup.SelectedButton as MyGuiControlScenarioButton).Scenario.AsteroidClustersEnabled);
     }
 }
Пример #3
0
        private void scenario_SelectedChanged(MyGuiControlRadioButtonGroup group)
        {
            SetDefaultName();

            // If the scenario selected is "Empty World" it will select Safe as the default environment, but only if this setting wasn't changed before
            if (!m_isHostilityChanged)
            {
                m_environment.SelectItemByKey(0);
                // It will change with the above code to true
                m_isHostilityChanged = false;
            }

            if (MyFakes.ENABLE_PLANETS)
            {
                m_worldGeneratorButton.Enabled = true;
                if (m_worldGeneratorButton.Enabled)
                {
                    if (WorldGenerator != null)
                    {
                        WorldGenerator.GetSettings(m_settings);
                        AsteroidAmount = WorldGenerator.AsteroidAmount;
                    }
                    else
                    {
                        //GK: If AsteroidAmount==0 it will cause no Asteroids spawned near player in Asteroids Scenario
                        AsteroidAmount = -1;
                    }
                }
                else if (m_settings != null)
                {
                    AsteroidAmount         = 0;
                    m_settings.EnableFlora = true;
                }
            }
            else
            {
                UpdateAsteroidAmountEnabled(true);
            }

            var   checkpointPath = group.SelectedButton.UserData as string;
            ulong size;
            var   checkpoint = MyLocalCache.LoadCheckpoint(checkpointPath, out size);

            if (checkpoint != null)
            {
                m_settings = CopySettings(checkpoint.Settings);
                SetSettingsToControls();
            }
        }
Пример #4
0
 void WorldGenerator_OnOkButtonClicked()
 {
     WorldGenerator.GetSettings(m_settings);
     AsteroidAmount = WorldGenerator.AsteroidAmount;
     SetSettingsToControls();
 }