3266: Fix chat scoreboard collision for 16:9 and disable scoreboard checks … r=def- a=Jupeyy

…for lower aspect ratios

fixes #3223

![screenshot_2020-11-07_19-04-54](https://user-images.githubusercontent.com/6654924/98448455-6d3e2900-212c-11eb-9352-730119577178.png)

![screenshot_2020-11-07_19-04-43](https://user-images.githubusercontent.com/6654924/98448454-6c0cfc00-212c-11eb-89dd-51a74e4aa8d3.png)


## 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 if it works standalone, system.c especially
- [ ] 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)


3267: Add czech translation by eNJi r=heinrich5991 a=def-

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] 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: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2020-11-07 19:02:55 +00:00 committed by GitHub
commit 536295ec74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 652 additions and 647 deletions

File diff suppressed because it is too large Load diff

View file

@ -893,7 +893,9 @@ void CChat::OnPrepareLines()
float y = 300.0f - 28.0f;
float FontSize = FONT_SIZE;
bool IsScoreBoardOpen = m_pClient->m_pScoreboard->Active();
float ScreenRatio = Graphics()->ScreenAspect();
bool IsScoreBoardOpen = m_pClient->m_pScoreboard->Active() && (ScreenRatio > 1.7f); // only assume scoreboard when screen ratio is widescreen(something around 16:9)
bool ForceRecreate = IsScoreBoardOpen != m_PrevScoreBoardShowed;
bool ShowLargeArea = m_Show || g_Config.m_ClShowChat == 2;
@ -917,7 +919,7 @@ void CChat::OnPrepareLines()
RealMsgPaddingTee = 0;
int64 Now = time();
float LineWidth = (IsScoreBoardOpen ? 90.0f : 200.0f) - RealMsgPaddingX - RealMsgPaddingTee;
float LineWidth = (IsScoreBoardOpen ? 85.0f : 200.0f) - (RealMsgPaddingX * 1.5f) - RealMsgPaddingTee;
float HeightLimit = IsScoreBoardOpen ? 180.0f : m_PrevShowChat ? 50.0f : 200.0f;
float Begin = x;
@ -1230,9 +1232,12 @@ void CChat::OnRender()
OnPrepareLines();
float ScreenRatio = Graphics()->ScreenAspect();
bool IsScoreBoardOpen = m_pClient->m_pScoreboard->Active() && (ScreenRatio > 1.7f); // only assume scoreboard when screen ratio is widescreen(something around 16:9)
int64 Now = time();
float HeightLimit = m_pClient->m_pScoreboard->Active() ? 180.0f : m_PrevShowChat ? 50.0f : 200.0f;
int OffsetType = m_pClient->m_pScoreboard->Active() ? 1 : 0;
float HeightLimit = IsScoreBoardOpen ? 180.0f : m_PrevShowChat ? 50.0f : 200.0f;
int OffsetType = IsScoreBoardOpen ? 1 : 0;
float RealMsgPaddingX = MESSAGE_PADDING_X;
float RealMsgPaddingY = MESSAGE_PADDING_Y;