From 14addaab073c74ec8dfc3a4dd50ff3803f13f233 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sat, 10 Jun 2006 09:22:27 +0000 Subject: [PATCH] treat colors like the other parameters: only copy them from the palette color group /sim/hud/palette/color[*]/ to the active group /sim/hud/color/ if they really exist. (Parameters like can be set in the active group and be left alone, or set by each color group.) --- src/Cockpit/hud.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Cockpit/hud.cxx b/src/Cockpit/hud.cxx index b0db049ad..4f5157289 100644 --- a/src/Cockpit/hud.cxx +++ b/src/Cockpit/hud.cxx @@ -1114,9 +1114,12 @@ void HUD_Properties::valueChanged(SGPropertyNode *node) i = 0; SGPropertyNode *n = fgGetNode("/sim/hud/palette", true); if ((n = n->getChild("color", i, false))) { - _red->setFloatValue(n->getFloatValue("red", 1.0)); - _green->setFloatValue(n->getFloatValue("green", 1.0)); - _blue->setFloatValue(n->getFloatValue("blue", 1.0)); + if (n->hasValue("red")) + _red->setFloatValue(n->getFloatValue("red", 1.0)); + if (n->hasValue("green")) + _green->setFloatValue(n->getFloatValue("green", 1.0)); + if (n->hasValue("blue")) + _blue->setFloatValue(n->getFloatValue("blue", 1.0)); if (n->hasValue("alpha")) _alpha->setFloatValue(n->getFloatValue("alpha", 0.67)); if (n->hasValue("alpha-clamp")) -- 2.39.5