panel_io.cxx: if an action doesn't have a button, fire its bindings
immediately and then throw it away; this is useful for initialization purposes (see dme.xml) cockpit.cxx: warnings--; typos--
This commit is contained in:
parent
c5f1ffaf64
commit
1c27be1cb4
2 changed files with 14 additions and 6 deletions
|
@ -718,13 +718,11 @@ void fgCockpitUpdate( void ) {
|
|||
|
||||
int iwidth = xsize_node->getIntValue();
|
||||
int iheight = ysize_node->getIntValue();
|
||||
float width = iwidth;
|
||||
// float height = iheight;
|
||||
|
||||
// FIXME: inefficient
|
||||
if ( hud_visibility_node->getBoolValue() ) {
|
||||
// This will check the global hud linked list pointer.
|
||||
// If these is anything to draw it will.
|
||||
// If there is anything to draw it will.
|
||||
fgUpdateHUD();
|
||||
}
|
||||
|
||||
|
|
|
@ -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, then fogotten
|
||||
if (!node->hasValue("button")) {
|
||||
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"));
|
||||
|
|
Loading…
Add table
Reference in a new issue