Skip to content

Commit

Permalink
Merge ddnet#6809
Browse files Browse the repository at this point in the history
6809: Fix text alignment in large confirmation popups with long text, increase buffer size for generic popup message  r=edg-l a=Robyt3

Closes ddnet#6806.

The message can contain a filename, so it should be large enough to contain that and the message itself.

Screenshots:
- Before: 
![screenshot_2023-07-04_18-09-12](https://github.com/ddnet/ddnet/assets/23437060/39cd4761-8cd0-4ac1-a24a-5115c8eed8c9)
- After:
![screenshot_2023-07-04_21-43-45](https://github.com/ddnet/ddnet/assets/23437060/c8f05f83-3f32-445a-8451-3a8be14a6007)
- Before (filename is truncated): 
![screenshot_2023-07-04_21-49-49](https://github.com/ddnet/ddnet/assets/23437060/16dfade5-f330-45b8-ac2f-1bc0d9a3fda1)
- After (full filename is shown):
![screenshot_2023-07-04_21-49-33](https://github.com/ddnet/ddnet/assets/23437060/eae1d789-f8e4-45c4-853e-ba655ab98168)

There is a separate issue with the text wrapping not working correctly with this long Unicode filename, which is causing the font size to decrease instead. See ddnet#6810.

## Checklist

- [X] Tested the change ingame
- [X] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <[email protected]>
  • Loading branch information
bors[bot] and Robyt3 authored Jul 4, 2023
2 parents c555d04 + 89a5281 commit f63ff62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/game/client/components/menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,7 @@ int CMenus::Render()
{
pTitle = m_aPopupTitle;
pExtraText = m_aPopupMessage;
TopAlign = true;
}
else if(m_Popup == POPUP_CONNECTING)
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/components/menus.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class CMenus : public CComponent
NUM_BUTTONS
};
char m_aPopupTitle[128];
char m_aPopupMessage[256];
char m_aPopupMessage[IO_MAX_PATH_LENGTH + 256];
struct
{
char m_aLabel[64];
Expand Down

0 comments on commit f63ff62

Please sign in to comment.