diff --git a/files/ModuleManager.4.1.0.dll b/files/ModuleManager.4.1.0.dll deleted file mode 100644 index a04d7dc..0000000 Binary files a/files/ModuleManager.4.1.0.dll and /dev/null differ diff --git a/files/ModuleManager.4.1.4.dll b/files/ModuleManager.4.1.4.dll new file mode 100644 index 0000000..b47a6da Binary files /dev/null and b/files/ModuleManager.4.1.4.dll differ diff --git a/files/configs/Add_LF+Ox_to_LF_Ox_tanks.cfg b/files/configs/Add_LF+Ox_to_LF_Ox_tanks.cfg new file mode 100644 index 0000000..5fd89cf --- /dev/null +++ b/files/configs/Add_LF+Ox_to_LF_Ox_tanks.cfg @@ -0,0 +1,129 @@ +// For some parts that have LF on them, add the option to switch to Ox or LF+Ox. +@PART[*]:HAS[@RESOURCE[LiquidFuel],!RESOURCE[Oxidizer],!MODULE[ModuleCommand],!MODULE[ModuleEngines],!MODULE[ModuleEnginesFX],!MODULE[ModuleSimpleFuelSwitch]]:FOR[SimpleFuelSwitch] +{ + MODULE + { + name = ModuleSimpleFuelSwitch + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = liquid_fuel_only + displayName = #SimpleFuelSwitch_LiquidFuel + selectorFieldName = #SimpleFuelSwitch_fuelTypeLabel + isDefault = true + RESOURCE + { + name = LiquidFuel + amount = #$/RESOURCE[LiquidFuel]/amount$ + maxAmount = #$/RESOURCE[LiquidFuel]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = oxidizer_only + displayName = #SimpleFuelSwitch_Oxidizer + selectorFieldName = #SimpleFuelSwitch_fuelTypeLabel + RESOURCE + { + name = Oxidizer + amount = #$/RESOURCE[LiquidFuel]/amount$ + maxAmount = #$/RESOURCE[LiquidFuel]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = liquid_fuel_oxidizer + displayName = #SimpleFuelSwitch_LiquidFuelAndOxidizer + selectorFieldName = #SimpleFuelSwitch_fuelTypeLabel + RESOURCE + { + name = LiquidFuel + amount = #$/RESOURCE[LiquidFuel]/amount$ + @amount *= 0.45 + maxAmount = #$/RESOURCE[LiquidFuel]/maxAmount$ + @maxAmount *= 0.45 + } + RESOURCE + { + name = Oxidizer + amount = #$/RESOURCE[LiquidFuel]/amount$ + @amount *= 0.55 + maxAmount = #$/RESOURCE[LiquidFuel]/maxAmount$ + @maxAmount *= 0.55 + } + } + + -RESOURCE[LiquidFuel] {} + -RESOURCE[Oxidizer] {} +} + +// For some parts that have Ox on them, add the option to switch to LF or LF+Ox. +@PART[*]:HAS[!RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[ModuleCommand],!MODULE[ModuleEngines],!MODULE[ModuleEnginesFX],!MODULE[ModuleSimpleFuelSwitch]]:FOR[SimpleFuelSwitch] +{ + MODULE + { + name = ModuleSimpleFuelSwitch + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = oxidizer_only + displayName = #SimpleFuelSwitch_Oxidizer + selectorFieldName = #SimpleFuelSwitch_fuelTypeLabel + isDefault = true + RESOURCE + { + name = Oxidizer + amount = #$/RESOURCE[Oxidizer]/amount$ + maxAmount = #$/RESOURCE[Oxidizer]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = liquid_fuel_only + displayName = #SimpleFuelSwitch_LiquidFuel + selectorFieldName = #SimpleFuelSwitch_fuelTypeLabel + RESOURCE + { + name = LiquidFuel + amount = #$/RESOURCE[Oxidizer]/amount$ + maxAmount = #$/RESOURCE[Oxidizer]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = liquid_fuel_oxidizer + displayName = #SimpleFuelSwitch_LiquidFuelAndOxidizer + selectorFieldName = #SimpleFuelSwitch_fuelTypeLabel + RESOURCE + { + name = LiquidFuel + amount = #$/RESOURCE[Oxidizer]/amount$ + @amount *= 0.45 + maxAmount = #$/RESOURCE[Oxidizer]/maxAmount$ + @maxAmount *= 0.45 + } + RESOURCE + { + name = Oxidizer + amount = #$/RESOURCE[Oxidizer]/amount$ + @amount *= 0.55 + maxAmount = #$/RESOURCE[Oxidizer]/maxAmount$ + @maxAmount *= 0.55 + } + } + + -RESOURCE[LiquidFuel] {} + -RESOURCE[Oxidizer] {} +} diff --git a/files/configs/Add_LFO_to_LF_tanks.cfg b/files/configs/Add_LFO_to_LF_tanks.cfg deleted file mode 100644 index 291f153..0000000 --- a/files/configs/Add_LFO_to_LF_tanks.cfg +++ /dev/null @@ -1,50 +0,0 @@ -// For some parts that have LF on them, add the option to switch to LFO. -@PART[miniFuselage|noseConeAdapter|wingShuttleDelta|mk2FuselageShortLiquid|mk2Fuselage|mk3FuselageLF_25|mk3FuselageLF_50|mk3FuselageLF_100]:FOR[SimpleFuelSwitch] -{ - MODULE - { - name = ModuleSimpleFuelSwitch - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = liquid_fuel_only - displayName = #SimpleFuelSwitch_LiquidFuel - selectorFieldName = #SimpleFuelSwitch_fuelTypeLabel - isDefault = true - RESOURCE - { - name = LiquidFuel - amount = #$/RESOURCE[LiquidFuel]/amount$ - maxAmount = #$/RESOURCE[LiquidFuel]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = liquid_fuel_oxidizer - displayName = #SimpleFuelSwitch_LiquidFuelAndOxidizer - selectorFieldName = #SimpleFuelSwitch_fuelTypeLabel - RESOURCE - { - name = LiquidFuel - amount = #$/RESOURCE[LiquidFuel]/amount$ - @amount *= 0.45 - maxAmount = #$/RESOURCE[LiquidFuel]/maxAmount$ - @maxAmount *= 0.45 - } - RESOURCE - { - name = Oxidizer - amount = #$/RESOURCE[LiquidFuel]/amount$ - @amount *= 0.55 - maxAmount = #$/RESOURCE[LiquidFuel]/maxAmount$ - @maxAmount *= 0.55 - } - } - - -RESOURCE[LiquidFuel] {} - -RESOURCE[Oxidizer] {} -} \ No newline at end of file diff --git a/files/configs/Add_LF_to_LFO_tanks.cfg b/files/configs/Add_LF_Ox_to_LF+Ox_tanks.cfg similarity index 63% rename from files/configs/Add_LF_to_LFO_tanks.cfg rename to files/configs/Add_LF_Ox_to_LF+Ox_tanks.cfg index 27e4536..ab3779d 100644 --- a/files/configs/Add_LF_to_LFO_tanks.cfg +++ b/files/configs/Add_LF_Ox_to_LF+Ox_tanks.cfg @@ -1,5 +1,5 @@ -// For all parts that have LFO on them, add the option to switch to LF-only. -@PART[*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[ModuleSimpleFuelSwitch]]:FOR[SimpleFuelSwitch] +// For all parts that have LF+Ox on them, add the option to switch to LF or Ox only. +@PART[*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[ModuleCommand],!MODULE[ModuleEngines],!MODULE[ModuleEnginesFX],!MODULE[ModuleSimpleFuelSwitch]]:FOR[SimpleFuelSwitch] { MODULE { @@ -43,6 +43,22 @@ } } + MODULE + { + name = ModuleSwitchableResources + resourcesId = oxidizer_only + displayName = #SimpleFuelSwitch_Oxidizer + selectorFieldName = #SimpleFuelSwitch_fuelTypeLabel + RESOURCE + { + name = Oxidizer + amount = #$/RESOURCE[Oxidizer]/amount$ + @amount += #$/RESOURCE[LiquidFuel]/amount$ + maxAmount = #$/RESOURCE[Oxidizer]/maxAmount$ + @maxAmount += #$/RESOURCE[LiquidFuel]/maxAmount$ + } + } + -RESOURCE[LiquidFuel] {} -RESOURCE[Oxidizer] {} -} \ No newline at end of file +} diff --git a/files/configs/Hide_redundant_parts.cfg b/files/configs/Hide_redundant_parts.cfg index 241a8b7..3348261 100644 --- a/files/configs/Hide_redundant_parts.cfg +++ b/files/configs/Hide_redundant_parts.cfg @@ -1,220 +1,235 @@ -// There are some LF-only parts that are now redundant, since they're -// exactly physically equivalent to LFO parts that now have the ability -// to switch between LFO and LF as desired. Therefore, hide parts to remove -// redundancy. - -@PART[MK1Fuselage|mk2FuselageShortLFO|mk2FuselageLongLFO|mk3FuselageLFO_25|mk3FuselageLFO_50|mk3FuselageLFO_100]:FOR[SimpleFuelSwitch] -{ - %TechHidden = True - @category = none - @TechRequired = none -} - -//--------------------------------------------------------------------------------- -// Make the "hidden" Mk2 and Mk3 part textures available as part variants. -// Thanks to theonegalen for suggesting! - -// mk2FuselageShortLFO -> mk2FuselageShortLiquid -@PART[mk2FuselageShortLiquid]:FOR[SimpleFuelSwitch] -{ - MODEL - { - model = Squad/Parts/FuelTank/mk2FuselageShort/FuselageShortLFO - } - MODULE - { - name = ModulePartVariants - baseVariant = White - baseThemeName = White - VARIANT - { - name = White - displayName = #autoLOC_8007119 - themeName = White - primaryColor = #ffffff - secondaryColor = #ffffff - GAMEOBJECTS - { - FuselageShortLiquid = true - FuselageShortLFO = false - } - } - VARIANT - { - name = BlackAndWhite - displayName = #autoLOC_8007122 - themeName = BlackAndWhite - primaryColor = #ffffff - secondaryColor = #000000 - GAMEOBJECTS - { - FuselageShortLiquid = false - FuselageShortLFO = true - } - } - } -} - -// mk2FuselageLongLFO -> mk2Fuselage -@PART[mk2Fuselage]:FOR[SimpleFuelSwitch] -{ - MODEL - { - model = Squad/Parts/FuelTank/mk2FuselageLong/FuselageLongLFO - } - MODULE - { - name = ModulePartVariants - baseVariant = White - baseThemeName = White - VARIANT - { - name = White - displayName = #autoLOC_8007119 - themeName = White - primaryColor = #ffffff - secondaryColor = #ffffff - GAMEOBJECTS - { - FuselageLongLiquid = true - FuselageLongLFO = false - } - } - VARIANT - { - name = BlackAndWhite - displayName = #autoLOC_8007122 - themeName = BlackAndWhite - primaryColor = #ffffff - secondaryColor = #000000 - GAMEOBJECTS - { - FuselageLongLiquid = false - FuselageLongLFO = true - } - } - } -} - -// mk3FuselageLFO_25 -> mk3FuselageLF_25 -@PART[mk3FuselageLF_25]:FOR[SimpleFuelSwitch] -{ - MODEL - { - model = Squad/Parts/FuelTank/mk3Fuselage/LFO_25 - } - MODULE - { - name = ModulePartVariants - baseVariant = White - baseThemeName = White - VARIANT - { - name = White - displayName = #autoLOC_8007119 - themeName = White - primaryColor = #ffffff - secondaryColor = #ffffff - GAMEOBJECTS - { - LF_2.5m = true - LFO_2.5m = false - } - } - VARIANT - { - name = BlackAndWhite - displayName = #autoLOC_8007122 - themeName = BlackAndWhite - primaryColor = #ffffff - secondaryColor = #000000 - GAMEOBJECTS - { - LF_2.5m = false - LFO_2.5m = true - } - } - } -} - -// mk3FuselageLFO_50 -> mk3FuselageLF_50 -@PART[mk3FuselageLF_50]:FOR[SimpleFuelSwitch] -{ - MODEL - { - model = Squad/Parts/FuelTank/mk3Fuselage/LFO_50 - } - MODULE - { - name = ModulePartVariants - baseVariant = White - baseThemeName = White - VARIANT - { - name = White - displayName = #autoLOC_8007119 - themeName = White - primaryColor = #ffffff - secondaryColor = #ffffff - GAMEOBJECTS - { - LF_5m = true - LFO_5m = false - } - } - VARIANT - { - name = BlackAndWhite - displayName = #autoLOC_8007122 - themeName = BlackAndWhite - primaryColor = #ffffff - secondaryColor = #000000 - GAMEOBJECTS - { - LF_5m = false - LFO_5m = true - } - } - } -} - -// mk3FuselageLFO_100 -> mk3FuselageLF_100 -@PART[mk3FuselageLF_100]:FOR[SimpleFuelSwitch] -{ - MODEL - { - model = Squad/Parts/FuelTank/mk3Fuselage/LFO_100 - } - MODULE - { - name = ModulePartVariants - baseVariant = White - baseThemeName = White - VARIANT - { - name = White - displayName = #autoLOC_8007119 - themeName = White - primaryColor = #ffffff - secondaryColor = #ffffff - GAMEOBJECTS - { - LF_10m = true - LFO_10m = false - } - } - VARIANT - { - name = BlackAndWhite - displayName = #autoLOC_8007122 - themeName = BlackAndWhite - primaryColor = #ffffff - secondaryColor = #000000 - GAMEOBJECTS - { - LF_10m = false - LFO_10m = true - } - } - } -} +// There are some LF-only parts that are now redundant, since they're +// exactly physically equivalent to LFO parts that now have the ability +// to switch between LFO and LF as desired. Therefore, hide parts to remove +// redundancy. + +@PART[MK1Fuselage|mk2FuselageShortLiquid|mk2Fuselage|mk3FuselageLF_25|mk3FuselageLF_50|mk3FuselageLF_100]:FOR[SimpleFuelSwitch] +{ + %TechHidden = True + @category = none + @TechRequired = none +} + +//--------------------------------------------------------------------------------- +// Make the "hidden" Mk2 and Mk3 part textures available as part variants. Thanks to theonegalen for suggesting! +// Also rename the parts! + +@PART[miniFuselage]:FOR[SimpleFuelSwitch] +{ + @title ^= :Liquid Fuel:Fueled: +} + +// mk2FuselageShortLiquid -> mk2FuselageShortLFO +@PART[mk2FuselageShortLFO]:FOR[SimpleFuelSwitch] +{ + @title ^= :Rocket Fuel:Fueled: + + MODEL + { + model = Squad/Parts/FuelTank/mk2FuselageShort/FuselageShortLiquid + } + MODULE + { + name = ModulePartVariants + baseVariant = White + baseThemeName = White + VARIANT + { + name = White + displayName = #autoLOC_8007119 + themeName = White + primaryColor = #ffffff + secondaryColor = #ffffff + GAMEOBJECTS + { + FuselageShortLiquid = true + FuselageShortLFO = false + } + } + VARIANT + { + name = BlackAndWhite + displayName = #autoLOC_8007122 + themeName = BlackAndWhite + primaryColor = #ffffff + secondaryColor = #000000 + GAMEOBJECTS + { + FuselageShortLiquid = false + FuselageShortLFO = true + } + } + } +} + +// mk2Fuselage -> mk2FuselageLongLFO +@PART[mk2FuselageLongLFO]:FOR[SimpleFuelSwitch] +{ + @title ^= :Rocket Fuel:Fueled: + + MODEL + { + model = Squad/Parts/FuelTank/mk2FuselageLong/FuselageLongLiquid + } + MODULE + { + name = ModulePartVariants + baseVariant = White + baseThemeName = White + VARIANT + { + name = White + displayName = #autoLOC_8007119 + themeName = White + primaryColor = #ffffff + secondaryColor = #ffffff + GAMEOBJECTS + { + FuselageLongLiquid = true + FuselageLongLFO = false + } + } + VARIANT + { + name = BlackAndWhite + displayName = #autoLOC_8007122 + themeName = BlackAndWhite + primaryColor = #ffffff + secondaryColor = #000000 + GAMEOBJECTS + { + FuselageLongLiquid = false + FuselageLongLFO = true + } + } + } +} + +// mk3FuselageLF_25 -> mk3FuselageLFO_25 +@PART[mk3FuselageLFO_25]:FOR[SimpleFuelSwitch] +{ + @title ^= :Rocket Fuel:Fueled: + + MODEL + { + model = Squad/Parts/FuelTank/mk3Fuselage/LF_25 + } + MODULE + { + name = ModulePartVariants + baseVariant = White + baseThemeName = White + VARIANT + { + name = White + displayName = #autoLOC_8007119 + themeName = White + primaryColor = #ffffff + secondaryColor = #ffffff + GAMEOBJECTS + { + LF_2.5m = true + LFO_2.5m = false + } + } + VARIANT + { + name = BlackAndWhite + displayName = #autoLOC_8007122 + themeName = BlackAndWhite + primaryColor = #ffffff + secondaryColor = #000000 + GAMEOBJECTS + { + LF_2.5m = false + LFO_2.5m = true + } + } + } +} + +// mk3FuselageLF_50 -> mk3FuselageLFO_50 +@PART[mk3FuselageLFO_50]:FOR[SimpleFuelSwitch] +{ + @title ^= :Rocket Fuel:Fueled: + + MODEL + { + model = Squad/Parts/FuelTank/mk3Fuselage/LF_50 + } + MODULE + { + name = ModulePartVariants + baseVariant = White + baseThemeName = White + VARIANT + { + name = White + displayName = #autoLOC_8007119 + themeName = White + primaryColor = #ffffff + secondaryColor = #ffffff + GAMEOBJECTS + { + LF_5m = true + LFO_5m = false + } + } + VARIANT + { + name = BlackAndWhite + displayName = #autoLOC_8007122 + themeName = BlackAndWhite + primaryColor = #ffffff + secondaryColor = #000000 + GAMEOBJECTS + { + LF_5m = false + LFO_5m = true + } + } + } +} + +// mk3FuselageLF_100 -> mk3FuselageLFO_100 +@PART[mk3FuselageLFO_100]:FOR[SimpleFuelSwitch] +{ + @title ^= :Rocket Fuel:Fueled: + + MODEL + { + model = Squad/Parts/FuelTank/mk3Fuselage/LF_100 + } + MODULE + { + name = ModulePartVariants + baseVariant = White + baseThemeName = White + VARIANT + { + name = White + displayName = #autoLOC_8007119 + themeName = White + primaryColor = #ffffff + secondaryColor = #ffffff + GAMEOBJECTS + { + LF_10m = true + LFO_10m = false + } + } + VARIANT + { + name = BlackAndWhite + displayName = #autoLOC_8007122 + themeName = BlackAndWhite + primaryColor = #ffffff + secondaryColor = #000000 + GAMEOBJECTS + { + LF_10m = false + LFO_10m = true + } + } + } +} diff --git a/files/configs/README.md b/files/configs/README.md index cd783b1..138af30 100644 --- a/files/configs/README.md +++ b/files/configs/README.md @@ -1,57 +1,57 @@ -## SimpleFuelSwitch configuration - -### Configs provided with the mod - -There are currently three config files provided here: - -* Add_LFO_to_LF_tanks.cfg: Every LFO tank has an option added for an equivalent amount of LF. -* Add_LF_to_LFO_tanks.cfg: For certain specific LF tanks, add LFO as an option. -* Hide_redundant_parts.cfg: Some parts are no longer needed, because the function is filled by another tank that can now switch resources. Remove these, to reduce parts tab clutter in the editor. - -Note that the "removed" parts from the third config file aren't _actually_ removed, just hidden. Thus, any existing ships you've already designed or launched with them will be fine. - -If you don't like what any of the above files do (e.g. "Oh noes, I don't want to get rid of the 'redundant' parts" or whatever), you can just delete any or all of them. - - -### How to tinker with your own config - -SimpleFuelSwitch is fairly simple to configure, by design. There are two new PartModules to deal with: - -* ModuleSimpleFuelSwitch -* ModuleSwitchableResources - -For a part to use these modules, it should be set up as follows: - -1. If the part has any "built-in" resources that you want to be switchable, _remove them_. (They'll be replaced by these new modules.) -2. Add _one_ ModuleSimpleFuelSwitch. (Don't add multiple ones.) -3. Add one ModuleSwitchableResources for each resource option you want to have. Generally you'll always have at least two of these (otherwise there's nothing to "switch"). - -Example: You want to modify a monoprop tank to be able to choose between monoprop and LFO. You'd use ModuleManager to patch it as follows: - -1. Delete the monoprop from the part (since these modules will take over). -2. Add a ModuleSimpleFuelSwitch. -3. Add one ModuleSwitchableResources for the monoprop option, and another ModuleSwitchableResources for the LFO option. - -Each ModuleSwitchableResources can specify the following: - -* _resourcesId_: *Required.* A unique ID field that distinguishes this ModuleSwitchableResources from all the others on this part. Never displayed to a user. -* _displayName_: How you want it to show up in the UI (e.g. "LFO"). Optional. If you don't specify, will be auto-generated from the resource names. -* _selectorFieldName_: How you want the button in the UI to be labeled, e.g. "Fuel Type". Optional; if unspecified, defaults to "Resource". -* _isDefault_: Whether you want _this_ set of resources to be the one that's initially picked by default for newly placed parts. -* Resources. - -The "resourcesId" field can have any value you want (ideally would be something human-readable, to facilitate debugging). It needs to meet two requirements: - -* Unique within the part: don't add two ModuleSwitchableResources that have the same resourceId as each other. -* Permanently invariant: once you've used it to design and launch ships, you can never change it after that, because doing so would break any existing ships that used the old ID. - -The resources for the ModuleSwitchableResources are specified in a set of RESOURCE sections, same as resources for a regular part. - - -### Using variants - -SimpleFuelSwitch also supports the ability to set up config that ties specific resource selections to _variants_, i.e. picking different variants will select different resource types. - -The default configs that are installed with this mod don't happen to use the feature. If you'd like to see how it works, though, please see the "examples" folder on the mod's github repository for some ideas. - -Executive summary is that all you have to do is add a "linkedVariant" field to each of your ModuleSwitchableResources, specifying which variant (or variants) correspond to that resource selection. +## SimpleFuelSwitch configuration + +### Configs provided with the mod + +There are currently three config files provided here: + +* Add_LFO_to_LF_tanks.cfg: Every LFO tank has an option added for an equivalent amount of LF. +* Add_LF_to_LFO_tanks.cfg: For certain specific LF tanks, add LFO as an option. +* Hide_redundant_parts.cfg: Some parts are no longer needed, because the function is filled by another tank that can now switch resources. Remove these, to reduce parts tab clutter in the editor. + +Note that the "removed" parts from the third config file aren't _actually_ removed, just hidden. Thus, any existing ships you've already designed or launched with them will be fine. + +If you don't like what any of the above files do (e.g. "Oh noes, I don't want to get rid of the 'redundant' parts" or whatever), you can just delete any or all of them. + + +### How to tinker with your own config + +SimpleFuelSwitch is fairly simple to configure, by design. There are two new PartModules to deal with: + +* ModuleSimpleFuelSwitch +* ModuleSwitchableResources + +For a part to use these modules, it should be set up as follows: + +1. If the part has any "built-in" resources that you want to be switchable, _remove them_. (They'll be replaced by these new modules.) +2. Add _one_ ModuleSimpleFuelSwitch. (Don't add multiple ones.) +3. Add one ModuleSwitchableResources for each resource option you want to have. Generally you'll always have at least two of these (otherwise there's nothing to "switch"). + +Example: You want to modify a monoprop tank to be able to choose between monoprop and LFO. You'd use ModuleManager to patch it as follows: + +1. Delete the monoprop from the part (since these modules will take over). +2. Add a ModuleSimpleFuelSwitch. +3. Add one ModuleSwitchableResources for the monoprop option, and another ModuleSwitchableResources for the LFO option. + +Each ModuleSwitchableResources can specify the following: + +* _resourcesId_: *Required.* A unique ID field that distinguishes this ModuleSwitchableResources from all the others on this part. Never displayed to a user. +* _displayName_: How you want it to show up in the UI (e.g. "LFO"). Optional. If you don't specify, will be auto-generated from the resource names. +* _selectorFieldName_: How you want the button in the UI to be labeled, e.g. "Fuel Type". Optional; if unspecified, defaults to "Resource". +* _isDefault_: Whether you want _this_ set of resources to be the one that's initially picked by default for newly placed parts. +* Resources. + +The "resourcesId" field can have any value you want (ideally would be something human-readable, to facilitate debugging). It needs to meet two requirements: + +* Unique within the part: don't add two ModuleSwitchableResources that have the same resourceId as each other. +* Permanently invariant: once you've used it to design and launch ships, you can never change it after that, because doing so would break any existing ships that used the old ID. + +The resources for the ModuleSwitchableResources are specified in a set of RESOURCE sections, same as resources for a regular part. + + +### Using variants + +SimpleFuelSwitch also supports the ability to set up config that ties specific resource selections to _variants_, i.e. picking different variants will select different resource types. + +The default configs that are installed with this mod don't happen to use the feature. If you'd like to see how it works, though, please see the "examples" folder on the mod's github repository for some ideas. + +Executive summary is that all you have to do is add a "linkedVariant" field to each of your ModuleSwitchableResources, specifying which variant (or variants) correspond to that resource selection. diff --git a/files/configs/SimpleFuelSwitch.cfg b/files/configs/SimpleFuelSwitch.cfg index 2e40c30..16d239a 100644 --- a/files/configs/SimpleFuelSwitch.cfg +++ b/files/configs/SimpleFuelSwitch.cfg @@ -1,49 +1,49 @@ -SimpleFuelSwitch -{ - // Determines how resources are displayed in the "info panel" on the right - // side of the popup window in the editor. - // - // Each line is a key/value pair, where the key is the resourcesId to which - // the line applies, and the value is a format string. (The reserved key - // "default" specifies the format to use for all resourcesId that don't - // specify a format otherwise. - // - // Format strings are as follows: - // %u : "Units". Displays the number of units of the resource. - // %m : "Mass". Displays the mass of the resource, in tons, along with a unit specifier (e.g. "4.0 t") - // %q : "Quantity". Evaluates to "%u if the resource is massless, %m otherwise". - // - // Anything other than the above special tags will be interpreted as a literal character. - // - // For example, if you wanted to display resources for the resourcesId liquid_fuel_oxidizer - // so that it would show units followed by mass, e.g. "Liquid Fuel: 180 (0.9 t)", you could do this: - // liquid_fuel_oxidizer = %u (%m) - // - InfoFormat - { - default = %q - } - - // Similar to InfoFormat, but this applies to the summarized "primary info" - // that gets displayed on one line in the "main panel" at the center of the - // part's popup window. Unlike InfoFormat, which specifies information per - // *resource*, PrimaryInfoFormat specifies information per *selectable option* - // (which means it covers *all* the resources for that option). - // - // Format strings are as follows: - // %u : "Total units". Displays the sum of units of all resources. - // %u1, %u2, etc. : Displays the units of *one* resource (first, second, etc.) - // %m : "Total mass". Displays the sum of mass of all resources. - // %m1, %m2, etc. : Displays the mass of *one* resource (first, second, etc.) - // %q : "Total quantity". Evaluates to "%u if ALL resources are massless, %m otherwise". - // %q1, %q2, etc. : Like %q, but for *one* resource (first, second, etc.) - // - // For example, if you wanted the LFO option to display LF units, oxidizer units, - // and total mass, e.g. "Fuel Type LFO: 180/220 (2.0 t)", you could do this: - // liquid_fuel_oxidizer = %u1/%u2 (%m) - // - PrimaryInfoFormat - { - default = %q - } -} +SimpleFuelSwitch +{ + // Determines how resources are displayed in the "info panel" on the right + // side of the popup window in the editor. + // + // Each line is a key/value pair, where the key is the resourcesId to which + // the line applies, and the value is a format string. (The reserved key + // "default" specifies the format to use for all resourcesId that don't + // specify a format otherwise. + // + // Format strings are as follows: + // %u : "Units". Displays the number of units of the resource. + // %m : "Mass". Displays the mass of the resource, in tons, along with a unit specifier (e.g. "4.0 t") + // %q : "Quantity". Evaluates to "%u if the resource is massless, %m otherwise". + // + // Anything other than the above special tags will be interpreted as a literal character. + // + // For example, if you wanted to display resources for the resourcesId liquid_fuel_oxidizer + // so that it would show units followed by mass, e.g. "Liquid Fuel: 180 (0.9 t)", you could do this: + // liquid_fuel_oxidizer = %u (%m) + // + InfoFormat + { + default = %q + } + + // Similar to InfoFormat, but this applies to the summarized "primary info" + // that gets displayed on one line in the "main panel" at the center of the + // part's popup window. Unlike InfoFormat, which specifies information per + // *resource*, PrimaryInfoFormat specifies information per *selectable option* + // (which means it covers *all* the resources for that option). + // + // Format strings are as follows: + // %u : "Total units". Displays the sum of units of all resources. + // %u1, %u2, etc. : Displays the units of *one* resource (first, second, etc.) + // %m : "Total mass". Displays the sum of mass of all resources. + // %m1, %m2, etc. : Displays the mass of *one* resource (first, second, etc.) + // %q : "Total quantity". Evaluates to "%u if ALL resources are massless, %m otherwise". + // %q1, %q2, etc. : Like %q, but for *one* resource (first, second, etc.) + // + // For example, if you wanted the LFO option to display LF units, oxidizer units, + // and total mass, e.g. "Fuel Type LFO: 180/220 (2.0 t)", you could do this: + // liquid_fuel_oxidizer = %u1/%u2 (%m) + // + PrimaryInfoFormat + { + default = %q + } +} diff --git a/files/localization/en-us.cfg b/files/localization/en-us.cfg index b5b0527..8d9f762 100644 --- a/files/localization/en-us.cfg +++ b/files/localization/en-us.cfg @@ -1,38 +1,40 @@ -Localization -{ - en-us - { - // Labels displayed in the PAW showing what you can choose from. - #SimpleFuelSwitch_resourceLabel = Resource - #SimpleFuelSwitch_fuelTypeLabel = Fuel Type - - // Short display names for various resource combinations - #SimpleFuelSwitch_LiquidFuelAndOxidizer = LFO - #SimpleFuelSwitch_LiquidFuel = LF - - // Formats "primary info" display in the part info panel in the editor. - // [0] is the label (e.g. fuelTypeLabel above). - // [1] is the display name of the fuel option (e.g. "LFO" or whatever) - // [2] is the quantity of resource involved. - #SimpleFuelSwitch_primaryInfoFormat = [0] [1]: [2] - - // Formats the title of each of the option panes in the part info panel. - // [0] is the label (e.g. fuelTypeLabel above). - // [1] is the display name of the resource combination. - #SimpleFuelSwitch_titleFormat = [0]: [1] - - // Same as titleFormat, except this one's applied to the default selection. - #SimpleFuelSwitch_titleFormatDefault = [0]: [1] (Default) - - // Formats "detailed info" for one resource in the info panel at right. - // [0] is the display name of the resource (e.g. "Liquid Fuel") - // [1] is the quantity (e.g. "0.3 t") - #SimpleFuelSwitch_detailedInfoFormat = [0]: [1] - - // Formats a number in tons to a displayable version, with units. - #SimpleFuelSwitch_massTonsFormat = [0:0.0##] t - - // Display name to use for a selection that has no resources in it. - #SimpleFuelSwitch_noResources = No Resources - } -} +Localization +{ + en-us + { + // Labels displayed in the PAW showing what you can choose from. + #SimpleFuelSwitch_fuelTypeLabel = Fuel Type + #SimpleFuelSwitch_supplyLabel = Supply Type + #SimpleFuelSwitch_resourceLabel = Resource Type + + // Short display names for various resource combinations + #SimpleFuelSwitch_LiquidFuelAndOxidizer = LF+Ox + #SimpleFuelSwitch_LiquidFuel = LF + #SimpleFuelSwitch_Oxidizer = Ox + + // Formats "primary info" display in the part info panel in the editor. + // [0] is the label (e.g. fuelTypeLabel above). + // [1] is the display name of the fuel option (e.g. "LFO" or whatever) + // [2] is the quantity of resource involved. + #SimpleFuelSwitch_primaryInfoFormat = [0] [1]: [2] + + // Formats the title of each of the option panes in the part info panel. + // [0] is the label (e.g. fuelTypeLabel above). + // [1] is the display name of the resource combination. + #SimpleFuelSwitch_titleFormat = [0]: [1] + + // Same as titleFormat, except this one's applied to the default selection. + #SimpleFuelSwitch_titleFormatDefault = [0]: [1] (Default) + + // Formats "detailed info" for one resource in the info panel at right. + // [0] is the display name of the resource (e.g. "Liquid Fuel") + // [1] is the quantity (e.g. "0.3 t") + #SimpleFuelSwitch_detailedInfoFormat = [0]: [1] + + // Formats a number in tons to a displayable version, with units. + #SimpleFuelSwitch_massTonsFormat = [0:0.0##] t + + // Display name to use for a selection that has no resources in it. + #SimpleFuelSwitch_noResources = No Resources + } +} diff --git a/files/patches/TACLS/Container_0.cfg b/files/patches/TACLS/Container_0.cfg index 454b457..8387ed7 100644 --- a/files/patches/TACLS/Container_0.cfg +++ b/files/patches/TACLS/Container_0.cfg @@ -1,146 +1,192 @@ -// Condense the various 0.625m TACLS supply containers into a single part -// that has switchable resources via variants. - -@PART[TacLifeSupportContainerSmall]:AFTER[ThunderAerospace] -{ - MODULE - { - name = ModulePartVariants - baseVariant = LifeSupport - VARIANT - { - name = LifeSupport - displayName = Supplies - primaryColor = #39826b - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/Texture - } - } - VARIANT - { - name = Food - displayName = #autoLOC_TACLS_00016 // Food - primaryColor = #b29368 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/FoodTexture - } - } - VARIANT - { - name = Water - displayName = #autoLOC_TACLS_00017 // Water - primaryColor = #316178 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/WaterTexture - } - } - VARIANT - { - name = Oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - primaryColor = #94aebd - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/OxygenTexture - } - } - } - - // Need this to make the resources switchable - MODULE - { - name = ModuleSimpleFuelSwitch - } - - // Now set up the switchable resource options for the part. - MODULE - { - name = ModuleSwitchableResources - resourcesId = supplies - displayName = Supplies - linkedVariant = LifeSupport - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$/RESOURCE[Food]/amount$ - maxAmount = #$/RESOURCE[Food]/maxAmount$ - } - RESOURCE - { - name = Water - amount = #$/RESOURCE[Water]/amount$ - maxAmount = #$/RESOURCE[Water]/maxAmount$ - } - RESOURCE - { - name = Oxygen - amount = #$/RESOURCE[Oxygen]/amount$ - maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = food - displayName = #autoLOC_TACLS_00016 // Food - linkedVariant = Food - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$@PART[TacFoodContainerSmall]/RESOURCE[Food]/amount$ - maxAmount = #$@PART[TacFoodContainerSmall]/RESOURCE[Food]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = water - displayName = #autoLOC_TACLS_00017 // Water - linkedVariant = Water - selectorFieldName = Supply Type - RESOURCE - { - name = Water - amount = #$@PART[TacWaterContainerSmall]/RESOURCE[Water]/amount$ - maxAmount = #$@PART[TacWaterContainerSmall]/RESOURCE[Water]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - linkedVariant = Oxygen - selectorFieldName = Supply Type - RESOURCE - { - name = Oxygen - amount = #$@PART[TacOxygenContainerSmall]/RESOURCE[Oxygen]/amount$ - maxAmount = #$@PART[TacOxygenContainerSmall]/RESOURCE[Oxygen]/maxAmount$ - } - } - - -RESOURCE[Food] {} - -RESOURCE[Water] {} - -RESOURCE[Oxygen] {} -} - -// Hide the original un-"condensed" parts, since they're no longer needed. -@PART[TacFoodContainerSmall|TacWaterContainerSmall|TacOxygenContainerSmall]:AFTER[ThunderAerospace] -{ - %TechHidden = True - @category = none - @tags ^= :\s*cck-lifesupport:: -} +// Condense the various 0.625m TACLS supply containers into a single part +// that has switchable resources via variants. + +@PART[TacLifeSupportContainerSmall]:HAS[!MODULE[ModuleSimpleFuelSwitch]]:AFTER[ThunderAerospace] +{ + MODULE + { + name = ModulePartVariants + baseVariant = LifeSupport + VARIANT + { + name = LifeSupport + displayName = Supplies + primaryColor = #39826b + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/Texture + } + } + VARIANT + { + name = Food + displayName = #autoLOC_TACLS_00016 // Food + primaryColor = #b29368 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/FoodTexture + } + } + VARIANT + { + name = Water + displayName = #autoLOC_TACLS_00017 // Water + primaryColor = #316178 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/WaterTexture + } + } + VARIANT + { + name = Oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + primaryColor = #94aebd + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/OxygenTexture + } + } + VARIANT + { + name = Waste + displayName = #autoLOC_TACLS_00020 // Waste + primaryColor = #1d1d1d + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/WasteTexture + } + } + } + + // Need this to make the resources switchable + MODULE + { + name = ModuleSimpleFuelSwitch + } + + // Now set up the switchable resource options for the part. + MODULE + { + name = ModuleSwitchableResources + resourcesId = supplies + displayName = Supplies + linkedVariant = LifeSupport + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$/RESOURCE[Food]/amount$ + maxAmount = #$/RESOURCE[Food]/maxAmount$ + } + RESOURCE + { + name = Water + amount = #$/RESOURCE[Water]/amount$ + maxAmount = #$/RESOURCE[Water]/maxAmount$ + } + RESOURCE + { + name = Oxygen + amount = #$/RESOURCE[Oxygen]/amount$ + maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = food + displayName = #autoLOC_TACLS_00016 // Food + linkedVariant = Food + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$@PART[TacFoodContainerSmall]/RESOURCE[Food]/amount$ + maxAmount = #$@PART[TacFoodContainerSmall]/RESOURCE[Food]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = water + displayName = #autoLOC_TACLS_00017 // Water + linkedVariant = Water + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Water + amount = #$@PART[TacWaterContainerSmall]/RESOURCE[Water]/amount$ + maxAmount = #$@PART[TacWaterContainerSmall]/RESOURCE[Water]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + linkedVariant = Oxygen + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Oxygen + amount = #$@PART[TacOxygenContainerSmall]/RESOURCE[Oxygen]/amount$ + maxAmount = #$@PART[TacOxygenContainerSmall]/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = waste + displayName = #autoLOC_TACLS_00020 // Waste + linkedVariant = Waste + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = CarbonDioxide + amount = #$@PART[TacWasteContainerSmall]/RESOURCE[CarbonDioxide]/amount$ + maxAmount = #$@PART[TacWasteContainerSmall]/RESOURCE[CarbonDioxide]/maxAmount$ + } + RESOURCE + { + name = WasteWater + amount = #$@PART[TacWasteContainerSmall]/RESOURCE[WasteWater]/amount$ + maxAmount = #$@PART[TacWasteContainerSmall]/RESOURCE[WasteWater]/maxAmount$ + } + RESOURCE + { + name = Waste + amount = #$@PART[TacWasteContainerSmall]/RESOURCE[Waste]/amount$ + maxAmount = #$@PART[TacWasteContainerSmall]/RESOURCE[Waste]/maxAmount$ + } + } + + -RESOURCE[Food] {} + -RESOURCE[Water] {} + -RESOURCE[Oxygen] {} +} + +// Hide the original un-"condensed" parts, since they're no longer needed. +@PART[TacFoodContainerSmall|TacWaterContainerSmall|TacOxygenContainerSmall]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +} + +// Hide the original waste parts, since they're no longer needed. +@PART[TacWasteContainerSmall]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +} diff --git a/files/patches/TACLS/Container_1.cfg b/files/patches/TACLS/Container_1.cfg index 26de117..4f1603d 100644 --- a/files/patches/TACLS/Container_1.cfg +++ b/files/patches/TACLS/Container_1.cfg @@ -1,147 +1,193 @@ -// Condense the various 1.25m TACLS supply containers into a single part -// that has switchable resources via variants. - -@PART[TacLifeSupportContainer]:AFTER[ThunderAerospace] -{ - // First, set up all the variants - MODULE - { - name = ModulePartVariants - baseVariant = LifeSupport - VARIANT - { - name = LifeSupport - displayName = Supplies - primaryColor = #39826b - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/Texture - } - } - VARIANT - { - name = Food - displayName = #autoLOC_TACLS_00016 // Food - primaryColor = #b29368 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/FoodTexture - } - } - VARIANT - { - name = Water - displayName = #autoLOC_TACLS_00017 // Water - primaryColor = #316178 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/WaterTexture - } - } - VARIANT - { - name = Oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - primaryColor = #94aebd - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/OxygenTexture - } - } - } - - // Need this to make the resources switchable - MODULE - { - name = ModuleSimpleFuelSwitch - } - - // Now set up the switchable resource options for the part. - MODULE - { - name = ModuleSwitchableResources - resourcesId = supplies - displayName = Supplies - linkedVariant = LifeSupport - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$/RESOURCE[Food]/amount$ - maxAmount = #$/RESOURCE[Food]/maxAmount$ - } - RESOURCE - { - name = Water - amount = #$/RESOURCE[Water]/amount$ - maxAmount = #$/RESOURCE[Water]/maxAmount$ - } - RESOURCE - { - name = Oxygen - amount = #$/RESOURCE[Oxygen]/amount$ - maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = food - displayName = #autoLOC_TACLS_00016 // Food - linkedVariant = Food - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$@PART[TacFoodContainer]/RESOURCE[Food]/amount$ - maxAmount = #$@PART[TacFoodContainer]/RESOURCE[Food]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = water - displayName = #autoLOC_TACLS_00017 // Water - linkedVariant = Water - selectorFieldName = Supply Type - RESOURCE - { - name = Water - amount = #$@PART[TacWaterContainer]/RESOURCE[Water]/amount$ - maxAmount = #$@PART[TacWaterContainer]/RESOURCE[Water]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - linkedVariant = Oxygen - selectorFieldName = Supply Type - RESOURCE - { - name = Oxygen - amount = #$@PART[TacOxygenContainer]/RESOURCE[Oxygen]/amount$ - maxAmount = #$@PART[TacOxygenContainer]/RESOURCE[Oxygen]/maxAmount$ - } - } - - -RESOURCE[Food] {} - -RESOURCE[Water] {} - -RESOURCE[Oxygen] {} -} - -// Hide the original un-"condensed" parts, since they're no longer needed. -@PART[TacFoodContainer|TacWaterContainer|TacOxygenContainer]:AFTER[ThunderAerospace] -{ - %TechHidden = True - @category = none - @tags ^= :\s*cck-lifesupport:: -} +// Condense the various 1.25m TACLS supply containers into a single part +// that has switchable resources via variants. + +@PART[TacLifeSupportContainer]:HAS[!MODULE[ModuleSimpleFuelSwitch]]:AFTER[ThunderAerospace] +{ + // First, set up all the variants + MODULE + { + name = ModulePartVariants + baseVariant = LifeSupport + VARIANT + { + name = LifeSupport + displayName = Supplies + primaryColor = #39826b + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/Texture + } + } + VARIANT + { + name = Food + displayName = #autoLOC_TACLS_00016 // Food + primaryColor = #b29368 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/FoodTexture + } + } + VARIANT + { + name = Water + displayName = #autoLOC_TACLS_00017 // Water + primaryColor = #316178 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/WaterTexture + } + } + VARIANT + { + name = Oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + primaryColor = #94aebd + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/OxygenTexture + } + } + VARIANT + { + name = Waste + displayName = #autoLOC_TACLS_00020 // Waste + primaryColor = #1d1d1d + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/WasteTexture + } + } + } + + // Need this to make the resources switchable + MODULE + { + name = ModuleSimpleFuelSwitch + } + + // Now set up the switchable resource options for the part. + MODULE + { + name = ModuleSwitchableResources + resourcesId = supplies + displayName = Supplies + linkedVariant = LifeSupport + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$/RESOURCE[Food]/amount$ + maxAmount = #$/RESOURCE[Food]/maxAmount$ + } + RESOURCE + { + name = Water + amount = #$/RESOURCE[Water]/amount$ + maxAmount = #$/RESOURCE[Water]/maxAmount$ + } + RESOURCE + { + name = Oxygen + amount = #$/RESOURCE[Oxygen]/amount$ + maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = food + displayName = #autoLOC_TACLS_00016 // Food + linkedVariant = Food + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$@PART[TacFoodContainer]/RESOURCE[Food]/amount$ + maxAmount = #$@PART[TacFoodContainer]/RESOURCE[Food]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = water + displayName = #autoLOC_TACLS_00017 // Water + linkedVariant = Water + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Water + amount = #$@PART[TacWaterContainer]/RESOURCE[Water]/amount$ + maxAmount = #$@PART[TacWaterContainer]/RESOURCE[Water]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + linkedVariant = Oxygen + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Oxygen + amount = #$@PART[TacOxygenContainer]/RESOURCE[Oxygen]/amount$ + maxAmount = #$@PART[TacOxygenContainer]/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = waste + displayName = #autoLOC_TACLS_00020 // Waste + linkedVariant = Waste + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = CarbonDioxide + amount = #$@PART[TacWasteContainer]/RESOURCE[CarbonDioxide]/amount$ + maxAmount = #$@PART[TacWasteContainer]/RESOURCE[CarbonDioxide]/maxAmount$ + } + RESOURCE + { + name = WasteWater + amount = #$@PART[TacWasteContainer]/RESOURCE[WasteWater]/amount$ + maxAmount = #$@PART[TacWasteContainer]/RESOURCE[WasteWater]/maxAmount$ + } + RESOURCE + { + name = Waste + amount = #$@PART[TacWasteContainer]/RESOURCE[Waste]/amount$ + maxAmount = #$@PART[TacWasteContainer]/RESOURCE[Waste]/maxAmount$ + } + } + + -RESOURCE[Food] {} + -RESOURCE[Water] {} + -RESOURCE[Oxygen] {} +} + +// Hide the original un-"condensed" parts, since they're no longer needed. +@PART[TacFoodContainer|TacWaterContainer|TacOxygenContainer]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +} + +// Hide the original waste parts, since they're no longer needed. +@PART[TacWasteContainer]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +} diff --git a/files/patches/TACLS/Container_2.cfg b/files/patches/TACLS/Container_2.cfg index 00c95c6..7a7ed55 100644 --- a/files/patches/TACLS/Container_2.cfg +++ b/files/patches/TACLS/Container_2.cfg @@ -1,147 +1,193 @@ -// Condense the various 2.5m TACLS supply containers into a single part -// that has switchable resources via variants. - -@PART[TacLifeSupportContainerLarge]:AFTER[ThunderAerospace] -{ - // First, set up all the variants - MODULE - { - name = ModulePartVariants - baseVariant = LifeSupport - VARIANT - { - name = LifeSupport - displayName = Supplies - primaryColor = #39826b - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/Texture - } - } - VARIANT - { - name = Food - displayName = #autoLOC_TACLS_00016 // Food - primaryColor = #b29368 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/FoodTexture - } - } - VARIANT - { - name = Water - displayName = #autoLOC_TACLS_00017 // Water - primaryColor = #316178 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/WaterTexture - } - } - VARIANT - { - name = Oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - primaryColor = #94aebd - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/OxygenTexture - } - } - } - - // Need this to make the resources switchable - MODULE - { - name = ModuleSimpleFuelSwitch - } - - // Now set up the switchable resource options for the part. - MODULE - { - name = ModuleSwitchableResources - resourcesId = supplies - displayName = Supplies - linkedVariant = LifeSupport - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$/RESOURCE[Food]/amount$ - maxAmount = #$/RESOURCE[Food]/maxAmount$ - } - RESOURCE - { - name = Water - amount = #$/RESOURCE[Water]/amount$ - maxAmount = #$/RESOURCE[Water]/maxAmount$ - } - RESOURCE - { - name = Oxygen - amount = #$/RESOURCE[Oxygen]/amount$ - maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = food - displayName = #autoLOC_TACLS_00016 // Food - linkedVariant = Food - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$@PART[TacFoodContainerLarge]/RESOURCE[Food]/amount$ - maxAmount = #$@PART[TacFoodContainerLarge]/RESOURCE[Food]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = water - displayName = #autoLOC_TACLS_00017 // Water - linkedVariant = Water - selectorFieldName = Supply Type - RESOURCE - { - name = Water - amount = #$@PART[TacWaterContainerLarge]/RESOURCE[Water]/amount$ - maxAmount = #$@PART[TacWaterContainerLarge]/RESOURCE[Water]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - linkedVariant = Oxygen - selectorFieldName = Supply Type - RESOURCE - { - name = Oxygen - amount = #$@PART[TacOxygenContainerLarge]/RESOURCE[Oxygen]/amount$ - maxAmount = #$@PART[TacOxygenContainerLarge]/RESOURCE[Oxygen]/maxAmount$ - } - } - - -RESOURCE[Food] {} - -RESOURCE[Water] {} - -RESOURCE[Oxygen] {} -} - -// Hide the original un-"condensed" parts, since they're no longer needed. -@PART[TacFoodContainerLarge|TacWaterContainerLarge|TacOxygenContainerLarge]:AFTER[ThunderAerospace] -{ - %TechHidden = True - @category = none - @tags ^= :\s*cck-lifesupport:: -} +// Condense the various 2.5m TACLS supply containers into a single part +// that has switchable resources via variants. + +@PART[TacLifeSupportContainerLarge]:HAS[!MODULE[ModuleSimpleFuelSwitch]]:AFTER[ThunderAerospace] +{ + // First, set up all the variants + MODULE + { + name = ModulePartVariants + baseVariant = LifeSupport + VARIANT + { + name = LifeSupport + displayName = Supplies + primaryColor = #39826b + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/Texture + } + } + VARIANT + { + name = Food + displayName = #autoLOC_TACLS_00016 // Food + primaryColor = #b29368 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/FoodTexture + } + } + VARIANT + { + name = Water + displayName = #autoLOC_TACLS_00017 // Water + primaryColor = #316178 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/WaterTexture + } + } + VARIANT + { + name = Oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + primaryColor = #94aebd + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/OxygenTexture + } + } + VARIANT + { + name = Waste + displayName = #autoLOC_TACLS_00020 // Waste + primaryColor = #1d1d1d + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/WasteTexture + } + } + } + + // Need this to make the resources switchable + MODULE + { + name = ModuleSimpleFuelSwitch + } + + // Now set up the switchable resource options for the part. + MODULE + { + name = ModuleSwitchableResources + resourcesId = supplies + displayName = Supplies + linkedVariant = LifeSupport + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$/RESOURCE[Food]/amount$ + maxAmount = #$/RESOURCE[Food]/maxAmount$ + } + RESOURCE + { + name = Water + amount = #$/RESOURCE[Water]/amount$ + maxAmount = #$/RESOURCE[Water]/maxAmount$ + } + RESOURCE + { + name = Oxygen + amount = #$/RESOURCE[Oxygen]/amount$ + maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = food + displayName = #autoLOC_TACLS_00016 // Food + linkedVariant = Food + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$@PART[TacFoodContainerLarge]/RESOURCE[Food]/amount$ + maxAmount = #$@PART[TacFoodContainerLarge]/RESOURCE[Food]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = water + displayName = #autoLOC_TACLS_00017 // Water + linkedVariant = Water + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Water + amount = #$@PART[TacWaterContainerLarge]/RESOURCE[Water]/amount$ + maxAmount = #$@PART[TacWaterContainerLarge]/RESOURCE[Water]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + linkedVariant = Oxygen + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Oxygen + amount = #$@PART[TacOxygenContainerLarge]/RESOURCE[Oxygen]/amount$ + maxAmount = #$@PART[TacOxygenContainerLarge]/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = waste + displayName = #autoLOC_TACLS_00020 // Waste + linkedVariant = Waste + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = CarbonDioxide + amount = #$@PART[TacWasteContainerLarge]/RESOURCE[CarbonDioxide]/amount$ + maxAmount = #$@PART[TacWasteContainerLarge]/RESOURCE[CarbonDioxide]/maxAmount$ + } + RESOURCE + { + name = WasteWater + amount = #$@PART[TacWasteContainerLarge]/RESOURCE[WasteWater]/amount$ + maxAmount = #$@PART[TacWasteContainerLarge]/RESOURCE[WasteWater]/maxAmount$ + } + RESOURCE + { + name = Waste + amount = #$@PART[TacWasteContainerLarge]/RESOURCE[Waste]/amount$ + maxAmount = #$@PART[TacWasteContainerLarge]/RESOURCE[Waste]/maxAmount$ + } + } + + -RESOURCE[Food] {} + -RESOURCE[Water] {} + -RESOURCE[Oxygen] {} +} + +// Hide the original un-"condensed" parts, since they're no longer needed. +@PART[TacFoodContainerLarge|TacWaterContainerLarge|TacOxygenContainerLarge]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +} + +// Hide the original waste parts, since they're no longer needed. +@PART[TacWasteContainerLarge]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +} diff --git a/files/patches/TACLS/Container_3.cfg b/files/patches/TACLS/Container_3.cfg index 69348c7..e019dcb 100644 --- a/files/patches/TACLS/Container_3.cfg +++ b/files/patches/TACLS/Container_3.cfg @@ -1,147 +1,193 @@ -// Condense the various 3.75m TACLS supply containers into a single part -// that has switchable resources via variants. - -@PART[TacLifeSupportContainerLarge375]:AFTER[ThunderAerospace] -{ - // First, set up all the variants - MODULE - { - name = ModulePartVariants - baseVariant = LifeSupport - VARIANT - { - name = LifeSupport - displayName = Supplies - primaryColor = #39826b - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/Texture - } - } - VARIANT - { - name = Food - displayName = #autoLOC_TACLS_00016 // Food - primaryColor = #b29368 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/FoodTexture - } - } - VARIANT - { - name = Water - displayName = #autoLOC_TACLS_00017 // Water - primaryColor = #316178 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/WaterTexture - } - } - VARIANT - { - name = Oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - primaryColor = #94aebd - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportContainers/OxygenTexture - } - } - } - - // Need this to make the resources switchable - MODULE - { - name = ModuleSimpleFuelSwitch - } - - // Now set up the switchable resource options for the part. - MODULE - { - name = ModuleSwitchableResources - resourcesId = supplies - displayName = Supplies - linkedVariant = LifeSupport - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$/RESOURCE[Food]/amount$ - maxAmount = #$/RESOURCE[Food]/maxAmount$ - } - RESOURCE - { - name = Water - amount = #$/RESOURCE[Water]/amount$ - maxAmount = #$/RESOURCE[Water]/maxAmount$ - } - RESOURCE - { - name = Oxygen - amount = #$/RESOURCE[Oxygen]/amount$ - maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = food - displayName = #autoLOC_TACLS_00016 // Food - linkedVariant = Food - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$@PART[TacFoodContainerLarge375]/RESOURCE[Food]/amount$ - maxAmount = #$@PART[TacFoodContainerLarge375]/RESOURCE[Food]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = water - displayName = #autoLOC_TACLS_00017 // Water - linkedVariant = Water - selectorFieldName = Supply Type - RESOURCE - { - name = Water - amount = #$@PART[TacWaterContainerLarge375]/RESOURCE[Water]/amount$ - maxAmount = #$@PART[TacWaterContainerLarge375]/RESOURCE[Water]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - linkedVariant = Oxygen - selectorFieldName = Supply Type - RESOURCE - { - name = Oxygen - amount = #$@PART[TacOxygenContainerLarge375]/RESOURCE[Oxygen]/amount$ - maxAmount = #$@PART[TacOxygenContainerLarge375]/RESOURCE[Oxygen]/maxAmount$ - } - } - - -RESOURCE[Food] {} - -RESOURCE[Water] {} - -RESOURCE[Oxygen] {} -} - -// Hide the original un-"condensed" parts, since they're no longer needed. -@PART[TacFoodContainerLarge375|TacWaterContainerLarge375|TacOxygenContainerLarge375]:AFTER[ThunderAerospace] -{ - %TechHidden = True - @category = none - @tags ^= :\s*cck-lifesupport:: -} +// Condense the various 3.75m TACLS supply containers into a single part +// that has switchable resources via variants. + +@PART[TacLifeSupportContainerLarge375]:HAS[!MODULE[ModuleSimpleFuelSwitch]]:AFTER[ThunderAerospace] +{ + // First, set up all the variants + MODULE + { + name = ModulePartVariants + baseVariant = LifeSupport + VARIANT + { + name = LifeSupport + displayName = Supplies + primaryColor = #39826b + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/Texture + } + } + VARIANT + { + name = Food + displayName = #autoLOC_TACLS_00016 // Food + primaryColor = #b29368 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/FoodTexture + } + } + VARIANT + { + name = Water + displayName = #autoLOC_TACLS_00017 // Water + primaryColor = #316178 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/WaterTexture + } + } + VARIANT + { + name = Oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + primaryColor = #94aebd + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/OxygenTexture + } + } + VARIANT + { + name = Waste + displayName = #autoLOC_TACLS_00020 // Waste + primaryColor = #1d1d1d + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportContainers/WasteTexture + } + } + } + + // Need this to make the resources switchable + MODULE + { + name = ModuleSimpleFuelSwitch + } + + // Now set up the switchable resource options for the part. + MODULE + { + name = ModuleSwitchableResources + resourcesId = supplies + displayName = Supplies + linkedVariant = LifeSupport + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$/RESOURCE[Food]/amount$ + maxAmount = #$/RESOURCE[Food]/maxAmount$ + } + RESOURCE + { + name = Water + amount = #$/RESOURCE[Water]/amount$ + maxAmount = #$/RESOURCE[Water]/maxAmount$ + } + RESOURCE + { + name = Oxygen + amount = #$/RESOURCE[Oxygen]/amount$ + maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = food + displayName = #autoLOC_TACLS_00016 // Food + linkedVariant = Food + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$@PART[TacFoodContainerLarge375]/RESOURCE[Food]/amount$ + maxAmount = #$@PART[TacFoodContainerLarge375]/RESOURCE[Food]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = water + displayName = #autoLOC_TACLS_00017 // Water + linkedVariant = Water + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Water + amount = #$@PART[TacWaterContainerLarge375]/RESOURCE[Water]/amount$ + maxAmount = #$@PART[TacWaterContainerLarge375]/RESOURCE[Water]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + linkedVariant = Oxygen + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Oxygen + amount = #$@PART[TacOxygenContainerLarge375]/RESOURCE[Oxygen]/amount$ + maxAmount = #$@PART[TacOxygenContainerLarge375]/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = waste + displayName = #autoLOC_TACLS_00020 // Waste + linkedVariant = Waste + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = CarbonDioxide + amount = #$@PART[TacWasteContainerLarge375]/RESOURCE[CarbonDioxide]/amount$ + maxAmount = #$@PART[TacWasteContainerLarge375]/RESOURCE[CarbonDioxide]/maxAmount$ + } + RESOURCE + { + name = WasteWater + amount = #$@PART[TacWasteContainerLarge375]/RESOURCE[WasteWater]/amount$ + maxAmount = #$@PART[TacWasteContainerLarge375]/RESOURCE[WasteWater]/maxAmount$ + } + RESOURCE + { + name = Waste + amount = #$@PART[TacWasteContainerLarge375]/RESOURCE[Waste]/amount$ + maxAmount = #$@PART[TacWasteContainerLarge375]/RESOURCE[Waste]/maxAmount$ + } + } + + -RESOURCE[Food] {} + -RESOURCE[Water] {} + -RESOURCE[Oxygen] {} +} + +// Hide the original un-"condensed" parts, since they're no longer needed. +@PART[TacFoodContainerLarge375|TacWaterContainerLarge375|TacOxygenContainerLarge375]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +} + +// Hide the original waste parts, since they're no longer needed. +@PART[TacWasteContainerLarge375]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +} diff --git a/files/patches/TACLS/HexCan_large.cfg b/files/patches/TACLS/HexCan_large.cfg index 8862ece..a3d1bb3 100644 --- a/files/patches/TACLS/HexCan_large.cfg +++ b/files/patches/TACLS/HexCan_large.cfg @@ -1,146 +1,192 @@ -// Condense the various "large" TACLS hex cans into a single part -// that has switchable resources via variants. - -@PART[HexCanLifeSupportLarge]:AFTER[ThunderAerospace] -{ - MODULE - { - name = ModulePartVariants - baseVariant = LifeSupport - VARIANT - { - name = LifeSupport - displayName = Supplies - primaryColor = #39826b - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanLifeSupport/Texture - } - } - VARIANT - { - name = Food - displayName = #autoLOC_TACLS_00016 // Food - primaryColor = #b29368 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanFood/Texture - } - } - VARIANT - { - name = Water - displayName = #autoLOC_TACLS_00017 // Water - primaryColor = #316178 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanDrinkingWater/Texture - } - } - VARIANT - { - name = Oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - primaryColor = #94aebd - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanBreathingOxygen/Texture - } - } - } - - // Need this to make the resources switchable - MODULE - { - name = ModuleSimpleFuelSwitch - } - - // Now set up the switchable resource options for the part. - MODULE - { - name = ModuleSwitchableResources - resourcesId = supplies - displayName = Supplies - linkedVariant = LifeSupport - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$/RESOURCE[Food]/amount$ - maxAmount = #$/RESOURCE[Food]/maxAmount$ - } - RESOURCE - { - name = Water - amount = #$/RESOURCE[Water]/amount$ - maxAmount = #$/RESOURCE[Water]/maxAmount$ - } - RESOURCE - { - name = Oxygen - amount = #$/RESOURCE[Oxygen]/amount$ - maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = food - displayName = #autoLOC_TACLS_00016 // Food - linkedVariant = Food - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$@PART[HexCanFoodLarge]/RESOURCE[Food]/amount$ - maxAmount = #$@PART[HexCanFoodLarge]/RESOURCE[Food]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = water - displayName = #autoLOC_TACLS_00017 // Water - linkedVariant = Water - selectorFieldName = Supply Type - RESOURCE - { - name = Water - amount = #$@PART[HexCanDrinkingWaterLarge]/RESOURCE[Water]/amount$ - maxAmount = #$@PART[HexCanDrinkingWaterLarge]/RESOURCE[Water]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - linkedVariant = Oxygen - selectorFieldName = Supply Type - RESOURCE - { - name = Oxygen - amount = #$@PART[HexCanOxygenLarge]/RESOURCE[Oxygen]/amount$ - maxAmount = #$@PART[HexCanOxygenLarge]/RESOURCE[Oxygen]/maxAmount$ - } - } - - -RESOURCE[Food] {} - -RESOURCE[Water] {} - -RESOURCE[Oxygen] {} -} - -// Hide the original un-"condensed" parts, since they're no longer needed. -@PART[HexCanFoodLarge|HexCanDrinkingWaterLarge|HexCanOxygenLarge]:AFTER[ThunderAerospace] -{ - %TechHidden = True - @category = none - @tags ^= :\s*cck-lifesupport:: -} +// Condense the various "large" TACLS hex cans into a single part +// that has switchable resources via variants. + +@PART[HexCanLifeSupportLarge]:HAS[!MODULE[ModuleSimpleFuelSwitch]]:AFTER[ThunderAerospace] +{ + MODULE + { + name = ModulePartVariants + baseVariant = LifeSupport + VARIANT + { + name = LifeSupport + displayName = Supplies + primaryColor = #39826b + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanLifeSupport/Texture + } + } + VARIANT + { + name = Food + displayName = #autoLOC_TACLS_00016 // Food + primaryColor = #b29368 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanFood/Texture + } + } + VARIANT + { + name = Water + displayName = #autoLOC_TACLS_00017 // Water + primaryColor = #316178 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanDrinkingWater/Texture + } + } + VARIANT + { + name = Oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + primaryColor = #94aebd + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanBreathingOxygen/Texture + } + } + VARIANT + { + name = Waste + displayName = #autoLOC_TACLS_00020 // Waste + primaryColor = #1d1d1d + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanWaste/WasteTexture + } + } + } + + // Need this to make the resources switchable + MODULE + { + name = ModuleSimpleFuelSwitch + } + + // Now set up the switchable resource options for the part. + MODULE + { + name = ModuleSwitchableResources + resourcesId = supplies + displayName = Supplies + linkedVariant = LifeSupport + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$/RESOURCE[Food]/amount$ + maxAmount = #$/RESOURCE[Food]/maxAmount$ + } + RESOURCE + { + name = Water + amount = #$/RESOURCE[Water]/amount$ + maxAmount = #$/RESOURCE[Water]/maxAmount$ + } + RESOURCE + { + name = Oxygen + amount = #$/RESOURCE[Oxygen]/amount$ + maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = food + displayName = #autoLOC_TACLS_00016 // Food + linkedVariant = Food + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$@PART[HexCanFoodLarge]/RESOURCE[Food]/amount$ + maxAmount = #$@PART[HexCanFoodLarge]/RESOURCE[Food]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = water + displayName = #autoLOC_TACLS_00017 // Water + linkedVariant = Water + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Water + amount = #$@PART[HexCanDrinkingWaterLarge]/RESOURCE[Water]/amount$ + maxAmount = #$@PART[HexCanDrinkingWaterLarge]/RESOURCE[Water]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + linkedVariant = Oxygen + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Oxygen + amount = #$@PART[HexCanOxygenLarge]/RESOURCE[Oxygen]/amount$ + maxAmount = #$@PART[HexCanOxygenLarge]/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = waste + displayName = #autoLOC_TACLS_00020 // Waste + linkedVariant = Waste + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = CarbonDioxide + amount = #$@PART[HexCanLifeSupportWasteLarge]/RESOURCE[CarbonDioxide]/amount$ + maxAmount = #$@PART[HexCanLifeSupportWasteLarge]/RESOURCE[CarbonDioxide]/maxAmount$ + } + RESOURCE + { + name = WasteWater + amount = #$@PART[HexCanLifeSupportWasteLarge]/RESOURCE[WasteWater]/amount$ + maxAmount = #$@PART[HexCanLifeSupportWasteLarge]/RESOURCE[WasteWater]/maxAmount$ + } + RESOURCE + { + name = Waste + amount = #$@PART[HexCanLifeSupportWasteLarge]/RESOURCE[Waste]/amount$ + maxAmount = #$@PART[HexCanLifeSupportWasteLarge]/RESOURCE[Waste]/maxAmount$ + } + } + + -RESOURCE[Food] {} + -RESOURCE[Water] {} + -RESOURCE[Oxygen] {} +} + +// Hide the original un-"condensed" parts, since they're no longer needed. +@PART[HexCanFoodLarge|HexCanDrinkingWaterLarge|HexCanOxygenLarge]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +} + +// Hide the original waste parts, since they're no longer needed. +@PART[HexCanLifeSupportWasteLarge]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +} diff --git a/files/patches/TACLS/HexCan_medium.cfg b/files/patches/TACLS/HexCan_medium.cfg index 3731b5e..7f84490 100644 --- a/files/patches/TACLS/HexCan_medium.cfg +++ b/files/patches/TACLS/HexCan_medium.cfg @@ -1,146 +1,192 @@ -// Condense the various "medium" TACLS hex cans into a single part -// that has switchable resources via variants. - -@PART[HexCanLifeSupport]:AFTER[ThunderAerospace] -{ - MODULE - { - name = ModulePartVariants - baseVariant = LifeSupport - VARIANT - { - name = LifeSupport - displayName = Supplies - primaryColor = #39826b - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanLifeSupport/Texture - } - } - VARIANT - { - name = Food - displayName = #autoLOC_TACLS_00016 // Food - primaryColor = #b29368 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanFood/Texture - } - } - VARIANT - { - name = Water - displayName = #autoLOC_TACLS_00017 // Water - primaryColor = #316178 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanDrinkingWater/Texture - } - } - VARIANT - { - name = Oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - primaryColor = #94aebd - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanBreathingOxygen/Texture - } - } - } - - // Need this to make the resources switchable - MODULE - { - name = ModuleSimpleFuelSwitch - } - - // Now set up the switchable resource options for the part. - MODULE - { - name = ModuleSwitchableResources - resourcesId = supplies - displayName = Supplies - linkedVariant = LifeSupport - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$/RESOURCE[Food]/amount$ - maxAmount = #$/RESOURCE[Food]/maxAmount$ - } - RESOURCE - { - name = Water - amount = #$/RESOURCE[Water]/amount$ - maxAmount = #$/RESOURCE[Water]/maxAmount$ - } - RESOURCE - { - name = Oxygen - amount = #$/RESOURCE[Oxygen]/amount$ - maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = food - displayName = #autoLOC_TACLS_00016 // Food - linkedVariant = Food - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$@PART[HexCanFood]/RESOURCE[Food]/amount$ - maxAmount = #$@PART[HexCanFood]/RESOURCE[Food]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = water - displayName = #autoLOC_TACLS_00017 // Water - linkedVariant = Water - selectorFieldName = Supply Type - RESOURCE - { - name = Water - amount = #$@PART[HexCanDrinkingWater]/RESOURCE[Water]/amount$ - maxAmount = #$@PART[HexCanDrinkingWater]/RESOURCE[Water]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - linkedVariant = Oxygen - selectorFieldName = Supply Type - RESOURCE - { - name = Oxygen - amount = #$@PART[HexCanOxygen]/RESOURCE[Oxygen]/amount$ - maxAmount = #$@PART[HexCanOxygen]/RESOURCE[Oxygen]/maxAmount$ - } - } - - -RESOURCE[Food] {} - -RESOURCE[Water] {} - -RESOURCE[Oxygen] {} -} - -// Hide the original un-"condensed" parts, since they're no longer needed. -@PART[HexCanFood|HexCanDrinkingWater|HexCanOxygen]:AFTER[ThunderAerospace] -{ - %TechHidden = True - @category = none - @tags ^= :\s*cck-lifesupport:: -} +// Condense the various "medium" TACLS hex cans into a single part +// that has switchable resources via variants. + +@PART[HexCanLifeSupport]:HAS[!MODULE[ModuleSimpleFuelSwitch]]:AFTER[ThunderAerospace] +{ + MODULE + { + name = ModulePartVariants + baseVariant = LifeSupport + VARIANT + { + name = LifeSupport + displayName = Supplies + primaryColor = #39826b + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanLifeSupport/Texture + } + } + VARIANT + { + name = Food + displayName = #autoLOC_TACLS_00016 // Food + primaryColor = #b29368 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanFood/Texture + } + } + VARIANT + { + name = Water + displayName = #autoLOC_TACLS_00017 // Water + primaryColor = #316178 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanDrinkingWater/Texture + } + } + VARIANT + { + name = Oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + primaryColor = #94aebd + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanBreathingOxygen/Texture + } + } + VARIANT + { + name = Waste + displayName = #autoLOC_TACLS_00020 // Waste + primaryColor = #1d1d1d + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanWaste/WasteTexture + } + } + } + + // Need this to make the resources switchable + MODULE + { + name = ModuleSimpleFuelSwitch + } + + // Now set up the switchable resource options for the part. + MODULE + { + name = ModuleSwitchableResources + resourcesId = supplies + displayName = Supplies + linkedVariant = LifeSupport + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$/RESOURCE[Food]/amount$ + maxAmount = #$/RESOURCE[Food]/maxAmount$ + } + RESOURCE + { + name = Water + amount = #$/RESOURCE[Water]/amount$ + maxAmount = #$/RESOURCE[Water]/maxAmount$ + } + RESOURCE + { + name = Oxygen + amount = #$/RESOURCE[Oxygen]/amount$ + maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = food + displayName = #autoLOC_TACLS_00016 // Food + linkedVariant = Food + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$@PART[HexCanFood]/RESOURCE[Food]/amount$ + maxAmount = #$@PART[HexCanFood]/RESOURCE[Food]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = water + displayName = #autoLOC_TACLS_00017 // Water + linkedVariant = Water + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Water + amount = #$@PART[HexCanDrinkingWater]/RESOURCE[Water]/amount$ + maxAmount = #$@PART[HexCanDrinkingWater]/RESOURCE[Water]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + linkedVariant = Oxygen + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Oxygen + amount = #$@PART[HexCanOxygen]/RESOURCE[Oxygen]/amount$ + maxAmount = #$@PART[HexCanOxygen]/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = waste + displayName = #autoLOC_TACLS_00020 // Waste + linkedVariant = Waste + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = CarbonDioxide + amount = #$@PART[HexCanLifeSupportWaste]/RESOURCE[CarbonDioxide]/amount$ + maxAmount = #$@PART[HexCanLifeSupportWaste]/RESOURCE[CarbonDioxide]/maxAmount$ + } + RESOURCE + { + name = WasteWater + amount = #$@PART[HexCanLifeSupportWaste]/RESOURCE[WasteWater]/amount$ + maxAmount = #$@PART[HexCanLifeSupportWaste]/RESOURCE[WasteWater]/maxAmount$ + } + RESOURCE + { + name = Waste + amount = #$@PART[HexCanLifeSupportWaste]/RESOURCE[Waste]/amount$ + maxAmount = #$@PART[HexCanLifeSupportWaste]/RESOURCE[Waste]/maxAmount$ + } + } + + -RESOURCE[Food] {} + -RESOURCE[Water] {} + -RESOURCE[Oxygen] {} +} + +// Hide the original un-"condensed" parts, since they're no longer needed. +@PART[HexCanFood|HexCanDrinkingWater|HexCanOxygen]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +} + +// Hide the original waste parts, since they're no longer needed. +@PART[HexCanLifeSupportWaste]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +} diff --git a/files/patches/TACLS/HexCan_small.cfg b/files/patches/TACLS/HexCan_small.cfg index f764d56..6a3de62 100644 --- a/files/patches/TACLS/HexCan_small.cfg +++ b/files/patches/TACLS/HexCan_small.cfg @@ -1,146 +1,192 @@ -// Condense the various "small" TACLS hex cans into a single part -// that has switchable resources via variants. - -@PART[HexCanLifeSupportSmall]:AFTER[ThunderAerospace] -{ - MODULE - { - name = ModulePartVariants - baseVariant = LifeSupport - VARIANT - { - name = LifeSupport - displayName = Supplies - primaryColor = #39826b - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanLifeSupport/Texture - } - } - VARIANT - { - name = Food - displayName = #autoLOC_TACLS_00016 // Food - primaryColor = #b29368 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanFood/Texture - } - } - VARIANT - { - name = Water - displayName = #autoLOC_TACLS_00017 // Water - primaryColor = #316178 - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanDrinkingWater/Texture - } - } - VARIANT - { - name = Oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - primaryColor = #94aebd - secondaryColor = #ffffff - TEXTURE - { - mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanBreathingOxygen/Texture - } - } - } - - // Need this to make the resources switchable - MODULE - { - name = ModuleSimpleFuelSwitch - } - - // Now set up the switchable resource options for the part. - MODULE - { - name = ModuleSwitchableResources - resourcesId = supplies - displayName = Supplies - linkedVariant = LifeSupport - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$/RESOURCE[Food]/amount$ - maxAmount = #$/RESOURCE[Food]/maxAmount$ - } - RESOURCE - { - name = Water - amount = #$/RESOURCE[Water]/amount$ - maxAmount = #$/RESOURCE[Water]/maxAmount$ - } - RESOURCE - { - name = Oxygen - amount = #$/RESOURCE[Oxygen]/amount$ - maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = food - displayName = #autoLOC_TACLS_00016 // Food - linkedVariant = Food - selectorFieldName = Supply Type - RESOURCE - { - name = Food - amount = #$@PART[HexCanFoodSmall]/RESOURCE[Food]/amount$ - maxAmount = #$@PART[HexCanFoodSmall]/RESOURCE[Food]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = water - displayName = #autoLOC_TACLS_00017 // Water - linkedVariant = Water - selectorFieldName = Supply Type - RESOURCE - { - name = Water - amount = #$@PART[HexCanDrinkingWaterSmall]/RESOURCE[Water]/amount$ - maxAmount = #$@PART[HexCanDrinkingWaterSmall]/RESOURCE[Water]/maxAmount$ - } - } - - MODULE - { - name = ModuleSwitchableResources - resourcesId = oxygen - displayName = #autoLOC_TACLS_00018 // Oxygen - linkedVariant = Oxygen - selectorFieldName = Supply Type - RESOURCE - { - name = Oxygen - amount = #$@PART[HexCanOxygenSmall]/RESOURCE[Oxygen]/amount$ - maxAmount = #$@PART[HexCanOxygenSmall]/RESOURCE[Oxygen]/maxAmount$ - } - } - - -RESOURCE[Food] {} - -RESOURCE[Water] {} - -RESOURCE[Oxygen] {} -} - -// Hide the original un-"condensed" parts, since they're no longer needed. -@PART[HexCanFoodSmall|HexCanDrinkingWaterSmall|HexCanOxygenSmall]:AFTER[ThunderAerospace] -{ - %TechHidden = True - @category = none - @tags ^= :\s*cck-lifesupport:: -} +// Condense the various "small" TACLS hex cans into a single part +// that has switchable resources via variants. + +@PART[HexCanLifeSupportSmall]:HAS[!MODULE[ModuleSimpleFuelSwitch]]:AFTER[ThunderAerospace] +{ + MODULE + { + name = ModulePartVariants + baseVariant = LifeSupport + VARIANT + { + name = LifeSupport + displayName = Supplies + primaryColor = #39826b + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanLifeSupport/Texture + } + } + VARIANT + { + name = Food + displayName = #autoLOC_TACLS_00016 // Food + primaryColor = #b29368 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanFood/Texture + } + } + VARIANT + { + name = Water + displayName = #autoLOC_TACLS_00017 // Water + primaryColor = #316178 + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanDrinkingWater/Texture + } + } + VARIANT + { + name = Oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + primaryColor = #94aebd + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanBreathingOxygen/Texture + } + } + VARIANT + { + name = Waste + displayName = #autoLOC_TACLS_00020 // Waste + primaryColor = #1d1d1d + secondaryColor = #ffffff + TEXTURE + { + mainTextureURL = ThunderAerospace/TacLifeSupportHexCans/HexCanWaste/WasteTexture + } + } + } + + // Need this to make the resources switchable + MODULE + { + name = ModuleSimpleFuelSwitch + } + + // Now set up the switchable resource options for the part. + MODULE + { + name = ModuleSwitchableResources + resourcesId = supplies + displayName = Supplies + linkedVariant = LifeSupport + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$/RESOURCE[Food]/amount$ + maxAmount = #$/RESOURCE[Food]/maxAmount$ + } + RESOURCE + { + name = Water + amount = #$/RESOURCE[Water]/amount$ + maxAmount = #$/RESOURCE[Water]/maxAmount$ + } + RESOURCE + { + name = Oxygen + amount = #$/RESOURCE[Oxygen]/amount$ + maxAmount = #$/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = food + displayName = #autoLOC_TACLS_00016 // Food + linkedVariant = Food + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Food + amount = #$@PART[HexCanFoodSmall]/RESOURCE[Food]/amount$ + maxAmount = #$@PART[HexCanFoodSmall]/RESOURCE[Food]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = water + displayName = #autoLOC_TACLS_00017 // Water + linkedVariant = Water + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Water + amount = #$@PART[HexCanDrinkingWaterSmall]/RESOURCE[Water]/amount$ + maxAmount = #$@PART[HexCanDrinkingWaterSmall]/RESOURCE[Water]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = oxygen + displayName = #autoLOC_TACLS_00018 // Oxygen + linkedVariant = Oxygen + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = Oxygen + amount = #$@PART[HexCanOxygenSmall]/RESOURCE[Oxygen]/amount$ + maxAmount = #$@PART[HexCanOxygenSmall]/RESOURCE[Oxygen]/maxAmount$ + } + } + + MODULE + { + name = ModuleSwitchableResources + resourcesId = waste + displayName = #autoLOC_TACLS_00020 // Waste + linkedVariant = Waste + selectorFieldName = #SimpleFuelSwitch_supplyLabel + RESOURCE + { + name = CarbonDioxide + amount = #$@PART[HexCanLifeSupportWasteSmall]/RESOURCE[CarbonDioxide]/amount$ + maxAmount = #$@PART[HexCanLifeSupportWasteSmall]/RESOURCE[CarbonDioxide]/maxAmount$ + } + RESOURCE + { + name = WasteWater + amount = #$@PART[HexCanLifeSupportWasteSmall]/RESOURCE[WasteWater]/amount$ + maxAmount = #$@PART[HexCanLifeSupportWasteSmall]/RESOURCE[WasteWater]/maxAmount$ + } + RESOURCE + { + name = Waste + amount = #$@PART[HexCanLifeSupportWasteSmall]/RESOURCE[Waste]/amount$ + maxAmount = #$@PART[HexCanLifeSupportWasteSmall]/RESOURCE[Waste]/maxAmount$ + } + } + + -RESOURCE[Food] {} + -RESOURCE[Water] {} + -RESOURCE[Oxygen] {} +} + +// Hide the original un-"condensed" parts, since they're no longer needed. +@PART[HexCanFoodSmall|HexCanDrinkingWaterSmall|HexCanOxygenSmall]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +} + +// Hide the original waste parts, since they're no longer needed. +@PART[HexCanLifeSupportWasteSmall]:AFTER[ThunderAerospace] +{ + %TechHidden = True + @category = none + @tags ^= :\s*cck-lifesupport:: +}