Esempio n. 1
0
        /// <summary>
        /// Patch ColonyDestinationSelectScreen.SettingChanged to replace displayed Trait Descriptors
        /// </summary>
        static void Postfix(ref NewGameSettingsPanel ___newGameSettings, ref DestinationSelectPanel ___destinationMapPanel, ref AsteroidDescriptorPanel ___startLocationProperties)
        {
            string setting = ___newGameSettings.GetSetting(CustomGameSettingConfigs.ClusterLayout);

            int.TryParse(___newGameSettings.GetSetting(CustomGameSettingConfigs.WorldgenSeed), out int result);
            ColonyDestinationAsteroidBeltData colonyDestinationAsteroidData = ___destinationMapPanel.SelectAsteroid(setting, result);

            ___startLocationProperties.SetDescriptors(GetModifiedTraitDescriptors(colonyDestinationAsteroidData.GetTraitDescriptors()));
        }
    private void SettingChanged(SettingConfig config, SettingLevel level)
    {
        coordinate.text = CustomGameSettings.Instance.GetSettingsCoordinate();
        string setting  = newGameSettings.GetSetting(CustomGameSettingConfigs.World);
        string setting2 = newGameSettings.GetSetting(CustomGameSettingConfigs.WorldgenSeed);

        int.TryParse(setting2, out int result);
        ColonyDestinationAsteroidData colonyDestinationAsteroidData = destinationMapPanel.SelectAsteroid(setting, result);

        DebugUtil.LogArgs("Selected asteroid", setting, result);
        destinationProperties.SetDescriptors(colonyDestinationAsteroidData.GetParamDescriptors());
        startLocationProperties.SetDescriptors(colonyDestinationAsteroidData.GetTraitDescriptors());
    }