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

Larger world creation menu UI and options menu UI #35157

Merged
merged 10 commits into from
Nov 5, 2019
Merged

Larger world creation menu UI and options menu UI #35157

merged 10 commits into from
Nov 5, 2019

Conversation

Night-Pryanik
Copy link
Contributor

@Night-Pryanik Night-Pryanik commented Oct 30, 2019

Summary

SUMMARY: Interface "Larger world creation menu UI and options UI"

Purpose of change

Make use of modern display resolution for world creation menu UI and options menu UI.

Information in world creation menu UI is very densely condensed, to the point of long mods name or long mods descriptions doesn't fit in the interface. This is because of hopelessly outdated 80x24 terminal size it was created for. So I decided to use all available free space.
Also I had to make options menu UI larger too as World Options tab is shown in the world creation menu.

Describe the solution

  • Replaced all instances of FULL_SCREEN_HEIGHT and FULL_SCREEN_WIDTH to TERMY and TERMX respectively for world creation menu UI and options menu UI;
  • Added a handle_redraw function to get rid of graphical artifacts on main menu screen after exiting from world creation menu or options menu.

Describe alternatives you've considered

None.

Testing

Started game, opened options menu directly, opened world creation menu, checked for world options, returned to main menu, checked if all is ok.

Additional context

World creation menu before:
234

Options menu before: long names don't fit
678

World creation menu after: World Mods tab
изображение

World creation menu after: World Options tab
изображение

World creation menu after: Finalize World tab
изображение

Options menu after:
изображение

@Night-Pryanik Night-Pryanik added <Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc. [C++] Changes (can be) made in C++. Previously named `Code` labels Oct 30, 2019
@AMurkin
Copy link
Contributor

AMurkin commented Oct 30, 2019

src/options.cpp: In member function ‘std::__cxx11::string options_manager::show(bool, bool)’:
src/options.cpp:2588:13: error: ‘handle_redraw’ was not declared in this scope
             handle_redraw();
             ^~~~~~~~~~~~~
src/options.cpp:2676:13: error: ‘handle_redraw’ was not declared in this scope
             handle_redraw();
             ^~~~~~~~~~~~~

@Night-Pryanik
Copy link
Contributor Author

Yeah, I noticed the error too. How am I to resolve it?

@OzoneH3
Copy link
Member

OzoneH3 commented Oct 30, 2019

I'd suggest a width cap like other menus do, because having everything crammed to the left looks very ugly, especially on resolutions > 1080p.

@Night-Pryanik
Copy link
Contributor Author

Night-Pryanik commented Oct 30, 2019

width cap like other menus

What other menus are you talking about?

@OzoneH3
Copy link
Member

OzoneH3 commented Oct 30, 2019

I think the crafting menu does some % width thing, would have to double check later.

@reed501
Copy link
Contributor

reed501 commented Oct 30, 2019

width cap like other menus

What other menus are you talking about?

Many of the in-game menus:
inventory, use, reload, advanced inventory, etc.

@Night-Pryanik
Copy link
Contributor Author

You mean something like this?
изображение

@Night-Pryanik Night-Pryanik changed the title Fullscreen world creation menu UI and options menu UI Larger world creation menu UI and options menu UI Oct 30, 2019
@Night-Pryanik
Copy link
Contributor Author

Ok, it seems I managed to make world creation menu and options menu larger and centered.

Now it's the "undeclared use" of handle_redraw function. Can anyone help me with this? I declared it in cursesport.h and defined in sdltiles.cpp.

Also use all available space in worldgen confirmation menu.
@OzoneH3
Copy link
Member

OzoneH3 commented Oct 30, 2019

The prototype is inside a ifdef #if defined(TILES) || defined(_WIN32) which isn't accessible from curses builds inside options and wordfactory. You would have to ifdef the calls there as well.

@Night-Pryanik
Copy link
Contributor Author

Well, this redrawing should be available for curses builds too.

@OzoneH3
Copy link
Member

OzoneH3 commented Oct 30, 2019

Windows curses uses SDL for its redering so it's fine there.
Linux curses has no SDL. That's what the "TILES" definition enables.

There are only two options really:

  1. Wrap the handle_redraw(); calls with #if defined(TILES) || defined(_WIN32) in options and wordfactory.

  2. Move the void handle_redraw(); prototype out of the ifdef #if defined(TILES) || defined(_WIN32) in cursesport.h and implement the void handle_redraw() { do something linux curses related } function for linux curses somewhere.

@OzoneH3
Copy link
Member

OzoneH3 commented Nov 4, 2019

It needs a minimum size as well, TERMX / 2 isn't very good for that (80x24):

@Night-Pryanik
Copy link
Contributor Author

Well, I can set a minimum horizontal size, but I'd prefer discard supporting that small resolution. Even the background theme on your pic with this resolution is distorted.

@OzoneH3
Copy link
Member

OzoneH3 commented Nov 4, 2019

So, the minimum would have to be 160. Until that's the case this PR is on ice I guess.

PS: Didn't the Issue with the discussion on minimum screen resolution got stale closed?!

@Night-Pryanik
Copy link
Contributor Author

PS: Didn't the Issue with the discussion on minimum screen resolution got stale closed?!

Yes, it was.

@Night-Pryanik
Copy link
Contributor Author

Done. Now windows are displayed correctly on both small and large resolutions.

Below are pics of 80 width
изображение
изображение

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.

5 participants