-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customizable Bars of Health Points #1395
base: develop
Are you sure you want to change the base?
Conversation
Initial commit
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. |
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 :) |
Couple of suggestions on the general API stuff: For technos the tag should be 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. |
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. |
#1287 #1309 #1395 |
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. |
- added emptypip - added draw direction - added border offset - changed overall logic
src/New/Type/BarTypeClass.h
Outdated
Nullable<TranslucencyLevel> BoardBG_Translucency; | ||
Nullable<SHPStruct*> BoardFG_File; | ||
Valueable<bool> BoardFG_ShowWhenNotSelected; | ||
Nullable<TranslucencyLevel> BoardFG_Translucency; | ||
Valueable<Vector2D<int>> Board_Offset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why translucency flags are nullable here when they can just be valueables with default 0?
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? |
Nothing, I just need to get it. I just need to do it. |
Co-authored-by: Kerbiter <[email protected]>
Co-authored-by: Kerbiter <[email protected]>
Co-authored-by: Kerbiter <[email protected]>
Co-authored-by: Kerbiter <[email protected]>
Co-authored-by: Kerbiter <[email protected]>
Co-authored-by: Kerbiter <[email protected]>
Co-authored-by: Kerbiter <[email protected]>
Co-authored-by: Kerbiter <[email protected]>
Co-authored-by: Kerbiter <[email protected]>
Co-authored-by: Kerbiter <[email protected]>
src/Ext/Techno/Hooks.Pips.cpp
Outdated
int length = pThisIsInf ? 8 : 17; | ||
|
||
if (pThisIsBld) | ||
{ | ||
position.Y -= (static_cast<BuildingClass*>(pThis)->Type->Height + 1) * Unsorted::CellHeightInPixels / 2; | ||
const int pThisBldTypeWidth = static_cast<BuildingClass*>(pThis)->Type->GetFoundationWidth(); | ||
length = pThisBldTypeWidth * 7 + (pThisBldTypeWidth / 2); | ||
} | ||
else | ||
{ | ||
position.Y -= pThisIsInf ? 25 : 26; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add constants from here to YRpp (I think) to improve readability
- changed blitterflags - updated logic with latest hook movements - shield and health bars can be used separately
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.