April 17, 200323 yr I am wating to design a fuel selector gauge but I dont know what display variable to give it, and I dont know the functions to assign to the switch. It will have 2 positions, left tank (switch pointing to the left), and right tank (switch pointing to the right).Does anybody know how to achieve this?I am designing it with C++, not XML.Thanks,Kobie
April 17, 200323 yr Hey Kobie.Sounds like the easiest thing to do to animate this gauge would be to use the MAKE_ICON macros to animate the fuel selector.To control which tank is selected, use EventIDs. So for the mouse click rectangle on the left, you'd assign KEY_FUEL_SELECTOR_LEFT, and for the right, you guessed it, KEY_FUEL_SELECTOR_RIGHT.These are called with the following structure BOOL FSAPI FuelLeft( PPIXPOINT relative_point, FLAGS32 mouse_flags)trigger_key_event(KEY_FUEL_SELECTOR_LEFT); In this example, the mouse rectangle you designed over the left part of the fuel selector BMP background is called FuelLeft. Everytime you click there the fuel selector will be switched to the left side. of course you'd have to add some code to control the selector handle bitmap to actually move from left to right and vice-versa, but that should be straight forward. Let me know if you need mroe help.
April 17, 200323 yr Check FUEL_TANK_SELECTOR and the FUEL_SELECT enums to read, use KEY_FUEL_SELECTOR_.. to set.Arne Bartels
April 17, 200323 yr ... about all those enums: How can I extract data from 'em? I think you are referring to the typedef enum FUEL_SELECT bla bla... etc stuff.Thanks,Etienne :-wave
April 17, 200323 yr Enums are just integers "with names".For fuel selector MODULE_VAR fuel_sel={FUEL_TANK_SELECTOR};lookup_var(&fuel_sel);if(fuel_sel.var_value.n==FUEL_TANK_SELECTOR_ALL)//all tanks selected....if(fuel_sel.var_value.n==FUEL_TANK_SELECTOR_LEFT)...//left tank selectedif(fuel_sel.var_value.n==FUEL_TANK_SELECTOR_RIGHT)...//right tank selectedetc.
April 18, 200323 yr Yeah, that's clear, but if you look into gauges.h, there's somewhere the following (line 306): typedef enum SURFACE_CONDITION{ SURFACE_CONDITION_NORMAL = 0, // default for the given SURFACE_TYPE SURFACE_CONDITION_WET, SURFACE_CONDITION_ICY, SURFACE_CONDITION_SNOW, // this is for snow on a non-snow SURFACE_TYPE SURFACE_CONDITION_MAX // this surface condition should always be last}SURFACE_CONDITION; I don't think there's a TokenVar for it. Or will it then just be MODULE_VAR condi = {SURFACE_CONTITION};? Will that work? I gotta try it today.Etienne :-wave
April 18, 200323 yr I have not got it to work yet either. I used the FUEL_TANK_SELECTOR variable, and still nothing. The images wont change. I got the tanks to switch with the key events, but the two icon images that i enter wont change. I am just at wits end with it.... x(
April 18, 200323 yr Hey Kobie.Don't worry mate.If you don't mind, can you send me your code? I can have a look and try to get it working.The e-mail is [email protected]
Create an account or sign in to comment