Page 1 of 1

show health only when selected

Posted: 30 Jan 2007, 22:29
by Masse
ya ya you got the point... i do remember few rts:ses that did it this way
and the mm was it F9 should toggle between these 3 options

allways show
never show
and show when selected

Posted: 30 Jan 2007, 22:40
by jcnossen
Probably the best way is just to remove this stuff from spring and implement it again in lua..

Posted: 30 Jan 2007, 22:56
by trepan
It could be done with the current LuaUI, but only for allied units
(I've got the code to support enemy unit queries written, but it
hasn't been committed yet).

It would be best to keep the basic F9 functionality in the main
Spring engine to minimize the overhead when dealing with large
numbers of units. For the case where only selected units get
health bars, LuaUI can do the rendering (it's already got the
GetSelectedUnits(), GetUnitHealth(), WorldToScreenCoords(),
and the necessary GL rendering calls). The stockpile build status
isn't available yet, nor are extra parameters like current shield
strength).

Posted: 30 Jan 2007, 23:42
by trepan
So I wrote the code to try using LuaUI to draw the unit bars,
and it seems to work fairly well (you can even setup your own
color gradient ;)) Then I got to thinking: what benefit is there
to only showing the health for selected units? The fact that you
can see the health for most enemy units in Spring makes it
kind of pointless.

One good thing that did come from this experiment is that I
noticed that the capture state can be displayed as a bar. Once
the enemy query code is in, you'll be able to draw the current
state of a capture.

Posted: 31 Jan 2007, 00:36
by LordMatt
trepan wrote: One good thing that did come from this experiment is that I
noticed that the capture state can be displayed as a bar. Once
the enemy query code is in, you'll be able to draw the current
state of a capture.
That would be nice!

Posted: 31 Jan 2007, 01:13
by manored
LordMatt wrote:
trepan wrote: One good thing that did come from this experiment is that I
noticed that the capture state can be displayed as a bar. Once
the enemy query code is in, you'll be able to draw the current
state of a capture.
That would be nice!
If possible, seeing the current status of a ressurrection would be nice too...

Posted: 31 Jan 2007, 10:31
by Masse
trepan wrote:Then I got to thinking: what benefit is there
to only showing the health for selected units?
preeetty thats the thing ;) :D:D i want to keep my spring clean and pretty no ugly green bars where i dont want em :) but nice to hear its do able with lua and man u can do allot of more stuff with lua i tought u been busy thanks :>

Posted: 31 Jan 2007, 12:14
by zwzsg
While you're at it, could you make it so the green selection square gradually turn to yellow and red when the unit health decrease?

From my own experience, billboarded health bar floating above unit really break the suspension of disbelief, while selection square under the unit don't.

Posted: 31 Jan 2007, 12:56
by Masse
zwzsg +1

Posted: 31 Jan 2007, 13:01
by RaiFox
Id also like the feature for health bars to be invisible when the unit is at full health.

Posted: 31 Jan 2007, 13:59
by 1v0ry_k1ng
+1 again