-
Notifications
You must be signed in to change notification settings - Fork 4.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
Dynamic compact aim window pt.1 #37715
Dynamic compact aim window pt.1 #37715
Conversation
Truly dynamic width would if it will depend on the content. |
"Dynamic" is just what I'm calling the PR. I can rename it to "automatically compact aim window" or something similar if it's really a problem. I'm not good at making titles. For translators, I did try to keep them in mind to the best of my knowledge when doing the compact UI, giving the window a couple more width than bare minimum and removing some unnecessary stuff. Lastly, an aim window that truly dynamically adjusts depending on window content is outside the scope of this PR. The purpose is a compact aim window for compact sidebars. If the window widens because the player is "Firing ++ Very Verbose Automatic Rifle of Lengthy Name+5 *"", it defeats this purpose. |
For "Moves to fire", I can change that to just "Moves", which feels like an acceptable shorthand. It's used in other UI such as reloading ammo. Will also be consistent with the tentative Numbers accuracy display style. As for the line with a legend (Symbols), how much character width is needed? I can cut down 1-4 extra spaces I think, but if a lot more character width is needed, I can try something else. |
@AMurkin The first thing feels like it needs a better representation no matter the width. Something like
Russian 'Прицеливание' is much longer than english 'aim', it looks like a mess with any width IMHO. @Kilvoctu the last word is currently translated as 'Скользящее попадание', so 14 characters short. Probably can be shortened to 'Вскользь' / 'Скользящее' / 'Царапина', tbh |
Shortened "Moves to fire" to "Moves" and color-coded it. When translated to Russian, this should help differentiate so it doesn't look like one sentence. I think the window should be wide enough for "Тщательным Прицеливание Движений", but probably not if "Стоимость движ" is used, unless "Прицеливание" is omitted. For symbols legend, I used a function to count the amount of characters, then have the line wrap to next line if exceeding window width. It doesn't look beautiful but is atleast readable. See below. |
Something like that, I think?
I didn't test it, but the idea is to create 'symbol = explanation' string for each |
@Kilvoctu this has grown some merge conflicts after being on hold so long due to 0.E. Could you please resolve them? I'll put this on my merge list pending conflict resolution. |
Make aim window dynamically shrink in size whenever sidebar is set to compact
Right align text using right_print instead of janky solution
Add conditionals to exclude Numbers indicator style, to work on later. Also fix minor bugs.
fix translation markers and clean up some code
Minor refactor of aim strings, change "moves to fire" to "moves", detect length of "symbols" line and wrap if necessary
3bcc222
to
709918e
Compare
Fix conflicts by adapting code into new existing code
remove the unnecessary includes that I accidentally added during fixing conflicts
The conflicts have been resolved. There've been a few changes to the ranged.cpp file over the last few months so hopefully I didn't break anything when re-adapting my code into it... It compiled, and I tested the panels under various sidebar styles. Appears fine, unless I missed something. |
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!
* dynamic aim window Make aim window dynamically shrink in size whenever sidebar is set to compact * fix astyle regressions * use right_print Right align text using right_print instead of janky solution * Set up to split project into two parts Add conditionals to exclude Numbers indicator style, to work on later. Also fix minor bugs. * Right align "moves to fire" text and remove hotkeys display * fix translation markers fix translation markers and clean up some code * text handling Minor refactor of aim strings, change "moves to fire" to "moves", detect length of "symbols" line and wrap if necessary * revise text wrapping * commit suggestions * use correct types * Fix conflicts Fix conflicts by adapting code into new existing code * astyle * trim includes remove the unnecessary includes that I accidentally added during fixing conflicts
Summary
SUMMARY: Interface "Dynamic compact aim window pt.1"
Purpose of change
Have the aim window dynamically decrease in width (from 55 to 34) when using "compact" and "labels-narrow" sidebars to keep in theme with having compact UI.
This is part 1, which only handles the "Bars" accuracy display style. "Numbers" is not affected.
Describe the solution
~ Sets aim window to 34 width.
~ Remove keybinds help text. Instead, "[?] for help" is displayed at the bottom.
~ Put "Targets: " on a new line.
~ Shorten Symbols help text.
~ Right-align "Moves to fire".
~ Shorten aim confidence bars to provide blank space on right-hand side.
~ Put moves to fire number in said blank space.
Describe alternatives you've considered
Creating a new accuracy display style. Implementation was janky and it's another option to manage.
Keeping keybinds help text visible. I feel like it's unnecessary.
Making compact aim window the same width as the compact sidebars (32 width). A little too tight.
Changing aim window height. Didn't see a need.
Testing
Game compiles and loads.
Open aim window for each sidebar option in sequence with Bars style and repeat with Numbers style.
Move aim cursor around and steady my aim (Aim confidence adjusts accordingly).
Aim at an NPC and some monsters.
Aim via throwing. Aim via turret.
Aim while application is set to maximized terminal size, as well as minimum possible terminal size.
Press
?
to show keybind help window.Quick video showing aim window and swapping sidebar options:
https://i.imgur.com/yd9EtQq.mp4
Additional context
Comparison screenshots, taken at minimum terminal size:


Reiterating that Numbers accuracy display should look the same at the moment. I didn't know how to redo its UI, but ifreund provided an attractive mockup of how it'd fit into the window:

As approaching this change is quite different from the approach for Bars, I'd decided to save Numbers for part 2.
If these current changes are deemed to be acceptable, this PR can be safely merged on its own once out of feature freeze, if I have not completed part 2 by then.
Afterward, if it all looks good, we can consider applying some of the changes to the normal aim window, which I feel like could be trimmed down to classic sidebar width (44 width).