-
Notifications
You must be signed in to change notification settings - Fork 164
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
Hud config framework #6495
base: master
Are you sure you want to change the base?
Hud config framework #6495
Conversation
31de7a4
to
3d75c10
Compare
9bcf290
to
74ccc32
Compare
Tagging as 25.0 for now since it is foundational for the HUD configure updates, which will be extremely useful for all mods. Discussing with MJN, he calculated the best order of operations for the process is as follows: 1 Font scaling PR: #6481 (and #6330 and #6342, which are both done) |
b1b7c85
to
e0f3784
Compare
This PR relies on #6487 and #6481 . It sets up the necessary framework to be able to render each HUD gauge in "config" mode which will allow rendering the gauges outside of a mission environment, namely the HUD Config screen. For now the config argument is commented out because it's unused. The bulk of the changes here are in hud.cpp and the various rendering methods where in
config
mode we don't do any screen resizing.Config mode requests to render each gauge not only scaled down slightly but at an arbitrary offset depending on whether we're rendering through the retail UI or SCPUI. For that reason I found it was much easier to calculate a gauge's position and scale manually within the gauge render code itself where we also have access to the bitmap with it's height and width. This also allows us to save those coordinates to an array to use against the mouse coords to detect mouseover and click on these rendered gauges. The relevant code, shown below, is currently unreachable since nothing calls them.
HC_gauge_coordinates
is never initialized for now. That will be resolved in the big HUD Config UI overhaul PR.Future PRs will systematically go through each gauge rendering code and build out the full config mode rendering path which mostly consists of setting the coords, scale, and providing dummy data where mission data is currently expected.