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

Refactor non-waiting popups using ui_adaptor #39054

Merged
merged 12 commits into from
Apr 1, 2020

Conversation

Qrox
Copy link
Contributor

@Qrox Qrox commented Mar 27, 2020

Summary

SUMMARY: Interface "Refactor non-waiting popups using ui_adaptor"

Purpose of change

Replace popup_nowait and popup_status with a new class static_popup that properly handles redrawing and resizing.

Describe the solution

  1. Fixed a few glitches in the ui_manager and query_popup code when UI changes position.
  2. Made a new class static_popup that displays a popup without taking inputs.
  3. Made a new class background_pane that obscures all UIs below.
  4. Used static_popup and background_pane in place of popup_nowait, popup_status, and catacurses::erase().

Testing

Tested in game and popup worked as intended in normal gameplay as well as after resizing. Some popups were not tested specifically, such as the save migration popup, because I didn't have a save to test.

@ZhilkinSerg ZhilkinSerg added 0.E Feature Freeze [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. labels Mar 27, 2020
@ZhilkinSerg ZhilkinSerg force-pushed the dev branch 2 times, most recently from f8a5ec4 to 0e1c29d Compare March 29, 2020 10:52
@ZhilkinSerg ZhilkinSerg merged commit e47b0a8 into CleverRaven:dev Apr 1, 2020
@ZhilkinSerg ZhilkinSerg mentioned this pull request Apr 1, 2020
13 tasks
@Qrox Qrox deleted the migrate-ui-2 branch April 1, 2020 12:39
@ZhilkinSerg
Copy link
Contributor

A couple of things that I found:

  1. Pressing ? and closing in some menus (character menu, log, bionics and mutation menus) leaves screen partially blank.

image

image

image

image

  1. Pressing / to open filter popup on overmap second time (or alt-tabbing out of game when popup is open) hides overmap screen:

image

image

@Qrox
Copy link
Contributor Author

Qrox commented Apr 1, 2020

These are expected before all menus are migrated to ui_adaptor, because unmigrated menus still redraws on their own and do not trigger redraw of lower UIs.

I'll add ui_adaptor ui( ui_adaptor::disable_uis_below ); for unmigrated UIs so lower UIs do not get redrawn, which fixes the second issue. The first issue is simply the original behavior of the game's UIs so I'll fix it when I migrate the remaining UIs.

@ZhilkinSerg
Copy link
Contributor

Makes sense. No rush about it - I still need to merge dev to master yet.

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants