Popout variant set example

This example shows a variant set that uses the popout UI instead of a dropdown.

Example

@use "VSwift:*";

:parts #engine_1.5v_methalox_cheetah {
    @include part-switch() {
        +EnginePackage {
            VariantSetLocalizationKey: "MyMod/EnginePackage";
            IsPopout: true;

            +Vacuum {
                VariantLocalizationKey: "MyMod/EnginePackage/Vacuum";
                +DefaultEngineModesVisualizer {}
                +EngineModeSwapper {
                    Name: EngineModeSwapper;
                    Modes: [ /* replacement engine modes */ ];
                }
            }

            +SeaLevel {
                VariantLocalizationKey: "MyMod/EnginePackage/SeaLevel";
                +DefaultEngineModesVisualizer {}
            }
        }
    }
}

What it demonstrates

  • VariantSet.IsPopout = true

  • popout-oriented engine stat visualizers

  • a variant that swaps engine modes by engineID

Notes

In the runtime code, popout entries are generated as module actions rather than dropdown items, and the popout UI respects the same tech tree locking rules as the dropdown workflow.