mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-31 13:50:48 +00:00
- reformat the intermission screen if the text is very long.
This will ensure better visibility on widescreen displays, at least.
This commit is contained in:
parent
612f198fcf
commit
fab8fed8df
1 changed files with 11 additions and 0 deletions
|
@ -248,6 +248,7 @@ void DIntermissionScreenFader::Drawer ()
|
|||
|
||||
void DIntermissionScreenText::Init(FIntermissionAction *desc, bool first)
|
||||
{
|
||||
bool usesDefault = mTextX < 0;
|
||||
Super::Init(desc, first);
|
||||
mText = static_cast<FIntermissionActionTextscreen*>(desc)->mText;
|
||||
if (mText[0] == '$') mText = GStrings(&mText[1]);
|
||||
|
@ -256,6 +257,16 @@ void DIntermissionScreenText::Init(FIntermissionAction *desc, bool first)
|
|||
if (mTextX < 0) mTextX =gameinfo.TextScreenX;
|
||||
mTextY = static_cast<FIntermissionActionTextscreen*>(desc)->mTextY;
|
||||
if (mTextY < 0) mTextY =gameinfo.TextScreenY;
|
||||
|
||||
// If the text is too wide, center it so that it works better on widescreen displays.
|
||||
// On 4:3 it'd still be cut off, though.
|
||||
int width = SmallFont->StringWidth(mText);
|
||||
if (usesDefault && mTextX + width > 320 - mTextX)
|
||||
{
|
||||
mTextX = (320 - width) / 2;
|
||||
}
|
||||
|
||||
|
||||
mTextLen = (int)mText.CharacterCount();
|
||||
mTextDelay = static_cast<FIntermissionActionTextscreen*>(desc)->mTextDelay;
|
||||
mTextColor = static_cast<FIntermissionActionTextscreen*>(desc)->mTextColor;
|
||||
|
|
Loading…
Reference in a new issue