Jump to content

Updating precision control mode UI


Recommended Posts

I've found I can query and change precision control mode by peeking / poking 'FlightInputHandler.fetch.precisionMode'. When I supply input after switch the mode programmatically, everything functionally works. However, the needles on the UI overlay do not change color (they remain whichever color they were). Can anyone point me at the object that I need to nudge to tell it to update those colors?

Link to comment
Share on other sites


foreach ( Renderer renderer in FlightInputHandler.inputGaugeRenderers)
renderer.material.color = (!FlightInputHandler.precisionMode) ? XKCDColors.Orange : XKCDColors.BrightCyan;

Have fun with alternate colors :)

Link to comment
Share on other sites


foreach ( Renderer renderer in FlightInputHandler.inputGaugeRenderers)
renderer.material.color = (!FlightInputHandler.precisionMode) ? XKCDColors.Orange : XKCDColors.BrightCyan;

Have fun with alternate colors :)

That's a disappointingly easy solution. :)

Link to comment
Share on other sites

  • 10 months later...
On 5/22/2016 at 10:43 PM, Teilnehmer said:

In KSP 1.1, renderer.material.color doesn’t work anymore.

Has anyone found the solution for 1.1?

Here's what I did

var gauges = UnityEngine.Object.FindObjectOfType<KSP.UI.Screens.Flight.LinearControlGauges>();
if (gauges != null)
{
    for (int i = 0; i < gauges.inputGaugeImages.Count; ++i)
    {
        gauges.inputGaugeImages[i].color = (state) ? XKCDColors.BrightCyan : XKCDColors.Orange;
    }
}

Although that doesn't work on the docking control display mode, only the normal flight display.  I haven't bothered with figuring out why docking control isn't changing colors, too.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...