-
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
Dynamically scale overmap legend width #36662
Dynamically scale overmap legend width #36662
Conversation
Did you resize the game window? |
No, I play in borderless windowed mode, no scaling, 192x54 terminal(according to the game it equals 1920x1080, my display native resolution). |
Font settings? |
same for me. Fonts are own settings and this will cause the error. |
Did you change fontsize? I triggered this with just a different font size (10x10, instead of 8x16). |
my fonts.json:
So yeah, different font size from default. |
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/no-sidebar-in-overmap-screen/22394/2 |
@@ -518,7 +518,7 @@ void game::init_ui( const bool resized ) | |||
/** | |||
* Doing the same thing as above for the overmap | |||
*/ | |||
static const int OVERMAP_LEGEND_WIDTH = 28; | |||
OVERMAP_LEGEND_WIDTH = clamp( TERMX / 5, 28, 55 ); | |||
OVERMAP_WINDOW_HEIGHT = TERMY; | |||
OVERMAP_WINDOW_WIDTH = TERMX - OVERMAP_LEGEND_WIDTH; | |||
to_overmap_font_dimension( OVERMAP_WINDOW_WIDTH, OVERMAP_WINDOW_HEIGHT ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overmap window can have a different w´font than the rest of the game windows. Have you checked what happens when the overmap font is much larger and what if it the font is much smaller? I assume it's possible the overmap window itself overlays the legend window. Or the legend window is just too much to the left, so it's under the overmap window.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked what happens when the overmap font is much larger and what if it the font is much smaller?
No, I tested it only on default font dimensions.
Same problem. Adding my info here as I have a 16:10 screen (2560x1600). Font:
|
This reverts commit a758fa6.
Same here. 1920x1080, overmap fontsizes 10x10x10. I can see only a litte bit of the legend window on the bottom of the screen. Looks like in my case happened what BevapDin said: "Or the legend window is just too much to the left, so it's under the overmap window". |
Since this new feature broke the overmap for non-default players, would you please revert these changes until a proper fix can be made? |
No need to revert it, #36879 will fix it. |
Summary
SUMMARY: Interface "Dynamic overmap legend width."
Purpose of change
Current overmap legend width is fixed to 28 symbols, which is very low and isn't enough for long descriptions. This is especially bad for high-resolution monitors since there is a lot of free space to fit long texts.
Describe the solution
Made overmap legend width scale dynamically based on size of terminal. Its width now is one-fifth of the terminal size, clamped to be no less than 28 and no more than 55 symbols.
Describe alternatives you've considered
Use folding for all strings where it should be considered appropriate, but it cures the symptoms, not the cause of the problem.
Testing
Started game, opened overmap, checked for overmap legend width.
Additional context
Before (in Russian). Russian translation is longer than the original text, so it is overlapped to the next string
After (clamped to max of 55 symbols on my resolution)