]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/panel_io.cxx
whoops ... compile (this silly #define will be removed very soon)
[flightgear.git] / src / Cockpit / panel_io.cxx
index a8ae3f8828671afba0b13098dd3814674eb93604..6fd0f23d60d0ef0d93ea1e3e7097d927af2be8f4 100644 (file)
 //  WITHOUT ANY WARRANTY; without even the implied warranty of
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 //  General Public License for more details.
-// 
+//
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 //  $Id$
 
@@ -171,6 +171,19 @@ readConditions (SGConditional *component, const SGPropertyNode *node)
 static FGPanelAction *
 readAction (const SGPropertyNode * node, float w_scale, float h_scale)
 {
+  unsigned int i, j;
+  SGPropertyNode *binding;
+  vector<SGPropertyNode_ptr>bindings = node->getChildren("binding");
+
+  // button-less actions are fired initially
+  if (!node->hasValue("w") || !node->hasValue("h")) {
+    for (i = 0; i < bindings.size(); i++) {
+      FGBinding b(bindings[i]);
+      b.fire();
+    }
+    return 0;
+  }
+
   string name = node->getStringValue("name");
 
   int button = node->getIntValue("button");
@@ -182,11 +195,8 @@ readAction (const SGPropertyNode * node, float w_scale, float h_scale)
 
   FGPanelAction * action = new FGPanelAction(button, x, y, w, h, repeatable);
 
-  vector<SGPropertyNode_ptr>bindings = node->getChildren("binding");
   SGPropertyNode * dest = fgGetNode("/sim/bindings/panel", true);
 
-  SGPropertyNode *binding;
-  unsigned int i, j;
   for (i = 0; i < bindings.size(); i++) {
     SG_LOG(SG_INPUT, SG_INFO, "Reading binding "
       << bindings[i]->getStringValue("command"));
@@ -429,6 +439,7 @@ readLayer (const SGPropertyNode * node, float w_scale, float h_scale)
   string type = node->getStringValue("type");
   int w = node->getIntValue("w", -1);
   int h = node->getIntValue("h", -1);
+  bool emissive = node->getBoolValue("emissive", false);
   if (w != -1)
     w = int(w * w_scale);
   if (h != -1)
@@ -447,6 +458,11 @@ readLayer (const SGPropertyNode * node, float w_scale, float h_scale)
   if (type == "texture") {
     FGCroppedTexture texture = readTexture(node->getNode("texture"));
     layer = new FGTexturedLayer(texture, w, h);
+    if (emissive) {
+      FGTexturedLayer *tl=(FGTexturedLayer*)layer;
+      tl->setEmissive(true);
+    }
+
   }
 
                                // A group of sublayers.
@@ -475,7 +491,7 @@ readLayer (const SGPropertyNode * node, float w_scale, float h_scale)
     tlayer->setPointSize(pointSize);
 
                                // Set the font.
-    string fontName = node->getStringValue("font", "default");
+    string fontName = node->getStringValue("font", "Helvetica");
     tlayer->setFontName(fontName);
 
     const SGPropertyNode * chunk_group = node->getNode("chunks");