mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 00:42:08 +00:00
- SW's caption done, too.
In this case the font is squashed to be more narrow because otherwise many texts would not fit anymore.
This commit is contained in:
parent
5bcb72f7a9
commit
17a68bc60a
5 changed files with 31 additions and 2 deletions
|
@ -1131,9 +1131,10 @@ void SetDefaultMenuColors()
|
|||
{
|
||||
OptionSettings.mFontColorHeader = CR_DARKRED;
|
||||
OptionSettings.mFontColorHighlight = CR_WHITE;
|
||||
cls = PClass::FindClass("MenuCustomizerSW");
|
||||
}
|
||||
else if (g_gameType & GAMEFLAG_PSEXHUMED)
|
||||
{
|
||||
{
|
||||
OptionSettings.mFontColorHeader = CR_LIGHTBLUE;
|
||||
OptionSettings.mFontColorHighlight = CR_SAPPHIRE;
|
||||
OptionSettings.mFontColor = CR_GOLD;
|
||||
|
|
|
@ -240,6 +240,7 @@ void GameInterface::app_init()
|
|||
LoadCustomInfoFromScript("swcustom.txt"); // Load user customisation information
|
||||
|
||||
LoadDefinitions();
|
||||
SetTileNames();
|
||||
TileFiles.SetBackup();
|
||||
userConfig.AddDefs.reset();
|
||||
InitFX();
|
||||
|
|
|
@ -23,4 +23,5 @@ version "4.3"
|
|||
|
||||
#include "zscript/games/duke/ui/menu.zs"
|
||||
#include "zscript/games/blood/ui/menu.zs"
|
||||
#include "zscript/games/sw/ui/menu.zs"
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ class MenuCustomizerBlood : MenuCustomize
|
|||
double fx, fy, fw, fh;
|
||||
[fx, fy, fw, fh] = Screen.GetFullscreenRect(320, 200, FSMode_ScaleToFit43Top);
|
||||
int h = texid.isValid()? texsize.Y : fonth;
|
||||
Console.Printf("%f, %f, %d", texsize.Y, fh, int((h)*fh / 200));
|
||||
return int((y+h) * fh / 200); // This must be the covered height of the header in true pixels.
|
||||
}
|
||||
}
|
||||
|
|
27
wadsrc/static/zscript/games/sw/ui/menu.zs
Normal file
27
wadsrc/static/zscript/games/sw/ui/menu.zs
Normal file
|
@ -0,0 +1,27 @@
|
|||
|
||||
class MenuCustomizerSW : MenuCustomize
|
||||
{
|
||||
override int DrawCaption(String title, Font fnt, int y, bool drawit)
|
||||
{
|
||||
let font = generic_ui? NewConsoleFont : BigFont; // this ignores the passed font intentionally.
|
||||
let texid = TexMan.CheckForTexture("MENUBAR");
|
||||
let texsize = TexMan.GetScaledSize(texid);
|
||||
let fonth = font.GetGlyphHeight("A");
|
||||
let fontscale = 0.7; // at full 1.0 scale the font is too large
|
||||
if (drawit)
|
||||
{
|
||||
int width = font.StringWidth(title) * fontscale;
|
||||
if (texid.isValid())
|
||||
{
|
||||
double scalex = 1.; // Expand the box if the text is longer
|
||||
if (texsize.X - 60 < width) scalex = width / (texsize.X - 60);
|
||||
screen.DrawTexture(texid, false, 160, 20, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_CenterOffsetRel, true, DTA_ScaleX, scalex);
|
||||
}
|
||||
screen.DrawText(font, Font.CR_UNTRANSLATED, 160 - width / 2, 22 - fonth / 2, title, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_ScaleX, fontscale);
|
||||
}
|
||||
double fx, fy, fw, fh;
|
||||
[fx, fy, fw, fh] = Screen.GetFullscreenRect(320, 200, FSMode_ScaleToFit43Top);
|
||||
int h = texid.isValid()? texsize.Y : fonth;
|
||||
return int((y+h) * fh / 200); // This must be the covered height of the header in true pixels.
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue