Open Fryone opened 1 month ago
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.
Added customizable vertical health bars in form of HealthBarTypes. By default, technos use their own vanilla healthbars. Adding
CustomHealthBarType
changing health bar to this type. Can be applied to buildings.Example
[HealthBarTypes] ; section in rulesmd.ini 0=HEALTHBAR1 [HEALTHBAR1] Frame.Background=PIPBRD ; shp file for use as background, first frame Frame.Background.Translucency=0 ; background translucency level Frame.Background.ShowWhenNotSelected=false ; should background be drawn, when ponting on techno Frame.Foreground= ; shp file for use as foreground (drawn after health sections), first frame Frame.Foreground.ShowWhenNotSelected=false ; should foreground be drawn, when ponting on techno HealthBar.OffsetX=0 ; horizontal offset, similar to PixelSelectionBracketDelta Sections.Pips=16,17,18 ; frames of pips.shp to use (green, yellow, red states) Sections.Amount=17 ; amount of sections, when bar is full Sections.Size=2 ; size in px of individual section [SOMETECHNO] CustomHealthBarType=HEALTHBAR1
No docs for now, needs testing.
Those voxels are quite nice and seem to resemble the look and feel of the original game voxels. Did you make those voxels yourself?
Those voxels are quite nice and seem to resemble the look and feel of the original game voxels. Did you make those voxels yourself?
yep
nice feature for epic vehicle/airship/battleship :)
Custom Health Bar
Couple of suggestions on the general API stuff:
[HealthBarTypes]
=> [BarTypes]
In general I propose to treat this as a "custom anything bar" which can be used for HP bars.
For technos the tag should be CustomHealthBarType
=> HealthBar
, less redundancy and more in-line with other things.
I think shields should use that too.
P.S. Can you do any shape/direction bars this way? I think it's a matter of making the section offset customizable in two dimensions, this way you could specify the 2,2 offset and have the bar go diagonal for example.
P.S. Can you do any shape/direction bars this way? I think it's a matter of making the section offset customizable in two dimensions, this way you could specify the 2,2 offset and have the bar go diagonal for example.
The horizontal (vanilla like) bars were first in mind. I understand vertical ones, but diagonal...
The horizontal (vanilla like) bars were first in mind. I understand vertical ones, but diagonal...
It's only an example. The point is that if one can specify offset between sections in 2 dimensions then they can come up with whatever weird graphics they want, including diagonal bars, sectioned graphics etc.
I think, I probably should make some "BarMaker" then, like procedure to draw by position and type.
https://github.com/Phobos-developers/Phobos/pull/1287#issuecomment-2198477945 If you are making a bar, generalize it to cover all fractionable quantities. HP/SP are just a small part of them. Some should display regardless of mouse hovering/selected.
1287 #1309 #1395 #1287 (comment) If you are making a bar, generalize it to cover all fractionable quantities. HP/SP are just a small part of them. Some should display regardless of mouse hovering/selected.
yeah, so the bars can be used to draw without hovering/selecting. i'm just using bar-drawer in the vanilla health part code. So it behaves like vanilla health bar.
yeah, so the bars can be used to draw without hovering/selecting. i'm just using bar-drawer in the vanilla health part code. So it behaves like vanilla health bar.
I mean you can go more aggressive than that, just replace all 4 DrawHealthBar vtbl calls and handle it as well as other things in drawextras.
Also, you're hooking into the function. But the vanilla function is just one big if-else, and you hook both of the branches. You should replace the entire function.
Additionally, your hooks disable other Phobos hooks (shield bars, HeathBar.Height, digital displays). As such, you should move those patches into your replaced function, too.
@Fryone is there anything blocking you from fulfilling the requested changes?
@Fryone is there anything blocking you from fulfilling the requested changes?
Nothing, I just need to get it. I just need to do it.
Added customizable health bars in form of BarTypes. By default, technos use their own vanilla healthbars. Adding
HealthBar.BarType
changing health bar to this type. Can be applied to buildings.Example
No docs for now, needs testing.