pioneerspacesim/pioneer — pull request #2367 by robn (2013-07-10 00:28:16+00:00)
Title: UI: Gauge widget

A nice gauge widget. Not much to say about it - you give it a value, it shows it. Optionally you can set up "warning" and "critical" thresholds, which will change its colour. That'll be useful for temperature/fuel gauges in the future.

Needed to make some small renderer tweaks to allow setting the blend modes. There was talk at one time of doing this with multitexturing to reduce it to a single draw, but that required a lot more hacking on the renderer to support it, and I couldn't get it working right anyway. But I'll tackle if it someone (@Luomu) thinks its better - don't want to add bad things unnecessarily.

Gauge has been added to the loading/boot screen (now on the new UI!), and also to the infoview, though that's mostly as a demo and not what I intend as a final layout. The fuel bar is "live", demonstrating the use of bind points.

There's two bind points, `value` and `valuePercent`. They both do the same thing, but `value` takes 0-1 while `valuePercent` takes 0-100. This is done almost entirely to support the ship `fuel` property, which is 0-100. It _should_ be 0-1, but that's an API break that I don't want to touch yet. I intend to use `value` and `valuePercent` elsewhere, so I'm mentioning it because its new API that someone might have an opinion on. Its not hugely important though.