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

Proper window management #6

Open
zorun opened this issue Jul 14, 2011 · 0 comments
Open

Proper window management #6

zorun opened this issue Jul 14, 2011 · 0 comments
Assignees

Comments

@zorun
Copy link
Collaborator

zorun commented Jul 14, 2011

ASCIIpOrtal does make use of a lot of different "screens" to ensure user interaction (e.g. selecting map pack, showing the menu).

The way it is done for now (drawing everything in the same curses window, the root one) is not very convenient, because:

  • it involves crazy calculations to display text at the right place
  • it does not allow parts of the screen to be refreshed as-needed (e.g call the in-game menu, use "Select level", and press to go back to the menu: the small "Choose a level" window does not disappear and becomes part of the background picture)

The right way to do things would be to use a different curses window each time we need this kind of interaction. For this, we obviously need a layer of abstraction.

Maybe make use of a library (a small "windows manager" in curses) or write it ourselves. What we basically need is a stack that contains windows: the top window is the one that is displayed to the user, and when it exits, we refresh the underlying windows (from the deepest window, up to the "surface"). It would also be nice to have a bit of logic to handle user input (yes/no, cancel, chose amongst a list of options), as there is a lot of code duplication for now.

If you have any idea or suggestion, feel free to contribute :)

@ghost ghost assigned zorun Jul 16, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant