Archived

This topic is now archived and is closed to further replies.

ddawson

Selecting different fuel Tanks from the #3 Engine in ...

Recommended Posts

Using The Token Variables TURB_ENGINE_3_TANK_SELECTOR KEY_FUEL_SELECTOR_3_RIGHT KEY_FUEL_SELECTOR_3_LEFT_MAIN KEY_FUEL_SELECTOR_3_OFF I was Trying to Use different Fuel Tanks While feeding the Num 3 Engine and I can't get anything to Work! I was using The Make Icon fron the Fuel selector SDK as a Templete. Except I can't get it working at all. I Will Put my code here that I can only make it work exactly like the default only the words are changed from (fuel_selector) to my words (engine_3_tank_selector)If Someone would Help me out it would be Appreciated and if Someone Else has the problem maybe it would help them also. Thanks!///////////////////////////////////////////////////////////////////////// SDK.Fuel_Selector.c// Copyright © 2000 Microsoft Corporation. All rights reserved.// Set up gauge headerchar engine_3_tank_selector_gauge_name[] = GAUGE_NAME;extern PELEMENT_HEADER engine_3_tank_selector_list;extern MOUSERECT engine_3_tank_selector_mouse_rect[];GAUGE_HEADER_FS700(GAUGE_W, engine_3_tank_selector_gauge_name, &engine_3_tank_selector_list, engine_3_tank_selector_mouse_rect, 0, 0, 0, 0);/////////////////////////////////////////////////////////////////////////////FLOAT64 FSAPI engine_3_tank_selector_icon_cb( PELEMENT_ICON pelement ){ switch (pelement->source_var.var_value.e) { case FUEL_TANK_SELECTOR_OFF: return 0; case FUEL_TANK_SELECTOR_LEFT: return 1; case FUEL_TANK_SELECTOR_ALL: return 2; case FUEL_TANK_SELECTOR_RIGHT: return 3; default: return 2; }}MAKE_ICON( engine_3_tank_selector_icon, BMP_engine_3_tank_selector_OFF, NULL, NULL, IMAGE_USE_ERASE | IMAGE_USE_TRANSPARENCY, 0, 0,0, FUEL_TANK_SELECTOR,engine_3_tank_selector_icon_cb, ICON_SWITCH_TYPE_STEP_TO, 4, 0, 0)PELEMENT_HEADER engine_3_tank_selector_icon_list[] ={ &engine_3_tank_selector_icon.header, NULL};/////////////////////////////////////////////////////////////////////////////MAKE_STATIC( engine_3_tank_selector_background, BMP_engine_3_tank_selector_OFF, engine_3_tank_selector_icon_list, NULL, IMAGE_USE_TRANSPARENCY | IMAGE_NO_STATIC_BLENDING, 0, 0, 0)PELEMENT_HEADER engine_3_tank_selector_list = &engine_3_tank_selector_background.header;/////////////////////////////////////////////////////////////////////////////MODULE_VAR engine_3_tank_selector_mouse_var = {FUEL_TANK_SELECTOR};BOOL FSAPI engine_3_tank_selector_mouse_cb( PPIXPOINT relative_point, FLAGS32 mouse_flags ){ lookup_var( &engine_3_tank_selector_mouse_var); switch (engine_3_tank_selector_mouse_var.var_value.e) { case FUEL_TANK_SELECTOR_LEFT: trigger_key_event( KEY_FUEL_SELECTOR_ALL, 0 ); break; case FUEL_TANK_SELECTOR_ALL: trigger_key_event( KEY_FUEL_SELECTOR_RIGHT, 0 ); break; case FUEL_TANK_SELECTOR_RIGHT: trigger_key_event( KEY_FUEL_SELECTOR_OFF, 0 ); break; case FUEL_TANK_SELECTOR_OFF: trigger_key_event( KEY_FUEL_SELECTOR_LEFT, 0 ); break; default: trigger_key_event( KEY_FUEL_SELECTOR_ALL, 0 ); break; } return TRUE;}MOUSE_BEGIN( engine_3_tank_selector_mouse_rect, HELPID_GAUGE_FUEL_SELECTOR, 0, 0 ) MOUSE_CHILD_FUNCT( 0,0,39,48, CURSOR_HAND, MOUSE_LEFTSINGLE, engine_3_tank_selector_mouse_cb )MOUSE_END/////////////////////////////////////////////////////////////////////////////#undef GAUGE_NAME#undef GAUGEHDR_VAR_NAME#undef GAUGE_W

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Your mouse callback code is the issue.I have no idea what this "lookup_var( &engine_3_tank_selector_mouse_var);" does... and I don't know of an FS MODULE_VAR for the mouse.

Share this post


Link to post
Share on other sites

I suspect that this is the structure you need:MODULE_VAR engine3_selector=RECIP_ENGINE3_TANK_SELECTOR;BOOL FSAPI engine_3_tank_selector_mouse_cb( PPIXPOINT relative_point, FLAGS32 mouse_flags ){ lookup_var(&engine3_selector); switch (engine3_selector.var_value.n) { case FUEL_TANK_SELECTOR_LEFT: trigger_key_event( KEY_FUEL_SELECTOR_ALL, 0 ); break;etc.-Dai

Share this post


Link to post
Share on other sites

I was trying to be able to select all tanks from the #3 Enginethen select left main tank from the 3 engine and be able to selectthe tank for the proper tank depending on the diff phase of flightso i figured out that storing the variable in engine3 fuel valve I was able to select the tank using the mouse I got it to work exceptit only works in the default mode and the bitmaps don't change.Also when I try to save the flight it saves the #1 #2 both main tanksfor the proper engine except the #3 #4 Engine main tanks aren't savedand it saves them all Tanks for the 3 and 4 engines and what that doesis saves an unbalanced fuel load if you don't change it back to the #3 and #4 main tanks. I really need to save the Panel state. I tried to use a config.ini except it don't work i guess i don't know how to do it the bae 146 panel project seemed to make the panel state save. Here is what I did to get the mouse to work.// SDK.engine3_fuel_valve.c// Copyright © 2000 Microsoft Corporation. All rights reserved.// Set up gauge headerchar engine3_fuel_valve_gauge_name[] = GAUGE_NAME;extern PELEMENT_HEADER engine3_fuel_valve_list;extern MOUSERECT engine3_fuel_valve_mouse_rect[];GAUGE_HEADER_FS700(GAUGE_W, engine3_fuel_valve_gauge_name, &engine3_fuel_valve_list, engine3_fuel_valve_mouse_rect, 0, 0, 0, 0);/////////////////////////////////////////////////////////////////////////////FLOAT64 FSAPI engine3_fuel_valve_icon_cb( PELEMENT_ICON pelement ){ switch (pelement->source_var.var_value.e) { case KEY_FUEL_SELECTOR_3_OFF : return 0; case KEY_FUEL_SELECTOR_3_LEFT: return 2; case KEY_FUEL_SELECTOR_3_ALL: return 1; case KEY_FUEL_SELECTOR_3_RIGHT: return 3; default: return 3; }}MAKE_ICON( engine3_fuel_valve_icon, BMP_engine3_fuel_valve_OFF, NULL, NULL, IMAGE_USE_ERASE | IMAGE_USE_TRANSPARENCY, 0, 0,0, GENERAL_ENGINE3_FUEL_VALVE , engine3_fuel_valve_icon_cb, ICON_SWITCH_TYPE_STEP_TO, 4, 0, 0)PELEMENT_HEADER engine3_fuel_valve_icon_list[] ={ &engine3_fuel_valve_icon.header, NULL};/////////////////////////////////////////////////////////////////////////////MAKE_STATIC( engine3_fuel_valve_background, BMP_engine3_fuel_valve_OFF, engine3_fuel_valve_icon_list, NULL, IMAGE_USE_TRANSPARENCY | IMAGE_NO_STATIC_BLENDING, 0, 0, 0)PELEMENT_HEADER engine3_fuel_valve_list = &engine3_fuel_valve_background.header;/////////////////////////////////////////////////////////////////////////////MODULE_VAR engine3_fuel_valve_mouse_var = {GENERAL_ENGINE3_FUEL_VALVE};BOOL FSAPI engine3_fuel_valve_mouse_cb( PPIXPOINT relative_point, FLAGS32 mouse_flags ){ lookup_var( &engine3_fuel_valve_mouse_var); switch (engine3_fuel_valve_mouse_var.var_value.e) { case KEY_FUEL_SELECTOR_3_LEFT : trigger_key_event( KEY_FUEL_SELECTOR_3_ALL, 0 ); break; case KEY_FUEL_SELECTOR_3_ALL: trigger_key_event( KEY_FUEL_SELECTOR_3_RIGHT, 0 ); break; case KEY_FUEL_SELECTOR_3_RIGHT: trigger_key_event( KEY_FUEL_SELECTOR_3_OFF, 0 ); break; case KEY_FUEL_SELECTOR_3_OFF: trigger_key_event( KEY_FUEL_SELECTOR_3_LEFT, 0 ); break; default: trigger_key_event( KEY_FUEL_SELECTOR_3_RIGHT_MAIN, 0 ); break; } return TRUE;}MOUSE_BEGIN( engine3_fuel_valve_mouse_rect, HELPID_GAUGE_FUEL_SELECTOR, 0, 0 ) MOUSE_CHILD_FUNCT( 0,0,39,48, CURSOR_HAND, MOUSE_LEFTSINGLE, engine3_fuel_valve_mouse_cb )MOUSE_END/////////////////////////////////////////////////////////////////////////////#undef GAUGE_NAME#undef GAUGEHDR_VAR_NAME#undef GAUGE_W

Share this post


Link to post
Share on other sites