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

New scores window replacing kills window #34117

Merged
merged 4 commits into from
Sep 20, 2019

Conversation

jbytheway
Copy link
Contributor

@jbytheway jbytheway commented Sep 20, 2019

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:

  • A new_centred_win function for creating a window in the centre of the screen.
  • A 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

scores-kills
scores-scores

@KorGgenT
Copy link
Member

neat! how do the kills display with stats through kills?

@Night-Pryanik
Copy link
Contributor

Should also close #8957 - at least if monster's name isn't too long to not fit even with one column.

@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. [JSON] Changes (can be) made in JSON labels Sep 20, 2019
@Night-Pryanik
Copy link
Contributor

Night-Pryanik commented Sep 20, 2019

While you're working with the windows code, I suggest increasing window size. Currently there is TOO much free, unused space, especially on big resolution monitors.
изображение

At least to something like this:
изображение

@jbytheway
Copy link
Contributor Author

While you're working with the windows code, I suggest increasing window size. Currently there is TOO much free, unused space, especially on big resolution monitors.

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.
@jbytheway
Copy link
Contributor Author

neat! how do the kills display with stats through kills?

scores-kills-stk

@Night-Pryanik
Copy link
Contributor

Do you (or anyone else) have any specific ideas about what approach makes the most sense here?

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.

@ZhilkinSerg
Copy link
Contributor

Let's merge it as it is and increase window size later.

@ZhilkinSerg ZhilkinSerg merged commit 6e59d1e into CleverRaven:master Sep 20, 2019
@jbytheway jbytheway deleted the scores_window branch September 21, 2019 01:00
misterprimus pushed a commit to misterprimus/Cataclysm-DDA that referenced this pull request Sep 21, 2019
* 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.
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` Info / User Interface Game - player communication, menus, etc. [JSON] Changes (can be) made in JSON
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kill count screen cuts off on long-named monsters
4 participants