-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add compass HUD element #9312
Add compass HUD element #9312
Conversation
Co-authored-by: Jean-Patrick Guerrero <[email protected]> Co-authored-by: Pierre-Yves Rollo <[email protected]>
d175da8
to
c8d1000
Compare
I support the idea, but am not sure how the second HUD works |
I don`t understand why the steel ladder element is needed for the compass on the screen? |
This was just provided as an example, I could have put anything else. |
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.
except the comment fine to me
src/hud.h
Outdated
@@ -61,6 +61,7 @@ enum HudElementType { | |||
HUD_ELEM_STATBAR = 2, | |||
HUD_ELEM_INVENTORY = 3, | |||
HUD_ELEM_WAYPOINT = 4, | |||
HUD_ELEM_COMPASS = 6, |
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.
why 6 and not 5 ?
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.
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.
Thanks SmallJocker, that's it.
I was hesitating between having same number in the two PRs then reajust, or try to hide this detail from perspicacious eyes of core devs :)
As I consider if you want to know along which horizontal direction (North/South, East/West) you are currently moving, you can just press F5 and you above see info about it. I don`t understand a point of this feature. |
Not everyone uses F5 for gameplay. Some people reserve that strictly for debugging. |
I think it would be nice to embed default compass and reserve for it a special key (e.g F11 or any else) to be able to activate/deactivate it. Also, shift it to right or left downer corner as it would overlap the chat text. But probably this is already other topic. |
In my opinion, adding default stuff to engine is a mistake. Specific things like compass (an minimap) should be managed by game and mods. This gives much more freedom to modders to do what they want. |
i agree with @pyrollo . |
Rebased |
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.
Tested, works. Few small issues.
Co-authored-by: SmallJoker <[email protected]>
Co-authored-by: SmallJoker <[email protected]>
As pyrollo is now a core dev, this can be merged. Although, i am unsure this is worth adding. PR #9315 hides yaw according to a privilege, perhaps this is all we need as it makes it server controlled? |
All games could just be text adventures, but that would be no fun |
Well, that is just a snarky comment that misrepresents my comment to ridicule it. |
I think Rubenwardy is right, visual effects are important in video games, they improve immersion. This PR is less about showing the heading direction than adding visual effects. One criticism I could make to my own PR is that it is a bit limited. Such elements could also be able to point to a map point or something else. But HUD specification was too limited to do that. Maybe with #10245 it could be possible to have a very versatile "moving or rotating" image HUD element. Example use cases:
So should this PR be improved before merged ? (I guess yes) |
This PR adds a "compass" HUD element (new HUD feature).
Basically it is like image HUD element but it rotates or translates according to the current heading direction. This allows to build various compass HUD. The display is entirely updated on client side so it is quite smooth.
To do
This PR is ready for review.
How to test
Here is a sample code for testing it, using default mod textures :
This adds two compass HUD elements in the upper left corner of the screen (better texture would be much more suitable 😄) :
![screenshot_20200114_164400](https://user-images.githubusercontent.com/49488517/72359049-dfe99e00-36ed-11ea-8074-11f789747474.png)