-
-
Notifications
You must be signed in to change notification settings - Fork 110
Customizable Bars of Health Points #1395
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
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]>
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
2128644
to
799ea22
Compare
A practical feature, let me share my ideas. |
@Fryone any response on the comments? |
I'm thinking if I should just finish whats done without any new logic changes (which is yrpp constants and docs) |
On the From what I understood, @CrimRecya (and previously @chaserli too) suggest a unified way to draw all such indicators and a "framework" of sorts, which is pretty logical. |
If possible, I also believe that #1422 is the best solution. But it requires a lot of effort, so I would like to ask for your opinion. Can you help complete this framework? if you don't have that much time either, perhaps we can also consider merging this pr first and modifying it in the future and using the migration document. |
the idea: [InfoDisplayTypes] |
I prefer to use separated |
Considering that the vanillia filename is called "pips.shp", "pipbrd.shp", maybe it's better to use |
from design perspective #1635 is clearer and more universal, but since that one is closed, I think we should tweak this PR a bit to make it use generic |
Can you list what specifically needs improvement with examples? I think @Fryone could incorporate @NetsuNegi's improvements over this PR, or @NetsuNegi could submit some changes as he has edit rights as a maintainer. |
I already changed tag names, just not uploaded it here. Plus, there is something that using any shield bar type would crash game. |
- changed logic and namings - shields does not work - some problems with value calculations
latest look [BarTypes] ; section in rulesmd.ini [HEALTHBAR1] [AudioVisual] [SOMETECHNO] |
Planned:
|
b429215
to
280b1c8
Compare
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.
