PDA

View Full Version : Tool Tips what were how?



OBIO
April 12th, 2011, 22:34
I am working to modify the stock DC-3 fuel gauge to work with a plane that does not have 201 and 203 gallon tanks.....one that has 3 50-gallon tanks. I opened the XLM file and changed the capacities to 50 50 50.

But I can't find the tooltips so I can create a new one to work with this modified gauge. Here's a copy of the modified XLM so you can see what I have done and maybe be able to help me do what I want to do....and yes...the cab has been unzipped and the resulting folder had been renamed.

<Gauge Name="fuel_gauge" Version="1.0">
<Image Name="fuel_gauge.bmp"/>

<!-- ========================= Fuel Gauge ======================== -->
<Element>
<Position X="42" Y="42.8437"/>
<Image Name="fuel_gauge_needle.bmp" PointsTo="North">
<Axis X="3" Y="29.8437"/>
</Image>
<Rotate>
<Value>(L:Fuel Gauge Switch, enum) 0 ==
if{ (A:Fuel tank left main level,position) 50 * quit }
else{ (L:Fuel Gauge Switch, enum) 1 ==
if{ (A:Fuel tank right main level,position) 50 * quit }
else{ (A:Fuel tank center level,position) 50 * quit } }
</Value>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
<GAUGE_FUEL_INDICATORS Action="Freeze"/>
</Failures>
<Nonlinearity>
<Item Value="0" X="15" Y="62"/>
<Item Value="10" X="9" Y="36"/>
<Item Value="18" X="24" Y="15"/>
<Item Value="26" X="49" Y="10"/>
<Item Value="34" X="71" Y="27"/>
<Item Value="42" X="70" Y="59"/>
<Item Value="50" X="68" Y="61"/>
</Nonlinearity>
<Delay DegreesPerSecond="180"/>
</Rotate>
</Element>

<Mouse>
<Help ID="HELPID_GAUGE_FUEL_PERCENT"/>
<Tooltip ID="TOOLTIPTEXT_DC3_FUEL_GAUGE"/> <<<How do I change this>>>
</Mouse>
</Gauge>

OBIO

Moparmike
April 14th, 2011, 06:46
Well...once again I've got some help for ya with some C source code but I'm not exactly sure how it needs to be reformatted to use in an XML gauge.

This is from a fuel gauge I built for Lilski's Scout & Decathalon a few years back. Was my first "custom" tooltip text project and I didn't comment it very well so I don't really remember all the details. DOH!

This one reads the LEFT_MAIN tank level. The 0.00012 is a scaling factor to get the raw sim value scaled to 0-100 (to show percent of fuel). The first section is the argument to get the value from the sim and covert it to the number that I want to display.

The second section is building the custom text string that I want to display.
The entire string that is displayed in the sim is contained in the quotation marks. It will display Left Fuel: and then the value from the above argument.
The %1!d!% formats the argument value to no decimal point (whole numbers only).
The last % in that string quotation is displaying a percent sign after the value. (It shows up as "xxx%" ).




////////dyn tooltip stuff////////////////////////////////////////////////////
MOUSE_TOOLTIP_ARGS (fuell_Args)
MOUSE_TOOLTIP_ARG (FUEL_TANK_LEFT_MAIN_LEVEL, 0.000012, NULL, NULL, NULL, NULL, NULL, NULL)
MOUSE_TOOLTIP_ARGS_END


MOUSE_BEGIN( fuell_mouse_rect, HELP_NONE, 0, 0 )
MOUSE_TOOLTIP_TEXT_STRING ("Left Fuel: %1!d!%%", fuell_Args)
MOUSE_END
I don't know if this is a help or a hindrance to ya. I just stink at XML so I've never really been able to talk myself into learning the XML gauges better.

fxsttcb
April 30th, 2011, 09:11
It looks like you are also using the DC-3 Fuel Selector so you can try replacing:

<Tooltip ID="TOOLTIPTEXT_DC3_FUEL_GAUGE"/>

With:

<Tooltip>%"Fuel Quantity (%((L:Fuel Gauge Switch, enum))%{case}%{:0}Left Main = %((A:Fuel tank left main level,position) 50 *)%!d! Gallons)%{:1}Right Main = %((A:Fuel tank right main level,position) 50 *)%!d! Gallons)%{:2}Aux = %((A:Fuel tank center level,position) 50 *)%!d! Gallons)"</Tooltip>

That is the SDK's test string for the original tooltip and should work. If you change the tank size, just change the 50s...Don