# PartScalarTransformer

`PartScalarTransformer` stores a variant-specific scalar override for generated part data.

## Purpose

Use this transformer when a variant needs to override a scalar value that belongs to the serialized/generated part definition rather than to a dedicated runtime module transformer. The source-backed implementation is especially relevant for keys that have a registered V-SwiFT visualizer, such as `maxTemp`.

## Type

Source-backed runtime type: `VSwift.Modules.Transformers.PartScalarTransformer`

## Fields

* `Key`: `string`
* `Value`: `JToken`

## Behavior

* `ApplyCommon`: no effect
* `ApplyInOab`: no direct effect in the current implementation
* `ApplyInFlight`: no effect
* Persistence path: saves its own payload so generated part data can replay the scalar override later

## State handling

* Reverter: no
* Saves information: yes, through `PartScalarLoader`
* Visualizes information: yes

## Visualization

The current built-in visualizer table includes:

* `maxTemp`

If `Key` matches a known visualizer entry, the popup UI renders a localized stat block using the stored `Value`.

## Example

```patch
Transformers: [
  {
    Name: "DefaultScalarVisualizer",
    Key: "maxTemp"
  },
  {
    Name: "PartScalarTransformer",
    Key: "maxTemp",
    Value: 2400
  }
]
```

## Caveats

* The live transformer methods do not mutate the OAB part directly. This transformer matters through saved/generated part data replay.
* Only keys registered in `PartScalarTransformer.Visualizers` get a built-in stat block in the V-SwiFT UI.
* Treat this as an advanced tool for data-level overrides, not as a replacement for dedicated transformers like `EngineModeSwapper` or `ResourceContainerAdder`.

## Related

* [Persistence and generated part data](https://docs.ksp2redux.org/doc/persistence-and-generated-part-data-fKNHoh2plE)
* [DefaultScalarVisualizer](https://docs.ksp2redux.org/doc/defaultscalarvisualizer-iku5vogc12)