Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Configuration: make Profiles MM-patchable #8

Open
SirMortimer opened this issue Mar 4, 2020 · 0 comments
Open

Simplify Configuration: make Profiles MM-patchable #8

SirMortimer opened this issue Mar 4, 2020 · 0 comments
Labels
cfg code enhancement New feature or request

Comments

@SirMortimer
Copy link
Contributor

Currently, Kerbalism parses the profile before MM gets to run. Based on the processes that are defined in the profile, and based on what is set in Settings.cfg, we then inject FeatureX definitions into MM, so that partial configurations can be enabled/disabled with f.i. NEEDS[FeatureRadiation]. This is done by matching the process modifiers against a list of hardcoded strings, see here:

https://github.com/Kerbalism/Kerbalism/blob/00baeaf8707ee3e8cd7ebc180440685115a018ae/src/Kerbalism/System/Features.cs#L35-L40

Then there are other features that solely depend on a corresponding setting in Settings.cfg, like these:

https://github.com/Kerbalism/Kerbalism/blob/00baeaf8707ee3e8cd7ebc180440685115a018ae/src/Kerbalism/System/Features.cs#L14-L21

I propose to:

  1. Reduce the amount of FeatureX to the currently used. F.i. have FeaturePressure that nobody even knows exists and isn't used in any config file (I just checked). Identify the currently used ones and retain only those.
  2. Don't parse the profile to determine which feature to enable. Move everything into Settings.cfg and only used what is defined there.
SirMortimer referenced this issue in Kerbalism/Kerbalism Mar 8, 2020
…es settings and profiles MM-Patchable

Features are no longer auto-detected from the profile, but must be set explicitly in configuration.
Features are configured in their own config node, KerbalismFeatures. This config node is immune to MM patches.
Settings and Profile now can be modified by MM patches.

This fixes #612

Notes:

- NEEDS[KerbalismDefault] was changed to NEEDS[Kerbalism]
- The FeatureX definitions do no longer exist (f.i. FeaturePressure etc)
- The following new Kerbalism features are set in MM if they are enabled in Settings:
  1. KerbalismLifeSupport (was FeatureHabitat, FeatureSupplies, FeaturePressure, FeaturePoisoning and FeatureLivingSpace)
  2. KerbalismRadiation (was FeatureRadiation and FeatureSpaceWeather)
  3. KerbalismStress (was FeatureComfort)
  4. KerbalismFailures (was FeatureReliability)
  5. KerbalismScience (was FeatureScience)
@gotmachine gotmachine transferred this issue from Kerbalism/Kerbalism Jul 29, 2021
@gotmachine gotmachine added enhancement New feature or request code cfg labels Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cfg code enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants