DragonflightDesign
Resource contributor
- Messages
- 1,390
- Country

When I hit the 'set_named' line, the variable 'landingleft' is definately set to 1. The first bit of strangeness is that xLandingLightsLeft (the XML pointer) was initialised to zero at startup but is now at -1. When I leave the 'set_named' line, xLandingLightsLeft is still at -1.
BOOL FSAPI overhead_landingleft_mcb( PPIXPOINT relative_point, FLAGS32 mouse_flags )
{
if (mouse_flags & (FLAGS)MOUSE_LEFTSINGLE)landingleft = 0;
if (mouse_flags & (FLAGS)MOUSE_RIGHTSINGLE)landingleft = 1;
set_named_variable_value (xLandingLightsLeft, (FLOAT64)landingleft);
return FALSE;
}
Later in the icon callback I have this:
FLOAT64 FSAPI overhead_landingleft_icon_cb( PELEMENT_ICON pelement )
{
landingleft = (int)get_named_variable_value (xLandingLightsLeft);
return landingleft;
}
The variable 'landingleft' is set to -1 (the contents of xLandingLightsLeft) instead of the required 1 as set by the mouseclick. I think I can dispose of the obvious first... apart from initialisation, xLandingLightsLeft is absolutely not being touched or set anywhere else.
All of the XML setup and communication is being done in a single gauge. The IDs (e.g. ID xLandingLightLeft) are defined at the top of the gauge. The XML variables are being registered during a PANEL_SERVICE_CONNECT_TO_WINDOW call, so it's definately a one-off setup e.g.
register_named_variable("LandingLightLeft");
The PRE_UPDATE is being used to get the current state of the variables (i.e. looking for a change in the VC) e.g.
xLandingLightsLeft = check_named_variable ("LandingLightsLeft");
Then I also have the opposite effect where updating one XML variable changes three or four others. The two have to be related but...
Any and all ideas welcome, including those poiting to my own stupidiy.
BOOL FSAPI overhead_landingleft_mcb( PPIXPOINT relative_point, FLAGS32 mouse_flags )
{
if (mouse_flags & (FLAGS)MOUSE_LEFTSINGLE)landingleft = 0;
if (mouse_flags & (FLAGS)MOUSE_RIGHTSINGLE)landingleft = 1;
set_named_variable_value (xLandingLightsLeft, (FLOAT64)landingleft);
return FALSE;
}
Later in the icon callback I have this:
FLOAT64 FSAPI overhead_landingleft_icon_cb( PELEMENT_ICON pelement )
{
landingleft = (int)get_named_variable_value (xLandingLightsLeft);
return landingleft;
}
The variable 'landingleft' is set to -1 (the contents of xLandingLightsLeft) instead of the required 1 as set by the mouseclick. I think I can dispose of the obvious first... apart from initialisation, xLandingLightsLeft is absolutely not being touched or set anywhere else.
All of the XML setup and communication is being done in a single gauge. The IDs (e.g. ID xLandingLightLeft) are defined at the top of the gauge. The XML variables are being registered during a PANEL_SERVICE_CONNECT_TO_WINDOW call, so it's definately a one-off setup e.g.
register_named_variable("LandingLightLeft");
The PRE_UPDATE is being used to get the current state of the variables (i.e. looking for a change in the VC) e.g.
xLandingLightsLeft = check_named_variable ("LandingLightsLeft");
Then I also have the opposite effect where updating one XML variable changes three or four others. The two have to be related but...
Any and all ideas welcome, including those poiting to my own stupidiy.


