Advertisement
Guest User

Untitled

a guest
Feb 19th, 2021
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. // If any modder adds useKopernicusSolarPanels = false to a module instead of a part, add it to the part:
  2. @PART:HAS[@MODULE:HAS[#useKopernicusSolarPanels[?alse]]]:FINAL
  3. {
  4. %useKopernicusSolarPanels = false
  5. }
  6.  
  7. // Uses regular expressions to convert any case variants like FalSe to false
  8. @PART:HAS[#useKopernicusSolarPanels[*]]:FINAL
  9. {
  10. // This cfg will enable KopernicusSolarPanels
  11. // to allow support for multiple lightsources
  12. //
  13. // If you want to avoid this, add "useKopernicusSolarPanels = false" to the PART node
  14. // That will stop Kopernicus from changing the behaviour of SolarPanel
  15. @useKopernicusSolarPanels,* ^= :F:f:
  16. @useKopernicusSolarPanels,* ^= :A:a:
  17. @useKopernicusSolarPanels,* ^= :L:l:
  18. @useKopernicusSolarPanels,* ^= :S:s:
  19. @useKopernicusSolarPanels,* ^= :E:e:
  20. }
  21.  
  22. //First delete all old "KopernicusSolarPanels" fixers
  23. @PART:FINAL
  24. {
  25. !MODULE[KopernicusSolarPanels]
  26. }
  27.  
  28. // Converts all ModuleDeployableSolarPanel modules within a part to KopernicusSolarPanels unless the part has useKopernicusSolarPanels = false
  29. @PART:HAS[@MODULE[ModuleDeployableSolarPanel],~useKopernicusSolarPanels[false]]:FINAL
  30. {
  31. @MODULE[ModuleDeployableSolarPanel],*
  32. {
  33. @name = KopernicusSolarPanel
  34. }
  35. }
  36.  
  37. //B9PartSwitch support, changes the identifier to a generic identifier, just to be safe, but only runs if the part does not have useKopernicusSolarPanels = false ...
  38. @PART:HAS[@MODULE[ModuleB9PartSwitch],~useKopernicusSolarPanels[false]]:FINAL
  39. {
  40. @MODULE[ModuleB9PartSwitch],*
  41. {
  42. @SUBTYPE,*
  43. {
  44. @MODULE:HAS[@IDENTIFIER[ModuleDeployableSolarPanel]]
  45. {
  46. @IDENTIFIER[ModuleDeployableSolarPanel]
  47. {
  48. @name = KopernicusSolarPanel
  49. }
  50. }
  51. }
  52. }
  53. }
  54.  
  55. // clean up
  56. @PART:HAS[#useKopernicusSolarPanels[*]]:FINAL
  57. {
  58. !useKopernicusSolarPanels = delete
  59. }
  60.  
  61. @PART:HAS[@MODULE:HAS[#useKopernicusSolarPanels[*]]]:FINAL
  62. {
  63. @MODULE,*:HAS[#useKopernicusSolarPanels[*]]
  64. {
  65. !useKopernicusSolarPanels = delete
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement