Project

General

Profile

Bug #24447

Updated by DRVeyl about 4 years ago

A UI_FloatRange that has its maxValue = minValue causes other UI PAW elements to be unresponsive, even in other PartModules.

Basic context: for procedural part type mods, where e.g. a tech unlock expands the range of a configurable field, but default values are fixed. In this example, a technology level is user-selectable, but at the start of a career there is only 1 level available.

1.8.1 build 2694, no expansions, stock + ModuleManager 4.1.2 + single test mod with no other dependencies. Reference screenshot:

!Capture.PNG!

TechLevel is declared as:

[KSPField(isPersistant = true, guiActive = true, guiActiveEditor = true, guiName = "Tech Level", guiFormat = "N0"),
UI_FloatRange(minValue = 0f, stepIncrement = 1f, scene = UI_Scene.Editor, suppressEditorShipModified = true)]
private float TechLevel = -1f;

The maxValue is set to 0 in OnStart() in the Editor. As a result, all of the PAW elements displayed above TechLevel do not respond to mouse events. Reaction Wheels (stock), RCS (stock), Antenna (UI_Toggle in mod) do not toggle when clicked. UI_FloatEdit / UI_FloatRanges Wheel Authority (stock), Thrust Limiter (stock), Transmit Power (UI_FloatRange in mod) do not slide or change. All of the PAW elements below TechLevel behave normally.

Setting maxValue to 0 in the declaration instead of OnStart() has the same result.

If the maxValue is set to 1 [or any other value] in OnStart(), everything behaves normally.

KSP.log does not show any exceptions or unexpected messages. Also does not show messages that would evidence onFieldChanged handlers for the two mod-created unresponsive UI Controls were called.

Back