-
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
New scores window replacing kills window #34117
Conversation
neat! how do the kills display with stats through kills? |
Should also close #8957 - at least if monster's name isn't too long to not fit even with one column. |
I thought about this, and it would be easy to do, but right now I feel like there really isn't any need to make the window bigger. It could dynamically size, although that's a bit tricky for a tabbed window because if it's sized well for one tab it might not be for another. Do you (or anyone else) have any specific ideas about what approach makes the most sense here? I don't have much UI theory background. |
This is intended to simplify window creation for this common use case.
Scores are often not meaningful or computed incorrectly if they started to exist partway through a game. Therefore, note which scores existed when the game started, and only report those that existed then and still exist now.
This is a text view with built-in scrollbar which can be used in the simplest cases when wanting to fit text into an otherwise-too-small area. This is actually a fairly rare situation in CDDA, because normally scrolling regions contain some sort of selected item, and this doesn't cater for that.
Re-purpose the kills screen keybinding ')' to open a new UI that can display kills as before, but can also display the new scores info.
0550fb9
to
77799de
Compare
I do. Many menus' (like kills count, missions, message log, sidebar options etc) dimensions are fixed and don't scale dynamically according to the actual monitor resolution. What's worse, the are based on terribly outdated 80x24 dimensions. As such, I propose to get rid of this obsoleted stuff and make menus' dimensions scale dynamically - I provided one example above. However, with your new one-column style instead of a old three-columns style there might be too much free space inside the menu itself. So we need to approach carefully to each case. |
Let's merge it as it is and increase window size later. |
* Add a new_centered_win function This is intended to simplify window creation for this common use case. * Add stats_tracker::valid_scores Scores are often not meaningful or computed incorrectly if they started to exist partway through a game. Therefore, note which scores existed when the game started, and only report those that existed then and still exist now. * Add scrolling_text_view This is a text view with built-in scrollbar which can be used in the simplest cases when wanting to fit text into an otherwise-too-small area. This is actually a fairly rare situation in CDDA, because normally scrolling regions contain some sort of selected item, and this doesn't cater for that. * Replace kills screen with new scores screen Re-purpose the kills screen keybinding ')' to open a new UI that can display kills as before, but can also display the new scores info.
Summary
SUMMARY: Interface "Replace kills window with new scores window showing additional info"
Purpose of change
Working towards #4173.
Fixes #8957.
This provides a new, more convenient means to see the newly added scores during play, rather than only after the game is over.
Describe the solution
Replace the existing "kills" screen with a new tabbed window. One tab for scores and another for kills. I anticipate that achievements will be in a third tab when they are added.
Added a couple of generic GUI features to help this:
new_centred_win
function for creating a window in the centre of the screen.scrolling_text_view
for scrolling through arbitrary text.Also, because the calculation of some scores can easily go wrong if the game was started before the scores existed, now scores will only be reported if you started the game with them already in place (this applies to the memorial log too).
Describe alternatives you've considered
I would like to use the new GUI features in more places. I tried to find other instances of scrolling text, but most places with a scroll bar actually scroll based on a selection within the window, not just scrolling the view, which is a bit different. In the end I didn't find any other uses.
There probably are places to use
new_centred_win
, but I didn't want to delay this PR further by finding them.The kills are now listed in a single column rather than three. I could have still used multiple columns, but I've seen some monster names get too long for the columns, and I didn't want to add too much complexity there. Also, I'm imagining it might be fun to add some other info like the first and last kill times for each monster type to widen that data a bit.
The scores could do with livening up with some colour, but that can go in a separate PR.
Additional context