]> git.mxchange.org Git - flightgear.git/commitdiff
make /sim/current-gui an integer
authormfranz <mfranz>
Wed, 13 Jul 2005 10:57:27 +0000 (10:57 +0000)
committermfranz <mfranz>
Wed, 13 Jul 2005 10:57:27 +0000 (10:57 +0000)
src/GUI/new_gui.cxx

index 0e62c99c9cfc3f09111cd98a9217537b86d75ec1..5b8295ec61f500211130ff3f90365248cb53259c 100644 (file)
@@ -278,14 +278,14 @@ NewGUI::setStyle (void)
 
     //puSetDefaultStyle();
 
-    string path = fgGetString("/sim/current-gui", "/sim/gui");
-    string p;
-
-    p = path + "/font";
-    setupFont(fgGetNode(p.c_str(), true));
-
-    p = path + "/colors";
-    SGPropertyNode *n = fgGetNode(p.c_str(), true);
+    int which = fgGetInt("/sim/current-gui", 0);
+    SGPropertyNode *sim = globals->get_props()->getNode("sim");
+    SGPropertyNode *n = sim->getChild("gui", which);
+    if (!n)
+        n = sim->getChild("gui", 0, true);
+
+    setupFont(n->getNode("font", true));
+    n = n->getNode("colors", true);
 
     for (int i = 0; i < n->nChildren(); i++) {
         SGPropertyNode *child = n->getChild(i);