Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // If any modder adds useKopernicusSolarPanels = false to a module instead of a part, add it to the part:
- @PART:HAS[@MODULE:HAS[#useKopernicusSolarPanels[?alse]]]:FINAL
- {
- %useKopernicusSolarPanels = false
- }
- // Uses regular expressions to convert any case variants like FalSe to false
- @PART:HAS[#useKopernicusSolarPanels[*]]:FINAL
- {
- // This cfg will enable KopernicusSolarPanels
- // to allow support for multiple lightsources
- //
- // If you want to avoid this, add "useKopernicusSolarPanels = false" to the PART node
- // That will stop Kopernicus from changing the behaviour of SolarPanel
- @useKopernicusSolarPanels,* ^= :F:f:
- @useKopernicusSolarPanels,* ^= :A:a:
- @useKopernicusSolarPanels,* ^= :L:l:
- @useKopernicusSolarPanels,* ^= :S:s:
- @useKopernicusSolarPanels,* ^= :E:e:
- }
- //First delete all old "KopernicusSolarPanels" fixers
- @PART:FINAL
- {
- !MODULE[KopernicusSolarPanels]
- }
- // Converts all ModuleDeployableSolarPanel modules within a part to KopernicusSolarPanels unless the part has useKopernicusSolarPanels = false
- @PART:HAS[@MODULE[ModuleDeployableSolarPanel],~useKopernicusSolarPanels[false]]:FINAL
- {
- @MODULE[ModuleDeployableSolarPanel],*
- {
- @name = KopernicusSolarPanel
- }
- }
- //B9PartSwitch support, changes the identifier to a generic identifier, just to be safe, but only runs if the part does not have useKopernicusSolarPanels = false ...
- @PART:HAS[@MODULE[ModuleB9PartSwitch],~useKopernicusSolarPanels[false]]:FINAL
- {
- @MODULE[ModuleB9PartSwitch],*
- {
- @SUBTYPE,*
- {
- @MODULE:HAS[@IDENTIFIER[ModuleDeployableSolarPanel]]
- {
- @IDENTIFIER[ModuleDeployableSolarPanel]
- {
- @name = KopernicusSolarPanel
- }
- }
- }
- }
- }
- // clean up
- @PART:HAS[#useKopernicusSolarPanels[*]]:FINAL
- {
- !useKopernicusSolarPanels = delete
- }
- @PART:HAS[@MODULE:HAS[#useKopernicusSolarPanels[*]]]:FINAL
- {
- @MODULE,*:HAS[#useKopernicusSolarPanels[*]]
- {
- !useKopernicusSolarPanels = delete
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement