mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- fixed font scaling in RR's confirmation screens.
This commit is contained in:
parent
2e94fdc3b5
commit
2237113a77
3 changed files with 10 additions and 5 deletions
|
@ -67,6 +67,7 @@
|
|||
#include "gstrings.h"
|
||||
#include "menustate.h"
|
||||
#include "i_interface.h"
|
||||
#include "vm.h"
|
||||
|
||||
#define LEFTMARGIN 8
|
||||
#define RIGHTMARGIN 8
|
||||
|
@ -110,6 +111,8 @@ constate_e ConsoleState = c_up;
|
|||
|
||||
double NotifyFontScale = 1;
|
||||
|
||||
DEFINE_GLOBAL(NotifyFontScale)
|
||||
|
||||
void C_SetNotifyFontScale(double scale)
|
||||
{
|
||||
NotifyFontScale = scale;
|
||||
|
|
|
@ -178,6 +178,7 @@ struct _ native // These are the global variables, the struct is only here to av
|
|||
native readonly int GameTicRate;
|
||||
native MenuDelegateBase menuDelegate;
|
||||
native readonly int consoleplayer;
|
||||
native readonly double NotifyFontScale;
|
||||
}
|
||||
|
||||
struct MusPlayingInfo native
|
||||
|
|
|
@ -89,7 +89,7 @@ class MessageBoxMenu : Menu
|
|||
int mr2 = destWidth/2 + 10 + textFont.StringWidth(Stringtable.Localize("$TXT_NO"));
|
||||
mMouseRight = MAX(mr1, mr2);
|
||||
mParentMenu = parent;
|
||||
mMessage = textFont.BreakLines(Stringtable.Localize(message), generic_ui? 600 : 300);
|
||||
mMessage = textFont.BreakLines(Stringtable.Localize(message), 300/NotifyFontScale);
|
||||
mMessageMode = messagemode;
|
||||
if (playsound)
|
||||
{
|
||||
|
@ -107,7 +107,7 @@ class MessageBoxMenu : Menu
|
|||
override void Drawer ()
|
||||
{
|
||||
int i, y;
|
||||
int fontheight = textFont.GetHeight();
|
||||
int fontheight = textFont.GetHeight() * NotifyFontScale;
|
||||
|
||||
y = destHeight / 2;
|
||||
|
||||
|
@ -116,7 +116,8 @@ class MessageBoxMenu : Menu
|
|||
|
||||
for (i = 0; i < c; i++)
|
||||
{
|
||||
screen.DrawText (textFont, Font.CR_UNTRANSLATED, destWidth/2 - mMessage.StringWidth(i)/2, y, mMessage.StringAt(i), DTA_VirtualWidth, destWidth, DTA_VirtualHeight, destHeight, DTA_KeepRatio, true);
|
||||
screen.DrawText (textFont, Font.CR_UNTRANSLATED, destWidth/2 - mMessage.StringWidth(i)*NotifyFontScale/2, y, mMessage.StringAt(i), DTA_VirtualWidth, destWidth, DTA_VirtualHeight, destHeight, DTA_KeepRatio, true,
|
||||
DTA_ScaleX, NotifyFontScale, DTA_ScaleY, NotifyFontScale);
|
||||
y += fontheight;
|
||||
}
|
||||
|
||||
|
@ -124,8 +125,8 @@ class MessageBoxMenu : Menu
|
|||
{
|
||||
y += fontheight;
|
||||
mMouseY = y;
|
||||
screen.DrawText(textFont, messageSelection == 0? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor, destWidth / 2, y, Stringtable.Localize("$TXT_YES"), DTA_VirtualWidth, destWidth, DTA_VirtualHeight, destHeight, DTA_KeepRatio, true);
|
||||
screen.DrawText(textFont, messageSelection == 1? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor, destWidth / 2, y + fontheight, Stringtable.Localize("$TXT_NO"), DTA_VirtualWidth, destWidth, DTA_VirtualHeight, destHeight, DTA_KeepRatio, true);
|
||||
screen.DrawText(textFont, messageSelection == 0? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor, destWidth / 2, y, Stringtable.Localize("$TXT_YES"), DTA_VirtualWidth, destWidth, DTA_VirtualHeight, destHeight, DTA_KeepRatio, true, DTA_ScaleX, NotifyFontScale, DTA_ScaleY, NotifyFontScale);
|
||||
screen.DrawText(textFont, messageSelection == 1? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor, destWidth / 2, y + fontheight, Stringtable.Localize("$TXT_NO"), DTA_VirtualWidth, destWidth, DTA_VirtualHeight, destHeight, DTA_KeepRatio, true, DTA_ScaleX, NotifyFontScale, DTA_ScaleY, NotifyFontScale);
|
||||
|
||||
if (messageSelection >= 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue