Config-driven PAW items customization #283
Labels
enhancement
New feature or request
kspModding
Modding fix or API extension
kspQoL
Quality of life modification
The current
PAWStockGroups
patch could be improved in some ways :ReflectedData
instead.Some tangentially related considerations :
The common point between all those features is that the required underlying infrastructure is essentially the same, so it would make sense to have an unified solution. The general idea would be a config-driven way to override/define paw groups and to alter fields/events/action names :
ReflectedData
.AvailablePart ParsePart(UrlDir.UrlConfig urlConfig, ConfigNode node)
postfix) and stored in a static database (likely a dictionary withAvailablePart
keys), which would then be queried and applied in aPart.Start()
prefix (as we need to wait for the part and every module to go through itsModularSetup()
from itsAwake()
).One drawback to the config-driven approach is that we loose the ability to implement some code-based refinements. Notably, we currently set the default expanded/collapsed state of our custom groups depending on the module count (which isn't that great of an heuristic). We also do some module parsing to generate/customize the generators PAW group title.
Also, making things config driven, while allowing full customization, isn't really addressing the general UX issue for people that want some parts of the KSPCF PAW customization but not others, as this require some basic understanding of MM patching, and so is far from user friendly. This might end up being a problem, as it is likely people will be disabling the whole patch, which isn't desirable if we implement modding features other mods start relying upon. Likely can be solved by clearly decoupling the code patch from the default configs in separate feature switches.
And on a side note, it might be worthwhile to implement the base infrastructure for this in a generalized way with a public API that other plugins could leverage. Something like
PartInstanceModification
andModuleInstanceModification
base classes, with a constructor receiving the part/module prefab and config as arguments, called during part compilation, then virtualOnPartInstantiated()
/OnModuleInstantiated()
methods called beforePart.Start()
. This would allow other KSPCF patches and any plugin to implement custom logic to alter fields/events/actions, and could possibly have other use cases as well.The text was updated successfully, but these errors were encountered: