Skip to content

Commit

Permalink
Moved chat input out of the bottom left corner because it overlays ot…
Browse files Browse the repository at this point in the history
…her UI elements
  • Loading branch information
IgeNiaI committed Dec 9, 2022
1 parent 00d63ce commit 8d89473
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,9 @@ void CHAT_Render( void )
positionY = positionY - SmallFont->GetHeight() + 1;
}

int chatWidth = static_cast<int> ( SCREENWIDTH * scaleX );
positionY = (int) (positionY * 0.66);

int chatWidth = static_cast<int> ( (SCREENWIDTH / 3) * scaleX );
chatWidth -= static_cast<int> ( round( SmallFont->GetCharWidth( '_' ) * scaleX * 2 + SmallFont->StringWidth( prompt )) );

// Build the message that we will display to clients.
Expand All @@ -670,7 +672,7 @@ void CHAT_Render( void )
messageColor = CR_DARKGRAY;

// Render the chat string.
HUD_DrawText( SmallFont, promptColor, 0, positionY, prompt );
HUD_DrawText( SmallFont, promptColor, SmallFont->StringWidth( prompt ), positionY, prompt );

if ( SmallFont->StringWidth( displayString ) > chatWidth )
{
Expand All @@ -681,15 +683,15 @@ void CHAT_Render( void )

for ( int i = 0; lines[i].Width != -1; ++i )
{
HUD_DrawText( SmallFont, messageColor, SmallFont->StringWidth( prompt ), messageY, lines[i].Text );
HUD_DrawText( SmallFont, messageColor, SmallFont->StringWidth( prompt ) * 2, messageY, lines[i].Text );
messageY += SmallFont->GetHeight();
}

V_FreeBrokenLines( lines );
}
else
{
HUD_DrawText( SmallFont, messageColor, SmallFont->StringWidth( prompt ), positionY, displayString );
HUD_DrawText( SmallFont, messageColor, SmallFont->StringWidth( prompt ) * 2, positionY, displayString );
}

// [RC] Tell chatters about the iron curtain of LMS chat.
Expand Down

0 comments on commit 8d89473

Please sign in to comment.