Skip to content
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

Compact aim window pt.2 - Numbers #40236

Merged
merged 4 commits into from
May 8, 2020

Conversation

Kilvoctu
Copy link
Contributor

@Kilvoctu Kilvoctu commented May 6, 2020

Summary

SUMMARY: Interface "Compact aim window pt.2 - Numbers"

Purpose of change

Part 2 of #37715 in which the aim window automatically decreases in width (from 55 to 34) when using "compact" and "labels-narrow" sidebars. This part handles the "Numbers" accuracy display style.

Describe the solution

Remake the "Numbers" accuracy display style to better fit into the narrow aim window. Aim confidence, percentages and moves are displayed as a table. A new function insert_table is created to handle this display.

Describe alternatives you've considered

None.

Testing

Compile and launch game
Test aiming on an NPC and an enemy using bars and numbers accuracy display, with narrow and standard sidebar width. Tested on maximized and minimal terminal size.

Additional context

Below is a comparison of how the "Numbers" display looks normally, then how it looks under a narrow sidebar style.
1
2

Compact aim window pt2 for numbers display, adapt existing code from old branch
@ifreund ifreund added [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. <Enhancement / Feature> New features, or enhancements on existing labels May 6, 2020
remove leftover comment and center colors legend for english
@Kilvoctu Kilvoctu changed the title [WIP] Compact aim window pt.2 - Numbers Compact aim window pt.2 - Numbers May 8, 2020
@Kilvoctu
Copy link
Contributor Author

Kilvoctu commented May 8, 2020

Seems like I didn't need to change much from my initial commit. After all, this project was effectively completed months ago and was just waiting for pt 1 to be merged.

I've noticed that under a narrow sidebar style, the accuracy display stays near the middle and doesn't adjust depending on whether there's a target or not. Like so:
Untitled
Normally, when no target is highlighted, these four blank spaces are absent, leaving no gap between "Recoil" and "Steadiness".
As this behavior exists in current builds, idunno if it's a stylistic choice since the compact aim window provides so much vertical space that we can dedicate four rows to a possible target. Not sure if I should leave it as is or restore the default behavior.

Sidenote, as can be seen from above screenshot, the legend below "Steadiness" is centered now. I think it looks better. As per a past suggestion, this legend is a single long string, to help ease translations.

Not sure what else to add, so opening the PR for review now.

@Kilvoctu Kilvoctu marked this pull request as ready for review May 8, 2020 05:43
@olanti-p
Copy link
Contributor

olanti-p commented May 8, 2020

I've noticed that under a narrow sidebar style, the accuracy
display stays near the middle and doesn't adjust depending on
whether there's a target or not. Like so:

This is a new behavior for almost all layouts, you can check function panel_target_info for how it works. The space for target always takes 4 lines to prevent whatever print_ranged_chance prints from jumping around - in this case, the table. Saves the effort of searching for a necessary row each time you move the cursor.

Copy link
Contributor

@ifreund ifreund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ifreund ifreund merged commit 5e6dc67 into CleverRaven:master May 8, 2020
@Kilvoctu
Copy link
Contributor Author

Kilvoctu commented May 8, 2020

Thanks for the explanation @olanti-p. It took me by surprise seeing this new behavior, as I've been away for awhile. I like the bool fill_with_blank_if_no_target in the mention function

And thanks again @ifreund (and everyone else) for all your support on this project :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants