TwinFan / XPMP2

Multiplayer library for X-Plane 11/12 with instancing, TCAS override, and sound

Home Page:https://twinfan.github.io/XPMP2/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expose maxLabelDist to some config function

TwinFan opened this issue · comments

Current Situation / Problem
See TwinFan/LiveTraffic#188
Distance up to which labels are drawn is hard coded to 5,000m at the moment. Some people like to see labels earlier.
Also, labels are cut off at X-Plane's reported visibility.

Suggested Solution
Provide a configuration option for maxLabelDist, either in the configuration callbacks or as a separate function, or as addition to the existing XPMPEnableAircraftLabels() call.

Benefits
Allows plugins to offer the user to chose when to show labels.

Additional context
TwinFan/LiveTraffic#188

Provided

/// Configure maximum label distance and if labels shall be cut off at reported visibility
/// @param _dist_nm Maximum label distance in nm, default is 3, minimum is 1
/// @param _bCutOffAtVisibility Shall labels not be drawn further away than XP's reported visibility?
void XPMPSetAircraftLabelDist (float _dist_nm, bool _bCutOffAtVisibility = true);