News:

SimuTranslator
Make Simutrans speak your language.

[patch] Always shown & colored graph tooltips

Started by blove, October 31, 2009, 07:11:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

blove

I've been playing simutrans for several years now off and on and just today learned that you can display a tooltip on graphs by left clicking on a line.  (And I found that by digging through the code!)

This patch makes those tooltips always show when the cursor is near the line.  I don't think it can hurt to have the values displayed more often.

But, sometimes the points are close together, so you don't know which one you're viewing.  So this patch also introduces tooltips with color!  Support for colored tooltips extends far beyond graphs, but this patch only implements them there.  Everywhere else that calls win_set_tooltip() or win_set_static_tooltip() now requires two extra parameters, which I've supplied as 0, which means "use environment default".

If you look closely at the image, you'll notice the tooltip on the left doesn't display quite properly.  The shadowing is off.  This is caused by display_ddd_proportional() using the previous color and the next color from the colormap to draw the bevel.  I'm not quite sure how to solve this problem.

Ben

prissi

There are only a limited range of useful colors in simutrans. It ends with 224. Within those, always 8 color belong together. I.e. ddd_box is save to call with colors%8>1  &&  color%8<7. You will need to clip any color into this range.