diff --git a/src/c_bind.cpp b/src/c_bind.cpp index 0427d5c45..14e2f5e05 100644 --- a/src/c_bind.cpp +++ b/src/c_bind.cpp @@ -46,6 +46,7 @@ #include "vm.h" #include "i_time.h" #include "menu/menu.h" +#include "v_text.h" const char *KeyNames[NUM_KEYS] = { @@ -297,7 +298,7 @@ void C_NameKeys (char *str, int first, int second) c++; strcpy (str, KeyName (first)); if (second) - strcat (str, " or "); + strcat (str, TEXTCOLOR_BLACK ", " TEXTCOLOR_NORMAL); } if (second) diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index aa0af97b3..3f927a54f 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -1243,10 +1243,12 @@ CCMD(secret) FString levelname; level_info_t *info = FindLevelInfo(mapname); const char *ln = !(info->flags & LEVEL_LOOKUPLEVELNAME)? info->LevelName.GetChars() : GStrings[info->LevelName.GetChars()]; - levelname.Format("%s - %s\n", mapname, ln); - size_t llen = levelname.Len() - 1; + levelname.Format("%s - %s", mapname, ln); + Printf(TEXTCOLOR_YELLOW "%s\n", levelname.GetChars()); + size_t llen = levelname.Len(); + levelname = ""; for(size_t ii=0; iiNext; -} - -void DequeueConsoleText () -{ - TextQueue *queued = EnqueuedText; - - while (queued != NULL) - { - TextQueue *next = queued->Next; - if (queued->bNotify) - { - NotifyStrings.AddString(queued->PrintLevel, queued->Text); - } - else - { - AddToConsole (queued->PrintLevel, queued->Text); - } - delete queued; - queued = next; - } - EnqueuedText = NULL; - EnqueuedTextTail = &EnqueuedText; -} - EColorRange C_GetDefaultFontColor() { // Ideally this should analyze the SmallFont and pick a matching color. @@ -827,15 +782,9 @@ void FNotifyBuffer::AddString(int printlevel, FString source) con_notifylines == 0) return; - if (ConsoleDrawing) - { - EnqueueConsoleText (true, printlevel, source); - return; - } - width = DisplayWidth / active_con_scaletext(con_consolefont); - FFont *font = *con_consolefont ? NewConsoleFont : SmallFont; + FFont *font = *con_consolefont ? NewSmallFont : SmallFont; if (AddType == APPENDLINE && Text.Size() > 0 && Text[Text.Size() - 1].PrintLevel == printlevel) { @@ -888,11 +837,51 @@ void FNotifyBuffer::AddString(int printlevel, FString source) void AddToConsole (int printlevel, const char *text) { - conbuffer->AddText(printlevel, MakeUTF8(text), Logfile); + conbuffer->AddText(printlevel, MakeUTF8(text)); } -int PrintString (int printlevel, const char *outline) +//========================================================================== +// +// +// +//========================================================================== + +void WriteLineToLog(FILE *LogFile, const char *outline) { + // Strip out any color escape sequences before writing to the log file + TArray copy(strlen(outline) + 1); + const char * srcp = outline; + char * dstp = copy.Data(); + + while (*srcp != 0) + { + + if (*srcp != TEXTCOLOR_ESCAPE) + { + *dstp++ = *srcp++; + } + else if (srcp[1] == '[') + { + srcp += 2; + while (*srcp != ']' && *srcp != 0) srcp++; + if (*srcp == ']') srcp++; + } + else + { + if (srcp[1] != 0) srcp += 2; + else break; + } + } + *dstp = 0; + + fputs(copy.Data(), LogFile); + fflush(LogFile); +} + + +int PrintString (int iprintlevel, const char *outline) +{ + int printlevel = iprintlevel & PRINT_TYPES; if (printlevel < msglevel || *outline == '\0') { return 0; @@ -907,16 +896,15 @@ int PrintString (int printlevel, const char *outline) { I_PrintStr(outline); - conbuffer->AddText(printlevel, outline, Logfile); - if (vidactive && screen && SmallFont) + conbuffer->AddText(printlevel, outline); + if (vidactive && screen && SmallFont && !(iprintlevel & PRINT_NONOTIFY)) { NotifyStrings.AddString(printlevel, outline); } } - else if (Logfile != nullptr) + if (Logfile != nullptr && !(iprintlevel & PRINT_NOLOG)) { - fputs(outline, Logfile); - fflush(Logfile); + WriteLineToLog(Logfile, outline); } return count; } @@ -1079,7 +1067,7 @@ void FNotifyBuffer::Draw() line = Top; canskip = true; - FFont *font = *con_consolefont ? NewConsoleFont : SmallFont; + FFont *font = *con_consolefont ? NewSmallFont : SmallFont; lineadv = font->GetHeight (); for (unsigned i = 0; i < Text.Size(); ++ i) @@ -1220,8 +1208,6 @@ void C_DrawConsole () int bottomline = ConBottom / textScale - CurrentConsoleFont->GetHeight()*2 - 4; - ConsoleDrawing = true; - for(FBrokenLines *p = printline; p >= blines && lines > 0; p--, lines--) { if (textScale == 1) @@ -1237,8 +1223,6 @@ void C_DrawConsole () } } - ConsoleDrawing = false; - if (ConBottom >= 20) { if (gamestate != GS_STARTUP) @@ -1758,33 +1742,25 @@ CCMD (echo) /* Printing in the middle of the screen */ -CVAR (Float, con_midtime, 3.f, CVAR_ARCHIVE) +CVAR(Float, con_midtime, 3.f, CVAR_ARCHIVE) -static const char bar1[] = TEXTCOLOR_RED "\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36" - "\36\36\36\36\36\36\36\36\36\36\36\36\37" TEXTCOLOR_TAN "\n"; -static const char bar2[] = TEXTCOLOR_RED "\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36" - "\36\36\36\36\36\36\36\36\36\36\36\36\37" TEXTCOLOR_GREEN "\n"; -static const char bar3[] = TEXTCOLOR_RED "\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36" - "\36\36\36\36\36\36\36\36\36\36\36\36\37" TEXTCOLOR_NORMAL "\n"; +const char *console_bar = "----------------------------------------"; -void C_MidPrint (FFont *font, const char *msg) +void C_MidPrint (FFont *font, const char *msg, bool bold) { - if (StatusBar == NULL || screen == NULL) + if (StatusBar == nullptr || screen == nullptr) return; - if (msg != NULL) + if (msg != nullptr) { - AddToConsole (-1, bar1); - AddToConsole (-1, msg); - AddToConsole (-1, bar3); - - auto color = (EColorRange)PrintColors[PRINTLEVELS]; + auto color = (EColorRange)PrintColors[bold? PRINTLEVELS+1 : PRINTLEVELS]; + Printf(PRINT_NONOTIFY, TEXTCOLOR_ESCAPESTR "%c%s\n%s\n%s\n", color, console_bar, msg, console_bar); bool altscale = false; if (font == nullptr) { altscale = con_midconsolefont; - font = altscale ? NewConsoleFont : SmallFont; + font = altscale ? NewSmallFont : SmallFont; if (altscale && color == CR_UNTRANSLATED) color = C_GetDefaultFontColor(); } @@ -1797,32 +1773,6 @@ void C_MidPrint (FFont *font, const char *msg) } } -void C_MidPrintBold (FFont *font, const char *msg) -{ - if (msg) - { - AddToConsole (-1, bar2); - AddToConsole (-1, msg); - AddToConsole (-1, bar3); - - auto color = (EColorRange)PrintColors[PRINTLEVELS+1]; - bool altscale = false; - if (font == nullptr) - { - altscale = con_midconsolefont; - font = altscale ? NewConsoleFont : SmallFont; - if (altscale && color == CR_UNTRANSLATED) color = C_GetDefaultFontColor(); - } - - StatusBar->AttachMessage (Create (font, msg, 1.5f, 0.375f, 0, 0, - color, con_midtime, altscale), MAKE_ID('C','N','T','R')); - } - else - { - StatusBar->DetachMessage (MAKE_ID('C','N','T','R')); - } -} - DEFINE_ACTION_FUNCTION(_Console, MidPrint) { PARAM_PROLOGUE; @@ -1831,8 +1781,7 @@ DEFINE_ACTION_FUNCTION(_Console, MidPrint) PARAM_BOOL(bold); const char *txt = text[0] == '$'? GStrings(&text[1]) : text.GetChars(); - if (!bold) C_MidPrint(fnt, txt); - else C_MidPrintBold(fnt, txt); + C_MidPrint(fnt, txt, bold); return 0; } diff --git a/src/c_console.h b/src/c_console.h index 41fcd1eb0..276c8b793 100644 --- a/src/c_console.h +++ b/src/c_console.h @@ -78,8 +78,7 @@ void C_AdjustBottom (void); void C_FlushDisplay (void); class FFont; -void C_MidPrint (FFont *font, const char *message); -void C_MidPrintBold (FFont *font, const char *message); +void C_MidPrint (FFont *font, const char *message, bool bold = false); bool C_Responder (event_t *ev); @@ -87,4 +86,6 @@ void C_AddTabCommand (const char *name); void C_RemoveTabCommand (const char *name); void C_ClearTabCommands(); // Removes all tab commands +extern const char *console_bar; + #endif diff --git a/src/c_consolebuffer.cpp b/src/c_consolebuffer.cpp index 0d0d0bc03..2c8f99de0 100644 --- a/src/c_consolebuffer.cpp +++ b/src/c_consolebuffer.cpp @@ -55,33 +55,6 @@ FConsoleBuffer::FConsoleBuffer() mBrokenStart.Push(0); } -//========================================================================== -// -// -// -//========================================================================== - -FConsoleBuffer::~FConsoleBuffer() -{ - FreeBrokenText(); -} - -//========================================================================== -// -// -// -//========================================================================== - -void FConsoleBuffer::FreeBrokenText(unsigned start, unsigned end) -{ - if (end > m_BrokenConsoleText.Size()) end = m_BrokenConsoleText.Size(); - for (unsigned i = start; i < end; i++) - { - m_BrokenConsoleText[i].Clear(); - m_BrokenConsoleText[i].ShrinkToFit(); - } -} - //========================================================================== // // Adds a new line of text to the console @@ -95,7 +68,7 @@ void FConsoleBuffer::FreeBrokenText(unsigned start, unsigned end) // //========================================================================== -void FConsoleBuffer::AddText(int printlevel, const char *text, FILE *logfile) +void FConsoleBuffer::AddText(int printlevel, const char *text) { FString build = TEXTCOLOR_TAN; @@ -135,117 +108,9 @@ void FConsoleBuffer::AddText(int printlevel, const char *text, FILE *logfile) mAddType = APPENDLINE; } - // don't bother about linefeeds etc. inside the text, we'll let the formatter sort this out later. + // don't bother with linefeeds etc. inside the text, we'll let the formatter sort this out later. build.AppendCStrPart(text, textsize); mConsoleText.Push(build); - if (logfile != NULL) WriteLineToLog(logfile, text); -} - -//========================================================================== -// -// -// -//========================================================================== - -void FConsoleBuffer::WriteLineToLog(FILE *LogFile, const char *outline) -{ - // Strip out any color escape sequences before writing to the log file - TArray copy(strlen(outline)+1); - const char * srcp = outline; - char * dstp = copy.Data(); - - while (*srcp != 0) - { - - if (*srcp != TEXTCOLOR_ESCAPE) - { - switch (*srcp) - { - case '\35': - *dstp++ = '<'; - break; - - case '\36': - *dstp++ = '-'; - break; - - case '\37': - *dstp++ = '>'; - break; - - default: - *dstp++=*srcp; - break; - } - srcp++; - } - else if (srcp[1] == '[') - { - srcp+=2; - while (*srcp != ']' && *srcp != 0) srcp++; - if (*srcp == ']') srcp++; - } - else - { - if (srcp[1]!=0) srcp+=2; - else break; - } - } - *dstp=0; - - fputs (copy.Data(), LogFile); - fflush (LogFile); -} - -//========================================================================== -// -// -// -//========================================================================== - -void FConsoleBuffer::WriteContentToLog(FILE *LogFile) -{ - if (LogFile != NULL) - { - for (unsigned i = 0; i < mConsoleText.Size(); i++) - { - WriteLineToLog(LogFile, mConsoleText[i]); - } - } -} - -//========================================================================== -// -// ensures that the following text is not appended to the current line. -// -//========================================================================== - -void FConsoleBuffer::Linefeed(FILE *Logfile) -{ - if (mAddType != NEWLINE && Logfile != NULL) fputc('\n', Logfile); - mAddType = NEWLINE; -} - -//========================================================================== -// -// -// -//========================================================================== - -static const char bar1[] = TEXTCOLOR_RED "\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36" - "\36\36\36\36\36\36\36\36\36\36\36\36\37" TEXTCOLOR_TAN "\n"; -static const char bar2[] = TEXTCOLOR_RED "\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36" - "\36\36\36\36\36\36\36\36\36\36\36\36\37" TEXTCOLOR_GREEN "\n"; -static const char bar3[] = TEXTCOLOR_RED "\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36" - "\36\36\36\36\36\36\36\36\36\36\36\36\37" TEXTCOLOR_NORMAL "\n"; - -void FConsoleBuffer::AddMidText(const char *string, bool bold, FILE *Logfile) -{ - Linefeed(Logfile); - AddText (-1, bold? bar2 : bar1, Logfile); - AddText (-1, string, Logfile); - Linefeed(Logfile); - AddText(-1, bar3, Logfile); } //========================================================================== @@ -258,7 +123,6 @@ void FConsoleBuffer::FormatText(FFont *formatfont, int displaywidth) { if (formatfont != mLastFont || displaywidth != mLastDisplayWidth || mBufferWasCleared) { - FreeBrokenText(); m_BrokenConsoleText.Clear(); mBrokenStart.Clear(); mBrokenStart.Push(0); diff --git a/src/c_consolebuffer.h b/src/c_consolebuffer.h index 1b46156b2..98a42b42e 100644 --- a/src/c_consolebuffer.h +++ b/src/c_consolebuffer.h @@ -61,19 +61,12 @@ class FConsoleBuffer int mLastDisplayWidth; bool mLastLineNeedsUpdate; - void WriteLineToLog(FILE *LogFile, const char *outline); - void FreeBrokenText(unsigned int start = 0, unsigned int end = INT_MAX); - - void Linefeed(FILE *Logfile); public: FConsoleBuffer(); - ~FConsoleBuffer(); - void AddText(int printlevel, const char *string, FILE *logfile = NULL); - void AddMidText(const char *string, bool bold, FILE *logfile); + void AddText(int printlevel, const char *string); void FormatText(FFont *formatfont, int displaywidth); void ResizeBuffer(unsigned newsize); - void WriteContentToLog(FILE *logfile); void Clear() { mBufferWasCleared = true; diff --git a/src/d_main.cpp b/src/d_main.cpp index ebb17e3d6..6cc176a3b 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1292,6 +1292,7 @@ void D_DoAdvanceDemo (void) } else { + singledemo = false; G_DeferedPlayDemo (demoname); demosequence = 2; break; diff --git a/src/d_player.h b/src/d_player.h index 4eae01926..d52e35979 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -250,8 +250,8 @@ struct userinfo_t : TMap } int GetGender() const { - auto cvar = static_cast(*CheckKey(NAME_Gender)); - return cvar? *cvar : 0; + auto cvar = CheckKey(NAME_Gender); + return cvar ? *static_cast(*cvar) : 0; } bool GetNoAutostartMap() const { diff --git a/src/doomtype.h b/src/doomtype.h index a5f38e2d0..47a636552 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -89,7 +89,10 @@ enum PRINT_CHAT, // chat messages PRINT_TEAMCHAT, // chat messages from a teammate PRINT_LOG, // only to logfile - PRINT_BOLD = 200 // What Printf_Bold used + PRINT_BOLD = 200, // What Printf_Bold used + PRINT_TYPES = 1023, // Bitmask. + PRINT_NONOTIFY = 1024, // Flag - do not add to notify buffer + PRINT_NOLOG = 2048, // Flag - do not print to log file }; enum diff --git a/src/fragglescript/t_func.cpp b/src/fragglescript/t_func.cpp index c53bade0e..c0804ffba 100644 --- a/src/fragglescript/t_func.cpp +++ b/src/fragglescript/t_func.cpp @@ -573,7 +573,7 @@ void FParser::SF_Include(void) void FParser::SF_Input(void) { - Printf(PRINT_BOLD,"input() function not available in doom\n"); + Printf(PRINT_BOLD,"input() function not available in Doom\n"); } //========================================================================== diff --git a/src/g_cvars.cpp b/src/g_cvars.cpp index 560effae7..433b88888 100644 --- a/src/g_cvars.cpp +++ b/src/g_cvars.cpp @@ -51,6 +51,9 @@ CVAR(Int, developer, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) // [RH] Feature control cvars CVAR(Bool, var_friction, true, CVAR_SERVERINFO); +// Option Search +CVAR(Bool, os_isanyof, true, CVAR_ARCHIVE); + @@ -131,7 +134,6 @@ CUSTOM_CVAR(Float, teamdamage, 0.f, CVAR_SERVERINFO | CVAR_NOINITCALL) CUSTOM_CVAR(String, language, "auto", CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG) { - SetLanguageIDs(); GStrings.UpdateLanguage(); for (auto Level : AllLevels()) { @@ -139,4 +141,3 @@ CUSTOM_CVAR(String, language, "auto", CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOB if (Level->info != nullptr) Level->LevelName = Level->info->LookupLevelName(); } } - diff --git a/src/g_game.cpp b/src/g_game.cpp index 6018628e9..cfdfc2a45 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -2727,7 +2727,7 @@ void G_DoPlayDemo (void) } demo_p = demobuffer; - Printf ("Playing demo %s\n", defdemoname.GetChars()); + if (singledemo) Printf ("Playing demo %s\n", defdemoname.GetChars()); C_BackupCVars (); // [RH] Save cvars that might be affected by demo @@ -2744,7 +2744,7 @@ void G_DoPlayDemo (void) } else { - Printf (PRINT_BOLD, "%s", eek); + //Printf (PRINT_BOLD, "%s", eek); gameaction = ga_nothing; } } diff --git a/src/g_level.cpp b/src/g_level.cpp index 66a8b9c57..6f90326b3 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1062,12 +1062,8 @@ void FLevelLocals::DoLoadLevel(const FString &nextmapname, int position, bool au if (isPrimaryLevel()) { FString mapname = nextmapname; - mapname.ToLower(); - Printf( - "\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36" - "\36\36\36\36\36\36\36\36\36\36\36\36\37\n\n" - TEXTCOLOR_BOLD "%s - %s\n\n", - mapname.GetChars(), LevelName.GetChars()); + mapname.ToUpper(); + Printf("\n%s\n\n" TEXTCOLOR_BOLD "%s - %s\n\n", console_bar, mapname.GetChars(), LevelName.GetChars()); } // Set the sky map. diff --git a/src/g_statusbar/shared_hud.cpp b/src/g_statusbar/shared_hud.cpp index 998d3f514..7a3350c46 100644 --- a/src/g_statusbar/shared_hud.cpp +++ b/src/g_statusbar/shared_hud.cpp @@ -55,6 +55,7 @@ CVAR(Int,hud_althudscale, 0, CVAR_ARCHIVE) // Scale the hud to 640x400? CVAR(Bool,hud_althud, false, CVAR_ARCHIVE) // Enable/Disable the alternate HUD +CVAR(Bool, hud_althudfont, false, CVAR_ARCHIVE) // Enable/Disable the alternate HUD // These are intentionally not the same as in the automap! CVAR (Bool, hud_showsecrets, true,CVAR_ARCHIVE); // Show secrets on HUD CVAR (Bool, hud_showmonsters, true,CVAR_ARCHIVE); // Show monster stats on HUD diff --git a/src/gamedata/fonts/hexfont.cpp b/src/gamedata/fonts/hexfont.cpp index 4567cc324..2980af2c9 100644 --- a/src/gamedata/fonts/hexfont.cpp +++ b/src/gamedata/fonts/hexfont.cpp @@ -42,6 +42,51 @@ #include "fontinternals.h" + +struct HexDataSource +{ + int FirstChar = INT_MAX, LastChar = INT_MIN; + TArray glyphdata; + unsigned glyphmap[65536] = {}; + + //========================================================================== + // + // parse a HEX font + // + //========================================================================== + + void ParseDefinition(int lumpnum) + { + FScanner sc; + + sc.OpenLumpNum(lumpnum); + sc.SetCMode(true); + glyphdata.Push(0); // ensure that index 0 can be used as 'not present'. + while (sc.GetString()) + { + int codepoint = (int)strtoull(sc.String, nullptr, 16); + sc.MustGetStringName(":"); + sc.MustGetString(); + if (codepoint >= 0 && codepoint < 65536 && !sc.Compare("00000000000000000000000000000000")) // don't set up empty glyphs. + { + unsigned size = (unsigned)strlen(sc.String); + unsigned offset = glyphdata.Reserve(size / 2 + 1); + glyphmap[codepoint] = offset; + glyphdata[offset++] = size / 2; + for (unsigned i = 0; i < size; i += 2) + { + char hex[] = { sc.String[i], sc.String[i + 1], 0 }; + glyphdata[offset++] = (uint8_t)strtoull(hex, nullptr, 16); + } + if (codepoint < FirstChar) FirstChar = codepoint; + if (codepoint > LastChar) LastChar = codepoint; + } + } + } +}; + +static HexDataSource hexdata; + // This is a font character that reads RLE compressed data. class FHexFontChar : public FImageSource { @@ -113,51 +158,78 @@ TArray FHexFontChar::CreatePalettedPixels(int) return Pixels; } +class FHexFontChar2 : public FHexFontChar +{ +public: + FHexFontChar2(uint8_t *sourcedata, int swidth, int width, int height); + + TArray CreatePalettedPixels(int conversion) override; +}; + + +//========================================================================== +// +// FHexFontChar :: FHexFontChar +// +// Used by HEX fonts. +// +//========================================================================== + +FHexFontChar2::FHexFontChar2(uint8_t *sourcedata, int swidth, int width, int height) + : FHexFontChar(sourcedata, swidth, width, height) +{ +} + +//========================================================================== +// +// FHexFontChar :: Get8BitPixels +// +// The render style has no relevance here. +// +//========================================================================== + +TArray FHexFontChar2::CreatePalettedPixels(int) +{ + int destSize = Width * Height; + TArray Pixels(destSize, true); + uint8_t *dest_p = Pixels.Data(); + + auto drawLayer = [&](int ix, int iy, int color) + { + const uint8_t *src_p = SourceData; + for (int y = 0; y < Height-2; y++) + { + for (int x = 0; x < SourceWidth; x++) + { + int byte = *src_p++; + uint8_t *pixelstart = dest_p + (ix + 8 * x) * Height + (iy+y); + for (int bit = 0; bit < 8; bit++) + { + if (byte & (128 >> bit)) + { + pixelstart[bit*Height] = color; + } + } + } + } + }; + memset(dest_p, 0, destSize); + + const int darkcolor = 3; + const int brightcolor = 14; + for (int xx=0;xx<3;xx++) for (int yy=0;yy<3;yy++) if (xx !=1 || yy != 1) + drawLayer(xx, yy, darkcolor); + drawLayer(1, 1, brightcolor); + + return Pixels; +} + class FHexFont : public FFont { - TArray glyphdata; - unsigned glyphmap[65536] = {}; public: - //========================================================================== - // - // parse a HEX font - // - //========================================================================== - - void ParseDefinition(int lumpnum) - { - FScanner sc; - - FirstChar = INT_MAX; - LastChar = INT_MIN; - sc.OpenLumpNum(lumpnum); - sc.SetCMode(true); - glyphdata.Push(0); // ensure that index 0 can be used as 'not present'. - while (sc.GetString()) - { - int codepoint = (int)strtoull(sc.String, nullptr, 16); - sc.MustGetStringName(":"); - sc.MustGetString(); - if (codepoint >= 0 && codepoint < 65536 && !sc.Compare("00000000000000000000000000000000")) // don't set up empty glyphs. - { - unsigned size = (unsigned)strlen(sc.String); - unsigned offset = glyphdata.Reserve(size/2 + 1); - glyphmap[codepoint] = offset; - glyphdata[offset++] = size / 2; - for(unsigned i = 0; i < size; i+=2) - { - char hex[] = { sc.String[i], sc.String[i+1], 0 }; - glyphdata[offset++] = (uint8_t)strtoull(hex, nullptr, 16); - } - if (codepoint < FirstChar) FirstChar = codepoint; - if (codepoint > LastChar) LastChar = codepoint; - } - } - } - //========================================================================== // // FHexFont :: FHexFont @@ -173,7 +245,8 @@ public: FontName = fontname; - ParseDefinition(lump); + FirstChar = hexdata.FirstChar; + LastChar = hexdata.LastChar; Next = FirstFont; FirstFont = this; @@ -208,11 +281,11 @@ public: Chars.Resize(LastChar - FirstChar + 1); for (int i = FirstChar; i <= LastChar; i++) { - if (glyphmap[i] > 0) + if (hexdata.glyphmap[i] > 0) { - auto offset = glyphmap[i]; - int size = glyphdata[offset] / 16; - Chars[i - FirstChar].TranslatedPic = new FImageTexture(new FHexFontChar (&glyphdata[offset+1], size, size * 9, 16)); + auto offset = hexdata.glyphmap[i]; + int size = hexdata.glyphdata[offset] / 16; + Chars[i - FirstChar].TranslatedPic = new FImageTexture(new FHexFontChar (&hexdata.glyphdata[offset+1], size, size * 9, 16)); Chars[i - FirstChar].TranslatedPic->SetUseType(ETextureType::FontChar); Chars[i - FirstChar].XMove = size * spacing; TexMan.AddTexture(Chars[i - FirstChar].TranslatedPic); @@ -226,6 +299,79 @@ public: }; +class FHexFont2 : public FFont +{ + +public: + //========================================================================== + // + // FHexFont :: FHexFont + // + // Loads a HEX font + // + //========================================================================== + + FHexFont2(const char *fontname, int lump) + : FFont(lump) + { + assert(lump >= 0); + + FontName = fontname; + + FirstChar = hexdata.FirstChar; + LastChar = hexdata.LastChar; + + Next = FirstFont; + FirstFont = this; + FontHeight = 18; + SpaceWidth = 10; + GlobalKerning = -1; + translateUntranslated = true; + + LoadTranslations(); + } + + //========================================================================== + // + // FHexFont :: LoadTranslations + // + //========================================================================== + + void LoadTranslations() + { + const int spacing = 9; + double luminosity[256]; + + memset(PatchRemap, 0, 256); + for (int i = 0; i < 18; i++) + { + // Create a gradient similar to the old console font. + PatchRemap[i] = i; + luminosity[i] = i / 17.; + } + ActiveColors = 18; + + Chars.Resize(LastChar - FirstChar + 1); + for (int i = FirstChar; i <= LastChar; i++) + { + if (hexdata.glyphmap[i] > 0) + { + auto offset = hexdata.glyphmap[i]; + int size = hexdata.glyphdata[offset] / 16; + Chars[i - FirstChar].TranslatedPic = new FImageTexture(new FHexFontChar2(&hexdata.glyphdata[offset + 1], size, 2 + size * 8, 18)); + Chars[i - FirstChar].TranslatedPic->SetUseType(ETextureType::FontChar); + Chars[i - FirstChar].XMove = size * spacing; + TexMan.AddTexture(Chars[i - FirstChar].TranslatedPic); + } + else Chars[i - FirstChar].XMove = spacing; + + } + BuildTranslations(luminosity, nullptr, &TranslationParms[0][0], ActiveColors, nullptr); + } + +}; + + //========================================================================== // // @@ -234,5 +380,18 @@ public: FFont *CreateHexLumpFont (const char *fontname, int lump) { + if (hexdata.FirstChar == INT_MAX) hexdata.ParseDefinition(lump); return new FHexFont(fontname, lump); } + +//========================================================================== +// +// +// +//========================================================================== + +FFont *CreateHexLumpFont2(const char *fontname, int lump) +{ + if (hexdata.FirstChar == INT_MAX) hexdata.ParseDefinition(lump); + return new FHexFont2(fontname, lump); +} diff --git a/src/gamedata/fonts/v_font.cpp b/src/gamedata/fonts/v_font.cpp index 0ed18de51..d05dd93f6 100644 --- a/src/gamedata/fonts/v_font.cpp +++ b/src/gamedata/fonts/v_font.cpp @@ -1449,10 +1449,12 @@ void V_InitFonts() V_InitCustomFonts(); FFont *CreateHexLumpFont(const char *fontname, int lump); + FFont *CreateHexLumpFont2(const char *fontname, int lump); auto lump = Wads.CheckNumForFullName("newconsolefont.hex", 0); // This is always loaded from gzdoom.pk3 to prevent overriding it with incomplete replacements. if (lump == -1) I_FatalError("newconsolefont.hex not found"); // This font is needed - do not start up without it. NewConsoleFont = CreateHexLumpFont("NewConsoleFont", lump); + NewSmallFont = CreateHexLumpFont2("NewSmallFont", lump); CurrentConsoleFont = NewConsoleFont; // load the heads-up font @@ -1540,6 +1542,6 @@ void V_ClearFonts() delete FFont::FirstFont; } FFont::FirstFont = nullptr; - CurrentConsoleFont = NewConsoleFont = SmallFont = SmallFont2 = BigFont = ConFont = IntermissionFont = nullptr; + CurrentConsoleFont = NewSmallFont = NewConsoleFont = SmallFont = SmallFont2 = BigFont = ConFont = IntermissionFont = nullptr; } diff --git a/src/gamedata/fonts/v_font.h b/src/gamedata/fonts/v_font.h index 8ba1debc6..a26b72044 100644 --- a/src/gamedata/fonts/v_font.h +++ b/src/gamedata/fonts/v_font.h @@ -164,7 +164,7 @@ protected: }; -extern FFont *SmallFont, *SmallFont2, *BigFont, *BigUpper, *ConFont, *IntermissionFont, *NewConsoleFont, *CurrentConsoleFont; +extern FFont *SmallFont, *SmallFont2, *BigFont, *BigUpper, *ConFont, *IntermissionFont, *NewConsoleFont, *NewSmallFont, *CurrentConsoleFont; void V_InitFonts(); void V_ClearFonts(); diff --git a/src/gamedata/fonts/v_text.cpp b/src/gamedata/fonts/v_text.cpp index 76afe04ae..ac176e12a 100644 --- a/src/gamedata/fonts/v_text.cpp +++ b/src/gamedata/fonts/v_text.cpp @@ -75,6 +75,9 @@ TArray V_BreakLines (FFont *font, int maxwidth, const uint8_t *str bool lastWasSpace = false; int kerning = font->GetDefaultKerning (); + // The real isspace is a bit too badly defined, so use our own one + auto myisspace = [](int ch) { return ch == '\t' || ch == '\r' || ch == '\n' || ch == ' '; }; + w = 0; while ( (c = GetCharFromString(string)) ) @@ -104,7 +107,7 @@ TArray V_BreakLines (FFont *font, int maxwidth, const uint8_t *str continue; } - if (iswspace(c)) + if (myisspace(c)) { if (!lastWasSpace) { @@ -137,12 +140,12 @@ TArray V_BreakLines (FFont *font, int maxwidth, const uint8_t *str start = space; space = NULL; - while (*start && iswspace (*start) && *start != '\n') + while (*start && myisspace (*start) && *start != '\n') start++; if (*start == '\n') start++; else - while (*start && iswspace (*start)) + while (*start && myisspace (*start)) start++; string = start; } @@ -160,7 +163,7 @@ TArray V_BreakLines (FFont *font, int maxwidth, const uint8_t *str while (s < string) { // If there is any non-white space in the remainder of the string, add it. - if (!iswspace (*s++)) + if (!myisspace (*s++)) { auto i = Lines.Reserve(1); breakit (&Lines[i], font, start, string, linecolor); diff --git a/src/gamedata/fonts/v_text.h b/src/gamedata/fonts/v_text.h index 90c38d44c..365674b52 100644 --- a/src/gamedata/fonts/v_text.h +++ b/src/gamedata/fonts/v_text.h @@ -44,6 +44,7 @@ struct FBrokenLines }; #define TEXTCOLOR_ESCAPE '\034' +#define TEXTCOLOR_ESCAPESTR "\034" #define TEXTCOLOR_BRICK "\034A" #define TEXTCOLOR_TAN "\034B" diff --git a/src/gamedata/gi.cpp b/src/gamedata/gi.cpp index ebced3c7c..f80d80749 100644 --- a/src/gamedata/gi.cpp +++ b/src/gamedata/gi.cpp @@ -397,6 +397,7 @@ void FMapInfoParser::ParseGameInfo() GAMEINFOKEY_BOOL(dontcrunchcorpses, "dontcrunchcorpses") GAMEINFOKEY_BOOL(correctprintbold, "correctprintbold") GAMEINFOKEY_BOOL(forcetextinmenus, "forcetextinmenus") + GAMEINFOKEY_BOOL(forcenogfxsubstitution, "forcenogfxsubstitution") GAMEINFOKEY_BOOL(intermissioncounter, "intermissioncounter") GAMEINFOKEY_BOOL(nightmarefast, "nightmarefast") GAMEINFOKEY_COLOR(dimcolor, "dimcolor") diff --git a/src/gamedata/gi.h b/src/gamedata/gi.h index b5572da73..10bc411c0 100644 --- a/src/gamedata/gi.h +++ b/src/gamedata/gi.h @@ -121,6 +121,7 @@ struct gameinfo_t bool dontcrunchcorpses; bool correctprintbold; bool forcetextinmenus; + bool forcenogfxsubstitution; TArray creditPages; TArray finalePages; TArray infoPages; diff --git a/src/gamedata/statistics.cpp b/src/gamedata/statistics.cpp index db1720130..0c6375934 100644 --- a/src/gamedata/statistics.cpp +++ b/src/gamedata/statistics.cpp @@ -464,7 +464,7 @@ void STAT_ChangeLevel(const char *newl, FLevelLocals *Level) section.ToUpper(); const char *ep_name = StartEpisode->mEpisodeName; - if (*ep_name == '$') ep_name = GStrings[ep_name+1]; + if (*ep_name == '$') ep_name = GStrings(ep_name+1); FStatistics *sl = GetStatisticsList(EpisodeStatistics, section, ep_name); int statvals[6] = {0,0,0,0,0,0}; diff --git a/src/gamedata/stringtable.cpp b/src/gamedata/stringtable.cpp index 8d3344a0e..4032f7efb 100644 --- a/src/gamedata/stringtable.cpp +++ b/src/gamedata/stringtable.cpp @@ -45,6 +45,7 @@ #include "d_player.h" #include "xlsxread/xlsxio_read.h" +EXTERN_CVAR(String, language) //========================================================================== // @@ -63,7 +64,6 @@ void FStringTable::LoadStrings () if (!LoadLanguageFromSpreadsheet(lump)) LoadLanguage (lump); } - SetLanguageIDs(); UpdateLanguage(); allMacros.Clear(); } @@ -150,13 +150,15 @@ bool FStringTable::readSheetIntoTable(xlsxioreader reader, const char *sheetname int column = 0; char *value; table.Reserve(1); + auto myisspace = [](int ch) { return ch == '\t' || ch == '\r' || ch == '\n' || ch == ' '; }; + while ((value = xlsxioread_sheet_next_cell(sheet)) != nullptr) { auto vcopy = value; if (table.Size() <= (unsigned)row) table.Reserve(1); - while (*vcopy && iswspace((unsigned char)*vcopy)) vcopy++; // skip over leaading whitespace; + while (*vcopy && myisspace((unsigned char)*vcopy)) vcopy++; // skip over leaading whitespace; auto vend = vcopy + strlen(vcopy); - while (vend > vcopy && iswspace((unsigned char)vend[-1])) *--vend = 0; // skip over trailing whitespace + while (vend > vcopy && myisspace((unsigned char)vend[-1])) *--vend = 0; // skip over trailing whitespace ProcessEscapes(vcopy); table[row].Push(vcopy); column++; @@ -376,6 +378,12 @@ void FStringTable::InsertString(int langid, FName label, const FString &string) void FStringTable::UpdateLanguage() { + size_t langlen = strlen(language); + + int LanguageID = (langlen < 2 || langlen > 3) ? + MAKE_ID('e', 'n', 'u', '\0') : + MAKE_ID(language[0], language[1], language[2], '\0'); + currentLanguageSet.Clear(); auto checkone = [&](uint32_t lang_id) @@ -387,11 +395,8 @@ void FStringTable::UpdateLanguage() checkone(dehacked_table); checkone(global_table); - for (int i = 0; i < 4; ++i) - { - checkone(LanguageIDs[i]); - checkone(LanguageIDs[i] & MAKE_ID(0xff, 0xff, 0, 0)); - } + checkone(LanguageID); + checkone(LanguageID & MAKE_ID(0xff, 0xff, 0, 0)); checkone(default_table); } diff --git a/src/gamedata/textures/texturemanager.cpp b/src/gamedata/textures/texturemanager.cpp index d1f0ba91c..a53a14c58 100644 --- a/src/gamedata/textures/texturemanager.cpp +++ b/src/gamedata/textures/texturemanager.cpp @@ -403,9 +403,11 @@ FTexture *FTextureManager::FindTexture(const char *texname, ETextureType usetype // 3: Only replace if the string is not the default and the graphic comes from the IWAD. Never replace a localized graphic. // 4: Like 1, but lets localized graphics pass. // +// The default is 3, which only replaces known content with non-default texts. +// //========================================================================== -CUSTOM_CVAR(Int, cl_localizationmode,0, CVAR_ARCHIVE) +CUSTOM_CVAR(Int, cl_gfxlocalization, 3, CVAR_ARCHIVE) { if (self < 0 || self > 4) self = 0; } @@ -421,8 +423,8 @@ bool FTextureManager::OkForLocalization(FTextureID texnum, const char *substitut if (!texnum.isValid()) return false; // First the unconditional settings, 0='never' and 1='always'. - if (cl_localizationmode == 1 || gameinfo.forcetextinmenus) return false; - if (cl_localizationmode == 0) return true; + if (cl_gfxlocalization == 1 || gameinfo.forcetextinmenus) return false; + if (cl_gfxlocalization == 0 || gameinfo.forcenogfxsubstitution) return true; uint32_t langtable = 0; if (*substitute == '$') substitute = GStrings.GetString(substitute+1, &langtable); @@ -433,11 +435,11 @@ bool FTextureManager::OkForLocalization(FTextureID texnum, const char *substitut if (localizedTex != texnum.GetIndex()) return true; // Do not substitute a localized variant of the graphics patch. // For mode 4 we are done now. - if (cl_localizationmode == 4) return false; + if (cl_gfxlocalization == 4) return false; // Mode 2 and 3 must reject any text replacement from the default language tables. if ((langtable & MAKE_ID(255,0,0,0)) == MAKE_ID('*', 0, 0, 0)) return true; // Do not substitute if the string comes from the default table. - if (cl_localizationmode == 2) return false; + if (cl_gfxlocalization == 2) return false; // Mode 3 must also reject substitutions for non-IWAD content. int file = Wads.GetLumpFile(Textures[texnum.GetIndex()].Texture->SourceLump); @@ -1300,17 +1302,20 @@ int FTextureManager::PalCheck(int tex) // FTextureManager :: PalCheck // //========================================================================== +EXTERN_CVAR(String, language) int FTextureManager::ResolveLocalizedTexture(int tex) { - for(int i = 0; i < 4; i++) - { - uint32_t lang = LanguageIDs[i]; - uint64_t index = (uint64_t(lang) << 32) + tex; - if (auto pTex = LocalizedTextures.CheckKey(index)) return *pTex; - index = (uint64_t(lang & MAKE_ID(255, 255, 0, 0)) << 32) + tex; - if (auto pTex = LocalizedTextures.CheckKey(index)) return *pTex; - } + size_t langlen = strlen(language); + int lang = (langlen < 2 || langlen > 3) ? + MAKE_ID('e', 'n', 'u', '\0') : + MAKE_ID(language[0], language[1], language[2], '\0'); + + uint64_t index = (uint64_t(lang) << 32) + tex; + if (auto pTex = LocalizedTextures.CheckKey(index)) return *pTex; + index = (uint64_t(lang & MAKE_ID(255, 255, 0, 0)) << 32) + tex; + if (auto pTex = LocalizedTextures.CheckKey(index)) return *pTex; + return tex; } diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index f1dd8b9a0..cc2482220 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -847,6 +847,7 @@ void DIntermissionController::OnDestroy () void F_StartIntermission(FIntermissionDescriptor *desc, bool deleteme, uint8_t state) { + ScaleOverrider s; if (DIntermissionController::CurrentIntermission != NULL) { DIntermissionController::CurrentIntermission->Destroy(); @@ -892,6 +893,7 @@ void F_StartIntermission(FName seq, uint8_t state) bool F_Responder (event_t* ev) { + ScaleOverrider s; if (DIntermissionController::CurrentIntermission != NULL) { return DIntermissionController::CurrentIntermission->Responder(ev); @@ -907,6 +909,7 @@ bool F_Responder (event_t* ev) void F_Ticker () { + ScaleOverrider s; if (DIntermissionController::CurrentIntermission != NULL) { DIntermissionController::CurrentIntermission->Ticker(); @@ -921,6 +924,7 @@ void F_Ticker () void F_Drawer () { + ScaleOverrider s; if (DIntermissionController::CurrentIntermission != NULL) { DIntermissionController::CurrentIntermission->Drawer(); @@ -936,6 +940,7 @@ void F_Drawer () void F_EndFinale () { + ScaleOverrider s; if (DIntermissionController::CurrentIntermission != NULL) { DIntermissionController::CurrentIntermission->Destroy(); @@ -951,6 +956,7 @@ void F_EndFinale () void F_AdvanceIntermission() { + ScaleOverrider s; if (DIntermissionController::CurrentIntermission != NULL) { DIntermissionController::CurrentIntermission->mAdvance = true; diff --git a/src/menu/menu.cpp b/src/menu/menu.cpp index 6e2339d11..008f13b55 100644 --- a/src/menu/menu.cpp +++ b/src/menu/menu.cpp @@ -405,7 +405,7 @@ DEFINE_ACTION_FUNCTION(DMenu, ActivateMenu) // //============================================================================= -EXTERN_CVAR(Int, cl_localizationmode) +EXTERN_CVAR(Int, cl_gfxlocalization) void M_SetMenu(FName menu, int param) @@ -420,7 +420,7 @@ void M_SetMenu(FName menu, int param) { menu = NAME_MainmenuTextOnly; } - else + else if (cl_gfxlocalization != 0 && !gameinfo.forcenogfxsubstitution) { // For these games we must check up-front if they get localized because in that case another template must be used. DMenuDescriptor **desc = MenuDescriptors.CheckKey(NAME_Mainmenu); @@ -429,7 +429,7 @@ void M_SetMenu(FName menu, int param) if ((*desc)->IsKindOf(RUNTIME_CLASS(DListMenuDescriptor))) { DListMenuDescriptor *ld = static_cast(*desc); - if (ld->mFromEngine && cl_localizationmode != 0) + if (ld->mFromEngine) { // This assumes that replacing one graphic will replace all of them. // So this only checks the "New game" entry for localization capability. diff --git a/src/p_acs.cpp b/src/p_acs.cpp index e5c338b00..f230f57cb 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -536,8 +536,6 @@ -extern FILE *Logfile; - FRandom pr_acs ("ACS"); // I imagine this much stack space is probably overkill, but it could @@ -8614,10 +8612,7 @@ scriptwait: if (pcd == PCD_ENDPRINTBOLD || screen == NULL || screen->CheckLocalView()) { - if (pcd == PCD_ENDPRINTBOLD && (gameinfo.correctprintbold || (Level->flags2 & LEVEL2_HEXENHACK))) - C_MidPrintBold(activefont, work); - else - C_MidPrint (activefont, work); + C_MidPrint (activefont, work, pcd == PCD_ENDPRINTBOLD && (gameinfo.correctprintbold || (Level->flags2 & LEVEL2_HEXENHACK))); } STRINGBUILDER_FINISH(work); } @@ -8720,17 +8715,8 @@ scriptwait: (type & HUDMSG_LAYER_MASK) >> HUDMSG_LAYER_SHIFT); if (type & HUDMSG_LOG) { - static const char bar[] = TEXTCOLOR_ORANGE "\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36" - "\36\36\36\36\36\36\36\36\36\36\36\36\37" TEXTCOLOR_NORMAL "\n"; - char consolecolor[3]; - - consolecolor[0] = '\x1c'; - consolecolor[1] = color >= CR_BRICK && color <= CR_YELLOW ? color + 'A' : '-'; - consolecolor[2] = '\0'; - AddToConsole (-1, bar); - AddToConsole (-1, consolecolor); - AddToConsole (-1, work); - AddToConsole (-1, bar); + int consolecolor = color >= CR_BRICK && color <= CR_YELLOW ? color + 'A' : '-'; + Printf(PRINT_NONOTIFY, "\n" TEXTCOLOR_ESCAPESTR "%c%s\n%s\n%s\n", consolecolor, console_bar, work.GetChars(), console_bar); } } } diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 24f4d68b8..afd704909 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -1341,7 +1341,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PrintBold) con_midtime = float(time); } FString formatted = strbin1(text); - C_MidPrintBold(font, formatted.GetChars()); + C_MidPrint(font, formatted.GetChars(), true); con_midtime = saved; return 0; } diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index b94d19535..6f3bec89b 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -695,8 +695,7 @@ static void TerminalResponse (const char *str) if (StatusBar != NULL) { - AddToConsole(-1, str); - AddToConsole(-1, "\n"); + Printf(PRINT_NONOTIFY, "%s\n", str); // The message is positioned a bit above the menu choices, because // merchants can tell you something like this but continue to show // their dialogue screen. I think most other conversations use this diff --git a/src/p_map.cpp b/src/p_map.cpp index c8ba45470..6b7888674 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -98,7 +98,7 @@ CVAR(Int, sv_smartaim, 0, CVAR_ARCHIVE | CVAR_SERVERINFO) CVAR(Bool, cl_doautoaim, false, CVAR_ARCHIVE) static void CheckForPushSpecial(line_t *line, int side, AActor *mobj, DVector2 * posforwindowcheck = NULL); -static void SpawnShootDecal(AActor *t1, const FTraceResults &trace); +static void SpawnShootDecal(AActor *t1, AActor *defaults, const FTraceResults &trace); static void SpawnDeepSplash(AActor *t1, const FTraceResults &trace, AActor *puff); static FRandom pr_tracebleed("TraceBleed"); @@ -4568,20 +4568,20 @@ AActor *P_LineAttack(AActor *t1, DAngle angle, double distance, { // [ZK] If puff has FORCEDECAL set, do not use the weapon's decal if (puffDefaults->flags7 & MF7_FORCEDECAL && puff != NULL && puff->DecalGenerator) - SpawnShootDecal(puff, trace); + SpawnShootDecal(puff, puff, trace); else - SpawnShootDecal(t1, trace); + SpawnShootDecal(t1, t1, trace); } // Else, look if the bulletpuff has a decal defined. else if (puff != NULL && puff->DecalGenerator) { - SpawnShootDecal(puff, trace); + SpawnShootDecal(puff, puff, trace); } else { - SpawnShootDecal(t1, trace); + SpawnShootDecal(t1, t1, trace); } } else if (puff != NULL && @@ -5268,9 +5268,9 @@ void P_RailAttack(FRailParams *p) puff->Destroy(); } if (puffDefaults != nullptr && puffDefaults->flags7 & MF7_FORCEDECAL && puffDefaults->DecalGenerator) - SpawnShootDecal(puffDefaults, trace); + SpawnShootDecal(source, puffDefaults, trace); else - SpawnShootDecal(source, trace); + SpawnShootDecal(source, source, trace); } if (trace.HitType == TRACE_HitFloor || trace.HitType == TRACE_HitCeiling) @@ -6746,19 +6746,19 @@ bool P_ChangeSector(sector_t *sector, int crunch, double amt, int floorOrCeil, b // //========================================================================== -void SpawnShootDecal(AActor *t1, const FTraceResults &trace) +void SpawnShootDecal(AActor *t1, AActor *defaults, const FTraceResults &trace) { - FDecalBase *decalbase = NULL; + FDecalBase *decalbase = nullptr; - if (t1->player != NULL && t1->player->ReadyWeapon != NULL) + if (defaults->player != nullptr && defaults->player->ReadyWeapon != nullptr) { - decalbase = t1->player->ReadyWeapon->DecalGenerator; + decalbase = defaults->player->ReadyWeapon->DecalGenerator; } else { - decalbase = t1->DecalGenerator; + decalbase = defaults->DecalGenerator; } - if (decalbase != NULL) + if (decalbase != nullptr) { DImpactDecal::StaticCreate(t1->Level, decalbase->GetDecal(), trace.HitPos, trace.Line->sidedef[trace.Side], trace.ffloor); diff --git a/src/p_user.cpp b/src/p_user.cpp index 183364124..f854d5c8c 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -426,9 +426,7 @@ void player_t::SetLogText (const char *text) if (mo && mo->CheckLocalView()) { // Print log text to console - AddToConsole(-1, TEXTCOLOR_GOLD); - AddToConsole(-1, LogText[0] == '$'? GStrings(text+1) : text ); - AddToConsole(-1, "\n"); + Printf(PRINT_NONOTIFY, TEXTCOLOR_GOLD "%s\n", LogText[0] == '$' ? GStrings(text + 1) : text); } } diff --git a/src/posix/cocoa/i_system.mm b/src/posix/cocoa/i_system.mm index 8ef18d985..04a645540 100644 --- a/src/posix/cocoa/i_system.mm +++ b/src/posix/cocoa/i_system.mm @@ -68,21 +68,6 @@ ticcmd_t* I_BaseTiccmd() -// -// SetLanguageIDs -// -void SetLanguageIDs() -{ - size_t langlen = strlen(language); - - uint32_t lang = (langlen < 2 || langlen > 3) - ? MAKE_ID('e', 'n', 'u', '\0') - : MAKE_ID(language[0], language[1], language[2], '\0'); - - LanguageIDs[3] = LanguageIDs[2] = LanguageIDs[1] = LanguageIDs[0] = lang; -} - - double PerfToSec, PerfToMillisec; static void CalculateCPUSpeed() diff --git a/src/posix/i_system.h b/src/posix/i_system.h index 7e6837824..e6cd95cf8 100644 --- a/src/posix/i_system.h +++ b/src/posix/i_system.h @@ -45,16 +45,6 @@ struct WadStuff; #define SHARE_DIR "/usr/local/share/" #endif -// Index values into the LanguageIDs array -enum -{ - LANGIDX_UserPreferred, - LANGIDX_UserDefault, - LANGIDX_SysPreferred, - LANGIDX_SysDefault -}; -extern uint32_t LanguageIDs[4]; -extern void SetLanguageIDs (); // Called by DoomMain. void I_Init (void); diff --git a/src/posix/sdl/hardware.cpp b/src/posix/sdl/hardware.cpp index 61d36abf0..4ea04f4e0 100644 --- a/src/posix/sdl/hardware.cpp +++ b/src/posix/sdl/hardware.cpp @@ -149,11 +149,11 @@ void I_SetFPSLimit(int limit) { FPSLimitTimerEnabled = true; if(timer_create(CLOCK_REALTIME, &FPSLimitEvent, &FPSLimitTimer) == -1) - Printf(DMSG_WARNING, "Failed to create FPS limitter event\n"); + Printf(DMSG_WARNING, "Failed to create FPS limiter event\n"); itimerspec period = { {0, 0}, {0, 0} }; period.it_value.tv_nsec = period.it_interval.tv_nsec = 1000000000 / limit; if(timer_settime(FPSLimitTimer, 0, &period, NULL) == -1) - Printf(DMSG_WARNING, "Failed to set FPS limitter timer\n"); + Printf(DMSG_WARNING, "Failed to set FPS limiter timer\n"); DPrintf(DMSG_NOTIFY, "FPS timer set to %u ms\n", (unsigned int) period.it_interval.tv_nsec / 1000000); } } diff --git a/src/posix/sdl/i_system.cpp b/src/posix/sdl/i_system.cpp index a9c94ba1f..2b8fd9155 100644 --- a/src/posix/sdl/i_system.cpp +++ b/src/posix/sdl/i_system.cpp @@ -92,20 +92,6 @@ void I_EndRead(void) } -// -// SetLanguageIDs -// -void SetLanguageIDs () -{ - size_t langlen = strlen(language); - - uint32_t lang = (langlen < 2 || langlen > 3) ? - MAKE_ID('e','n','u','\0') : - MAKE_ID(language[0],language[1],language[2],'\0'); - - LanguageIDs[3] = LanguageIDs[2] = LanguageIDs[1] = LanguageIDs[0] = lang; -} - // // I_Init // diff --git a/src/r_utility.cpp b/src/r_utility.cpp index b8a45900f..c258d0df8 100644 --- a/src/r_utility.cpp +++ b/src/r_utility.cpp @@ -223,9 +223,9 @@ void R_SetWindow (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, int wind else { viewwindow.WidescreenRatio = ActiveRatio(fullWidth, fullHeight); + DrawFSHUD = (windowSize == 11); } - DrawFSHUD = (windowSize == 11); // [RH] Sky height fix for screens not 200 (or 240) pixels tall R_InitSkyMap (); diff --git a/src/rendering/hwrenderer/dynlights/hw_lightbuffer.h b/src/rendering/hwrenderer/dynlights/hw_lightbuffer.h index 9522ccc45..1db32f646 100644 --- a/src/rendering/hwrenderer/dynlights/hw_lightbuffer.h +++ b/src/rendering/hwrenderer/dynlights/hw_lightbuffer.h @@ -59,6 +59,7 @@ public: void BindBase() { mBuffer->BindBase(); + mLastMappedIndex = UINT_MAX; } }; diff --git a/src/s_sound.cpp b/src/s_sound.cpp index b6aefd868..4027adc2d 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -183,21 +183,21 @@ void S_NoiseDebug (void) int y, color; y = 32 * CleanYfac; - screen->DrawText (SmallFont, CR_YELLOW, 0, y, "*** SOUND DEBUG INFO ***", TAG_DONE); - y += 8; + screen->DrawText (NewConsoleFont, CR_YELLOW, 0, y, "*** SOUND DEBUG INFO ***", TAG_DONE); + y += NewConsoleFont->GetHeight(); - screen->DrawText (SmallFont, CR_GOLD, 0, y, "name", TAG_DONE); - screen->DrawText (SmallFont, CR_GOLD, 70, y, "x", TAG_DONE); - screen->DrawText (SmallFont, CR_GOLD, 120, y, "y", TAG_DONE); - screen->DrawText (SmallFont, CR_GOLD, 170, y, "z", TAG_DONE); - screen->DrawText (SmallFont, CR_GOLD, 220, y, "vol", TAG_DONE); - screen->DrawText (SmallFont, CR_GOLD, 260, y, "dist", TAG_DONE); - screen->DrawText (SmallFont, CR_GOLD, 300, y, "chan", TAG_DONE); - screen->DrawText (SmallFont, CR_GOLD, 340, y, "pri", TAG_DONE); - screen->DrawText (SmallFont, CR_GOLD, 380, y, "flags", TAG_DONE); - screen->DrawText (SmallFont, CR_GOLD, 460, y, "aud", TAG_DONE); - screen->DrawText (SmallFont, CR_GOLD, 520, y, "pos", TAG_DONE); - y += 8; + screen->DrawText (NewConsoleFont, CR_GOLD, 0, y, "name", TAG_DONE); + screen->DrawText (NewConsoleFont, CR_GOLD, 70, y, "x", TAG_DONE); + screen->DrawText (NewConsoleFont, CR_GOLD, 120, y, "y", TAG_DONE); + screen->DrawText (NewConsoleFont, CR_GOLD, 170, y, "z", TAG_DONE); + screen->DrawText (NewConsoleFont, CR_GOLD, 220, y, "vol", TAG_DONE); + screen->DrawText (NewConsoleFont, CR_GOLD, 260, y, "dist", TAG_DONE); + screen->DrawText (NewConsoleFont, CR_GOLD, 300, y, "chan", TAG_DONE); + screen->DrawText (NewConsoleFont, CR_GOLD, 340, y, "pri", TAG_DONE); + screen->DrawText (NewConsoleFont, CR_GOLD, 380, y, "flags", TAG_DONE); + screen->DrawText (NewConsoleFont, CR_GOLD, 460, y, "aud", TAG_DONE); + screen->DrawText (NewConsoleFont, CR_GOLD, 520, y, "pos", TAG_DONE); + y += NewConsoleFont->GetHeight(); if (Channels == NULL) { @@ -220,52 +220,52 @@ void S_NoiseDebug (void) // Name Wads.GetLumpName (temp, S_sfx[chan->SoundID].lumpnum); temp[8] = 0; - screen->DrawText (SmallFont, color, 0, y, temp, TAG_DONE); + screen->DrawText (NewConsoleFont, color, 0, y, temp, TAG_DONE); if (!(chan->ChanFlags & CHAN_IS3D)) { - screen->DrawText(SmallFont, color, 70, y, "---", TAG_DONE); // X - screen->DrawText(SmallFont, color, 120, y, "---", TAG_DONE); // Y - screen->DrawText(SmallFont, color, 170, y, "---", TAG_DONE); // Z - screen->DrawText(SmallFont, color, 260, y, "---", TAG_DONE); // Distance + screen->DrawText(NewConsoleFont, color, 70, y, "---", TAG_DONE); // X + screen->DrawText(NewConsoleFont, color, 120, y, "---", TAG_DONE); // Y + screen->DrawText(NewConsoleFont, color, 170, y, "---", TAG_DONE); // Z + screen->DrawText(NewConsoleFont, color, 260, y, "---", TAG_DONE); // Distance } else { // X coordinate mysnprintf(temp, countof(temp), "%.0f", origin.X); - screen->DrawText(SmallFont, color, 70, y, temp, TAG_DONE); + screen->DrawText(NewConsoleFont, color, 70, y, temp, TAG_DONE); // Y coordinate mysnprintf(temp, countof(temp), "%.0f", origin.Z); - screen->DrawText(SmallFont, color, 120, y, temp, TAG_DONE); + screen->DrawText(NewConsoleFont, color, 120, y, temp, TAG_DONE); // Z coordinate mysnprintf(temp, countof(temp), "%.0f", origin.Y); - screen->DrawText(SmallFont, color, 170, y, temp, TAG_DONE); + screen->DrawText(NewConsoleFont, color, 170, y, temp, TAG_DONE); // Distance if (chan->DistanceScale > 0) { mysnprintf(temp, countof(temp), "%.0f", (origin - listener).Length()); - screen->DrawText(SmallFont, color, 260, y, temp, TAG_DONE); + screen->DrawText(NewConsoleFont, color, 260, y, temp, TAG_DONE); } else { - screen->DrawText(SmallFont, color, 260, y, "---", TAG_DONE); + screen->DrawText(NewConsoleFont, color, 260, y, "---", TAG_DONE); } } // Volume mysnprintf(temp, countof(temp), "%.2g", chan->Volume); - screen->DrawText(SmallFont, color, 220, y, temp, TAG_DONE); + screen->DrawText(NewConsoleFont, color, 220, y, temp, TAG_DONE); // Channel mysnprintf(temp, countof(temp), "%d", chan->EntChannel); - screen->DrawText(SmallFont, color, 300, y, temp, TAG_DONE); + screen->DrawText(NewConsoleFont, color, 300, y, temp, TAG_DONE); // Priority mysnprintf(temp, countof(temp), "%d", chan->Priority); - screen->DrawText(SmallFont, color, 340, y, temp, TAG_DONE); + screen->DrawText(NewConsoleFont, color, 340, y, temp, TAG_DONE); // Flags mysnprintf(temp, countof(temp), "%s3%sZ%sU%sM%sN%sA%sL%sE%sV", @@ -278,18 +278,18 @@ void S_NoiseDebug (void) (chan->ChanFlags & CHAN_LOOP) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK, (chan->ChanFlags & CHAN_EVICTED) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK, (chan->ChanFlags & CHAN_VIRTUAL) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK); - screen->DrawText(SmallFont, color, 380, y, temp, TAG_DONE); + screen->DrawText(NewConsoleFont, color, 380, y, temp, TAG_DONE); // Audibility mysnprintf(temp, countof(temp), "%.4f", GSnd->GetAudibility(chan)); - screen->DrawText(SmallFont, color, 460, y, temp, TAG_DONE); + screen->DrawText(NewConsoleFont, color, 460, y, temp, TAG_DONE); // Position mysnprintf(temp, countof(temp), "%u", GSnd->GetPosition(chan)); - screen->DrawText(SmallFont, color, 520, y, temp, TAG_DONE); + screen->DrawText(NewConsoleFont, color, 520, y, temp, TAG_DONE); - y += 8; + y += NewConsoleFont->GetHeight(); if (chan->PrevChan == &Channels) { break; diff --git a/src/v_video.cpp b/src/v_video.cpp index d0085a153..6e043383b 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -154,7 +154,7 @@ public: int DisplayWidth, DisplayHeight; -FFont *SmallFont, *SmallFont2, *BigFont, *BigUpper, *ConFont, *IntermissionFont, *NewConsoleFont, *CurrentConsoleFont; +FFont *SmallFont, *SmallFont2, *BigFont, *BigUpper, *ConFont, *IntermissionFont, *NewConsoleFont, *NewSmallFont, *CurrentConsoleFont; uint32_t Col2RGB8[65][256]; uint32_t *Col2RGB8_LessPrecision[65]; @@ -548,13 +548,10 @@ CCMD(clean) void V_UpdateModeSize (int width, int height) -{ - int cx1, cx2; - V_CalcCleanFacs(320, 200, width, height, &CleanXfac, &CleanYfac, &cx1, &cx2); - - CleanWidth = width / CleanXfac; - CleanHeight = height / CleanYfac; - assert(CleanWidth >= 320 && CleanHeight >= 200); +{ + // This calculates the menu scale. + // The optimal scale will always be to fit a virtual 640 pixel wide display onto the screen. + // Exceptions are made for a few ranges where the available virtual width is > 480. int w = screen->GetWidth(); int factor; @@ -563,7 +560,11 @@ void V_UpdateModeSize (int width, int height) else if (w >= 1600 && w < 1920) factor = 3; else factor = w / 640; - CleanXfac_1 = CleanYfac_1 = factor; + CleanXfac = CleanYfac = factor; + CleanWidth = width / CleanXfac; + CleanHeight = height / CleanYfac; + + CleanYfac_1 = CleanXfac_1 = MAX(1, int (CleanXfac * 0.7)); CleanWidth_1 = width / CleanXfac_1; CleanHeight_1 = height / CleanYfac_1; @@ -590,52 +591,8 @@ void V_OutputResized (int width, int height) void V_CalcCleanFacs (int designwidth, int designheight, int realwidth, int realheight, int *cleanx, int *cleany, int *_cx1, int *_cx2) { - float ratio; - int cwidth; - int cheight; - int cx1, cy1, cx2, cy2; - - // For larger screems always use at least a 16:9 ratio for clean factor calculation, even if the actual ratio is narrower. - if (realwidth > 1280 && (double)realwidth / realheight < 16./9) - { - realheight = realwidth * 9 / 16; - } - - ratio = ActiveRatio(realwidth, realheight); - if (AspectTallerThanWide(ratio)) - { - cwidth = realwidth; - cheight = realheight * AspectMultiplier(ratio) / 48; - } - else - { - cwidth = realwidth * AspectMultiplier(ratio) / 48; - cheight = realheight; - } - // Use whichever pair of cwidth/cheight or width/height that produces less difference - // between CleanXfac and CleanYfac. - cx1 = MAX(cwidth / designwidth, 1); - cy1 = MAX(cheight / designheight, 1); - cx2 = MAX(realwidth / designwidth, 1); - cy2 = MAX(realheight / designheight, 1); - if (abs(cx1 - cy1) <= abs(cx2 - cy2) || MAX(cx1, cx2) >= 4) - { // e.g. 640x360 looks better with this. - *cleanx = cx1; - *cleany = cy1; - } - else - { // e.g. 720x480 looks better with this. - *cleanx = cx2; - *cleany = cy2; - } - - if (*cleanx < *cleany) - *cleany = *cleanx; - else - *cleanx = *cleany; - - if (_cx1 != NULL) *_cx1 = cx1; - if (_cx2 != NULL) *_cx2 = cx2; + if (designheight < 240 && realheight >= 480) designheight = 240; + *cleanx = *cleany = std::min(realwidth / designwidth, realheight / designheight); } bool IVideo::SetResolution () @@ -960,6 +917,7 @@ DEFINE_GLOBAL(SmallFont2) DEFINE_GLOBAL(BigFont) DEFINE_GLOBAL(ConFont) DEFINE_GLOBAL(NewConsoleFont) +DEFINE_GLOBAL(NewSmallFont) DEFINE_GLOBAL(IntermissionFont) DEFINE_GLOBAL(CleanXfac) DEFINE_GLOBAL(CleanYfac) diff --git a/src/v_video.h b/src/v_video.h index f1611511d..1634cc3a7 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -625,4 +625,35 @@ inline int active_con_scale() } +class ScaleOverrider +{ + int savedxfac, savedyfac, savedwidth, savedheight; + +public: + // This is to allow certain elements to use an optimal fullscreen scale which for the menu would be too large. + // The old code contained far too much mess to compensate for the menus which negatively affected everything else. + // However, for compatibility reasons the currently used variables cannot be changed so they have to be overridden temporarily. + // This class provides a safe interface for this because it ensures that the values get restored afterward. + // Currently, the intermission and the level summary screen use this. + ScaleOverrider() + { + savedxfac = CleanXfac; + savedyfac = CleanYfac; + savedwidth = CleanWidth; + savedheight = CleanHeight; + V_CalcCleanFacs(320, 200, screen->GetWidth(), screen->GetHeight(), &CleanXfac, &CleanYfac); + CleanWidth = screen->GetWidth() / CleanXfac; + CleanHeight = screen->GetHeight() / CleanYfac; + } + + ~ScaleOverrider() + { + CleanXfac = savedxfac; + CleanYfac = savedyfac; + CleanWidth = savedwidth; + CleanHeight = savedheight; + } +}; + + #endif // __V_VIDEO_H__ diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index dedda4602..1e319a146 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -701,6 +701,7 @@ void WI_Ticker() { if (WI_Screen) { + ScaleOverrider s; IFVIRTUALPTRNAME(WI_Screen, "StatusScreen", Ticker) { VMValue self = WI_Screen; @@ -720,6 +721,7 @@ void WI_Drawer() { if (WI_Screen) { + ScaleOverrider s; IFVIRTUALPTRNAME(WI_Screen, "StatusScreen", Drawer) { VMValue self = WI_Screen; @@ -767,6 +769,7 @@ void WI_Start(wbstartstruct_t *wbstartstruct) SN_StopAllSequences(Level); } WI_Screen = cls->CreateNew(); + ScaleOverrider s; IFVIRTUALPTRNAME(WI_Screen, "StatusScreen", Start) { VMValue val[2] = { WI_Screen, wbstartstruct }; diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index e6a63980c..ee43eab0c 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -878,12 +878,7 @@ void DoMain (HINSTANCE hInstance) } if (StdOut == NULL) { - // AttachConsole was introduced with Windows XP. (OTOH, since we - // have to share the console with the shell, I'm not sure if it's - // a good idea to actually attach to it.) - typedef BOOL (WINAPI *ac)(DWORD); - ac attach_console = kernel != NULL ? (ac)GetProcAddress(kernel, "AttachConsole") : NULL; - if (attach_console != NULL && attach_console(ATTACH_PARENT_PROCESS)) + if (AttachConsole(ATTACH_PARENT_PROCESS)) { StdOut = GetStdHandle(STD_OUTPUT_HANDLE); DWORD foo; WriteFile(StdOut, "\n", 1, &foo, NULL); @@ -893,6 +888,29 @@ void DoMain (HINSTANCE hInstance) { StdOut = GetStdHandle(STD_OUTPUT_HANDLE); } + + // These two functions do not exist in Windows XP. + BOOL (WINAPI* p_GetCurrentConsoleFontEx)(HANDLE hConsoleOutput, BOOL bMaximumWindow, PCONSOLE_FONT_INFOEX lpConsoleCurrentFontEx); + BOOL (WINAPI* p_SetCurrentConsoleFontEx)(HANDLE hConsoleOutput, BOOL bMaximumWindow, PCONSOLE_FONT_INFOEX lpConsoleCurrentFontEx); + + p_SetCurrentConsoleFontEx = (decltype(p_SetCurrentConsoleFontEx))GetProcAddress(kernel, "SetCurrentConsoleFontEx"); + p_GetCurrentConsoleFontEx = (decltype(p_GetCurrentConsoleFontEx))GetProcAddress(kernel, "GetCurrentConsoleFontEx"); + if (p_SetCurrentConsoleFontEx && p_GetCurrentConsoleFontEx) + { + CONSOLE_FONT_INFOEX cfi; + cfi.cbSize = sizeof(cfi); + + if (p_GetCurrentConsoleFontEx(StdOut, false, &cfi)) + { + if (*cfi.FaceName == 0) // If the face name is empty, the default (useless) raster font is actoive. + { + //cfi.dwFontSize = { 8, 14 }; + wcscpy(cfi.FaceName, L"Lucida Console"); + cfi.FontFamily = FF_DONTCARE; + p_SetCurrentConsoleFontEx(StdOut, false, &cfi); + } + } + } FancyStdOut = true; } } diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index 4087e1ec9..cc7727cd0 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -273,65 +273,6 @@ void I_DetectOS(void) info.dwBuildNumber, info.szCSDVersion); } -//========================================================================== -// -// SubsetLanguageIDs -// -// Helper function for SetLanguageIDs. -// -//========================================================================== - -static void SubsetLanguageIDs(LCID id, LCTYPE type, int idx) -{ - char buf[8]; - LCID langid; - char *idp; - - if (!GetLocaleInfoA(id, type, buf, 8)) - return; - langid = MAKELCID(strtoul(buf, NULL, 16), SORT_DEFAULT); - if (!GetLocaleInfoA(langid, LOCALE_SABBREVLANGNAME, buf, 8)) - return; - idp = (char *)(&LanguageIDs[idx]); - memset (idp, 0, 4); - idp[0] = tolower(buf[0]); - idp[1] = tolower(buf[1]); - idp[2] = tolower(buf[2]); - idp[3] = 0; -} - -//========================================================================== -// -// SetLanguageIDs -// -//========================================================================== - -void SetLanguageIDs() -{ - size_t langlen = strlen(language); - - if (langlen < 2 || langlen > 3) - { - memset(LanguageIDs, 0, sizeof(LanguageIDs)); - SubsetLanguageIDs(LOCALE_USER_DEFAULT, LOCALE_ILANGUAGE, 0); - SubsetLanguageIDs(LOCALE_USER_DEFAULT, LOCALE_IDEFAULTLANGUAGE, 1); - SubsetLanguageIDs(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, 2); - SubsetLanguageIDs(LOCALE_SYSTEM_DEFAULT, LOCALE_IDEFAULTLANGUAGE, 3); - } - else - { - uint32_t lang = 0; - - ((uint8_t *)&lang)[0] = (language)[0]; - ((uint8_t *)&lang)[1] = (language)[1]; - ((uint8_t *)&lang)[2] = (language)[2]; - LanguageIDs[0] = lang; - LanguageIDs[1] = lang; - LanguageIDs[2] = lang; - LanguageIDs[3] = lang; - } -} - //========================================================================== // // CalculateCPUSpeed diff --git a/src/win32/i_system.h b/src/win32/i_system.h index d03f21044..5a5b663f9 100644 --- a/src/win32/i_system.h +++ b/src/win32/i_system.h @@ -34,17 +34,6 @@ struct ticcmd_t; struct WadStuff; -// Index values into the LanguageIDs array -enum -{ - LANGIDX_UserPreferred, - LANGIDX_UserDefault, - LANGIDX_SysPreferred, - LANGIDX_SysDefault -}; -extern uint32_t LanguageIDs[4]; -extern void SetLanguageIDs (); - // [RH] Detects the OS the game is running under. void I_DetectOS (void); diff --git a/wadsrc/static/filter/game-doom/graphics/stcfn191.png b/wadsrc/static/filter/game-doom/graphics/stcfn191.png deleted file mode 100644 index c8e4dfd4a..000000000 Binary files a/wadsrc/static/filter/game-doom/graphics/stcfn191.png and /dev/null differ diff --git a/wadsrc/static/filter/game-doom/graphics/stcfn193.png b/wadsrc/static/filter/game-doom/graphics/stcfn193.png deleted file mode 100644 index 7371f3466..000000000 Binary files a/wadsrc/static/filter/game-doom/graphics/stcfn193.png and /dev/null differ diff --git a/wadsrc/static/filter/game-doom/graphics/stcfn196.png b/wadsrc/static/filter/game-doom/graphics/stcfn196.png deleted file mode 100644 index 00a24710f..000000000 Binary files a/wadsrc/static/filter/game-doom/graphics/stcfn196.png and /dev/null differ diff --git a/wadsrc/static/filter/game-doom/graphics/stcfn197.png b/wadsrc/static/filter/game-doom/graphics/stcfn197.png deleted file mode 100644 index 7401d8e30..000000000 Binary files a/wadsrc/static/filter/game-doom/graphics/stcfn197.png and /dev/null differ diff --git a/wadsrc/static/filter/game-doom/graphics/stcfn201.png b/wadsrc/static/filter/game-doom/graphics/stcfn201.png deleted file mode 100644 index b3704e56c..000000000 Binary files a/wadsrc/static/filter/game-doom/graphics/stcfn201.png and /dev/null differ diff --git a/wadsrc/static/filter/game-doom/graphics/stcfn205.png b/wadsrc/static/filter/game-doom/graphics/stcfn205.png deleted file mode 100644 index a34a45d2b..000000000 Binary files a/wadsrc/static/filter/game-doom/graphics/stcfn205.png and /dev/null differ diff --git a/wadsrc/static/filter/game-doom/graphics/stcfn209.png b/wadsrc/static/filter/game-doom/graphics/stcfn209.png deleted file mode 100644 index f95a02085..000000000 Binary files a/wadsrc/static/filter/game-doom/graphics/stcfn209.png and /dev/null differ diff --git a/wadsrc/static/filter/game-doom/graphics/stcfn211.png b/wadsrc/static/filter/game-doom/graphics/stcfn211.png deleted file mode 100644 index 5330d959c..000000000 Binary files a/wadsrc/static/filter/game-doom/graphics/stcfn211.png and /dev/null differ diff --git a/wadsrc/static/filter/game-doom/graphics/stcfn214.png b/wadsrc/static/filter/game-doom/graphics/stcfn214.png deleted file mode 100644 index a5afe83af..000000000 Binary files a/wadsrc/static/filter/game-doom/graphics/stcfn214.png and /dev/null differ diff --git a/wadsrc/static/filter/game-doom/graphics/stcfn218.png b/wadsrc/static/filter/game-doom/graphics/stcfn218.png deleted file mode 100644 index 995fa7d92..000000000 Binary files a/wadsrc/static/filter/game-doom/graphics/stcfn218.png and /dev/null differ diff --git a/wadsrc/static/filter/game-doom/graphics/stcfn220.png b/wadsrc/static/filter/game-doom/graphics/stcfn220.png deleted file mode 100644 index d79993a27..000000000 Binary files a/wadsrc/static/filter/game-doom/graphics/stcfn220.png and /dev/null differ diff --git a/wadsrc/static/filter/game-doom/graphics/stcfn223.png b/wadsrc/static/filter/game-doom/graphics/stcfn223.png deleted file mode 100644 index 7f9844da1..000000000 Binary files a/wadsrc/static/filter/game-doom/graphics/stcfn223.png and /dev/null differ diff --git a/wadsrc/static/filter/game-raven/graphics/fonta164.png b/wadsrc/static/filter/game-raven/graphics/fonta164.png deleted file mode 100644 index 6cf577220..000000000 Binary files a/wadsrc/static/filter/game-raven/graphics/fonta164.png and /dev/null differ diff --git a/wadsrc/static/filter/game-raven/graphics/fonta165.png b/wadsrc/static/filter/game-raven/graphics/fonta165.png deleted file mode 100644 index b149c3790..000000000 Binary files a/wadsrc/static/filter/game-raven/graphics/fonta165.png and /dev/null differ diff --git a/wadsrc/static/filter/game-raven/graphics/fonta182.png b/wadsrc/static/filter/game-raven/graphics/fonta182.png deleted file mode 100644 index 333f10454..000000000 Binary files a/wadsrc/static/filter/game-raven/graphics/fonta182.png and /dev/null differ diff --git a/wadsrc/static/filter/game-raven/graphics/fonta188.png b/wadsrc/static/filter/game-raven/graphics/fonta188.png deleted file mode 100644 index e8e556185..000000000 Binary files a/wadsrc/static/filter/game-raven/graphics/fonta188.png and /dev/null differ diff --git a/wadsrc/static/filter/game-raven/graphics/fonta191.png b/wadsrc/static/filter/game-raven/graphics/fonta191.png deleted file mode 100644 index 250badae6..000000000 Binary files a/wadsrc/static/filter/game-raven/graphics/fonta191.png and /dev/null differ diff --git a/wadsrc/static/filter/game-raven/graphics/fonta60.png b/wadsrc/static/filter/game-raven/graphics/fonta60.png deleted file mode 100644 index 30afe2549..000000000 Binary files a/wadsrc/static/filter/game-raven/graphics/fonta60.png and /dev/null differ diff --git a/wadsrc/static/filter/game-raven/graphics/fonta61.png b/wadsrc/static/filter/game-raven/graphics/fonta61.png deleted file mode 100644 index 30afe2549..000000000 Binary files a/wadsrc/static/filter/game-raven/graphics/fonta61.png and /dev/null differ diff --git a/wadsrc/static/filter/game-raven/graphics/fonta62.png b/wadsrc/static/filter/game-raven/graphics/fonta62.png deleted file mode 100644 index 904735853..000000000 Binary files a/wadsrc/static/filter/game-raven/graphics/fonta62.png and /dev/null differ diff --git a/wadsrc/static/filter/game-raven/graphics/fonta63.png b/wadsrc/static/filter/game-raven/graphics/fonta63.png deleted file mode 100644 index 30afe2549..000000000 Binary files a/wadsrc/static/filter/game-raven/graphics/fonta63.png and /dev/null differ diff --git a/wadsrc/static/language.def b/wadsrc/static/language.def index 5e629dc97..d9367eb08 100644 --- a/wadsrc/static/language.def +++ b/wadsrc/static/language.def @@ -75,9 +75,7 @@ MUSIC_READ_M = "read_m"; MUSIC_DM2TTL = "dm2ttl"; MUSIC_DM2INT = "dm2int"; - // MBF (BOOM?) narration backgrounds - bgflatE1 = "FLOOR4_8"; bgflatE2 = "SFLR6_1"; bgflatE3 = "MFLR8_4"; @@ -93,3 +91,237 @@ bgcastcall = "BOSSBACK"; TAG_QUEST4 = "quest4"; TAG_QUEST5 = "quest5"; TAG_QUEST6 = "quest4"; + +// For printing a custom banner to the console. Must be overridden by mods. +STARTUP1 = ""; +STARTUP2 = ""; +STARTUP3 = ""; +STARTUP4 = ""; +STARTUP5 = ""; + +// Placeholder definitions for strings that are in the game content table where the labels are needed even when that file is not loaded. + +// Level names +HUSTR_E1M1 = ""; +HUSTR_E1M2 = ""; +HUSTR_E1M3 = ""; +HUSTR_E1M4 = ""; +HUSTR_E1M5 = ""; +HUSTR_E1M6 = ""; +HUSTR_E1M7 = ""; +HUSTR_E1M8 = ""; +HUSTR_E1M9 = ""; +HUSTR_E2M1 = ""; +HUSTR_E2M2 = ""; +HUSTR_E2M3 = ""; +HUSTR_E2M4 = ""; +HUSTR_E2M5 = ""; +HUSTR_E2M6 = ""; +HUSTR_E2M7 = ""; +HUSTR_E2M8 = ""; +HUSTR_E2M9 = ""; +HUSTR_E3M1 = ""; +HUSTR_E3M2 = ""; +HUSTR_E3M3 = ""; +HUSTR_E3M4 = ""; +HUSTR_E3M5 = ""; +HUSTR_E3M6 = ""; +HUSTR_E3M7 = ""; +HUSTR_E3M8 = ""; +HUSTR_E3M9 = ""; +HUSTR_E4M1 = ""; +HUSTR_E4M2 = ""; +HUSTR_E4M3 = ""; +HUSTR_E4M4 = ""; +HUSTR_E4M5 = ""; +HUSTR_E4M6 = ""; +HUSTR_E4M7 = ""; +HUSTR_E4M8 = ""; +HUSTR_E4M9 = ""; + +HHUSTR_E1M1 = ""; +HHUSTR_E1M2 = ""; +HHUSTR_E1M3 = ""; +HHUSTR_E1M4 = ""; +HHUSTR_E1M5 = ""; +HHUSTR_E1M6 = ""; +HHUSTR_E1M7 = ""; +HHUSTR_E1M8 = ""; +HHUSTR_E1M9 = ""; +HHUSTR_E2M1 = ""; +HHUSTR_E2M2 = ""; +HHUSTR_E2M3 = ""; +HHUSTR_E2M4 = ""; +HHUSTR_E2M5 = ""; +HHUSTR_E2M6 = ""; +HHUSTR_E2M7 = ""; +HHUSTR_E2M8 = ""; +HHUSTR_E2M9 = ""; +HHUSTR_E3M1 = ""; +HHUSTR_E3M2 = ""; +HHUSTR_E3M3 = ""; +HHUSTR_E3M4 = ""; +HHUSTR_E3M5 = ""; +HHUSTR_E3M6 = ""; +HHUSTR_E3M7 = ""; +HHUSTR_E3M8 = ""; +HHUSTR_E3M9 = ""; +HHUSTR_E4M1 = ""; +HHUSTR_E4M2 = ""; +HHUSTR_E4M3 = ""; +HHUSTR_E4M4 = ""; +HHUSTR_E4M5 = ""; +HHUSTR_E4M6 = ""; +HHUSTR_E4M7 = ""; +HHUSTR_E4M8 = ""; +HHUSTR_E4M9 = ""; +HHUSTR_E5M1 = ""; +HHUSTR_E5M2 = ""; +HHUSTR_E5M3 = ""; +HHUSTR_E5M4 = ""; +HHUSTR_E5M5 = ""; +HHUSTR_E5M6 = ""; +HHUSTR_E5M7 = ""; +HHUSTR_E5M8 = ""; +HHUSTR_E5M9 = ""; + +HUSTR_1 = ""; +HUSTR_2 = ""; +HUSTR_3 = ""; +HUSTR_4 = ""; +HUSTR_5 = ""; +HUSTR_6 = ""; +HUSTR_7 = ""; +HUSTR_8 = ""; +HUSTR_9 = ""; +HUSTR_10 = ""; +HUSTR_11 = ""; +HUSTR_12 = ""; +HUSTR_13 = ""; +HUSTR_14 = ""; +HUSTR_15 = ""; +HUSTR_16 = ""; +HUSTR_17 = ""; +HUSTR_18 = ""; +HUSTR_19 = ""; +HUSTR_20 = ""; +HUSTR_21 = ""; +HUSTR_22 = ""; +HUSTR_23 = ""; +HUSTR_24 = ""; +HUSTR_25 = ""; +HUSTR_26 = ""; +HUSTR_27 = ""; +HUSTR_28 = ""; +HUSTR_29 = ""; +HUSTR_30 = ""; +HUSTR_31 = ""; +HUSTR_32 = ""; +HUSTR_31B = ""; +HUSTR_32B = ""; +HUSTR_33 = ""; + +NHUSTR_1 = ""; +NHUSTR_2 = ""; +NHUSTR_3 = ""; +NHUSTR_4 = ""; +NHUSTR_5 = ""; +NHUSTR_6 = ""; +NHUSTR_7 = ""; +NHUSTR_8 = ""; +NHUSTR_9 = ""; + +PHUSTR_1 = ""; +PHUSTR_2 = ""; +PHUSTR_3 = ""; +PHUSTR_4 = ""; +PHUSTR_5 = ""; +PHUSTR_6 = ""; +PHUSTR_7 = ""; +PHUSTR_8 = ""; +PHUSTR_9 = ""; +PHUSTR_10 = ""; +PHUSTR_11 = ""; +PHUSTR_12 = ""; +PHUSTR_13 = ""; +PHUSTR_14 = ""; +PHUSTR_15 = ""; +PHUSTR_16 = ""; +PHUSTR_17 = ""; +PHUSTR_18 = ""; +PHUSTR_19 = ""; +PHUSTR_20 = ""; +PHUSTR_21 = ""; +PHUSTR_22 = ""; +PHUSTR_23 = ""; +PHUSTR_24 = ""; +PHUSTR_25 = ""; +PHUSTR_26 = ""; +PHUSTR_27 = ""; +PHUSTR_28 = ""; +PHUSTR_29 = ""; +PHUSTR_30 = ""; +PHUSTR_31 = ""; +PHUSTR_32 = ""; + +THUSTR_1 = ""; +THUSTR_2 = ""; +THUSTR_3 = ""; +THUSTR_4 = ""; +THUSTR_5 = ""; +THUSTR_6 = ""; +THUSTR_7 = ""; +THUSTR_8 = ""; +THUSTR_9 = ""; +THUSTR_10 = ""; +THUSTR_11 = ""; +THUSTR_12 = ""; +THUSTR_13 = ""; +THUSTR_14 = ""; +THUSTR_15 = ""; +THUSTR_16 = ""; +THUSTR_17 = ""; +THUSTR_18 = ""; +THUSTR_19 = ""; +THUSTR_20 = ""; +THUSTR_21 = ""; +THUSTR_22 = ""; +THUSTR_23 = ""; +THUSTR_24 = ""; +THUSTR_25 = ""; +THUSTR_26 = ""; +THUSTR_27 = ""; +THUSTR_28 = ""; +THUSTR_29 = ""; +THUSTR_30 = ""; +THUSTR_31 = ""; +THUSTR_32 = ""; + +E1TEXT = ""; +E2TEXT = ""; +E3TEXT = ""; +E4TEXT = ""; +C1TEXT = ""; +C2TEXT = ""; +C3TEXT = ""; +C4TEXT = ""; +C5TEXT = ""; +C6TEXT = ""; +P1TEXT = ""; +P2TEXT = ""; +P3TEXT = ""; +P4TEXT = ""; +P5TEXT = ""; +P6TEXT = ""; +T1TEXT = ""; +T2TEXT = ""; +T3TEXT = ""; +T4TEXT = ""; +T5TEXT = ""; +T6TEXT = ""; +NERVETEXT = ""; +HE1TEXT = ""; +HE2TEXT = ""; +HE3TEXT = ""; +HE4TEXT = ""; +HE5TEXT = ""; diff --git a/wadsrc/static/mapinfo/chex.txt b/wadsrc/static/mapinfo/chex.txt index 62da7476e..01782eedd 100644 --- a/wadsrc/static/mapinfo/chex.txt +++ b/wadsrc/static/mapinfo/chex.txt @@ -189,7 +189,7 @@ clearepisodes episode e1m1 { picname = "M_EPI1" - name = "Chex Quest" + name = "$TXT_CHEX_EP" key = "k" } diff --git a/wadsrc/static/mapinfo/doom1.txt b/wadsrc/static/mapinfo/doom1.txt index f767e1c38..738c93c4a 100644 --- a/wadsrc/static/mapinfo/doom1.txt +++ b/wadsrc/static/mapinfo/doom1.txt @@ -21,28 +21,28 @@ clearepisodes episode e1m1 { picname = "M_EPI1" - name = "Knee-Deep in the Dead" + name = "$TXT_D1E1" key = "k" } episode e2m1 { picname = "M_EPI2" - name = "The Shores of Hell" + name = "$TXT_D1E2" key = "t" } episode e3m1 { picname = "M_EPI3" - name = "Inferno" + name = "$TXT_D1E3" key = "i" } episode e4m1 { picname = "M_EPI4" - name = "Thy Flesh Consumed" + name = "$TXT_D1E4" key = "t" optional } diff --git a/wadsrc/static/mapinfo/doom2.txt b/wadsrc/static/mapinfo/doom2.txt index 6268f52c9..e9853c8c4 100644 --- a/wadsrc/static/mapinfo/doom2.txt +++ b/wadsrc/static/mapinfo/doom2.txt @@ -4,13 +4,13 @@ include "mapinfo/doomcommon.txt" clearepisodes episode map01 { - name = "Hell On Earth" + name = "$TXT_D2E1" key = "h" } episode level01 { - name = "No Rest for the Living" + name = "$TXT_D1E2" key = "n" optional } diff --git a/wadsrc/static/mapinfo/hacx.txt b/wadsrc/static/mapinfo/hacx.txt index 45a511a81..ec6b0bc2e 100644 --- a/wadsrc/static/mapinfo/hacx.txt +++ b/wadsrc/static/mapinfo/hacx.txt @@ -3,5 +3,6 @@ include "mapinfo/doom2.txt" gameinfo { cursorpic = "cursor" + forcenogfxsubstitution = true } diff --git a/wadsrc/static/mapinfo/harmony.txt b/wadsrc/static/mapinfo/harmony.txt index b96689c9f..117d5d175 100644 --- a/wadsrc/static/mapinfo/harmony.txt +++ b/wadsrc/static/mapinfo/harmony.txt @@ -4,5 +4,6 @@ gameinfo { cursorpic = "cursor" statusbarclass = "HarmonyStatusBar" + forcenogfxsubstitution = true } diff --git a/wadsrc/static/mapinfo/plutonia.txt b/wadsrc/static/mapinfo/plutonia.txt index d4fefba86..d248377f6 100644 --- a/wadsrc/static/mapinfo/plutonia.txt +++ b/wadsrc/static/mapinfo/plutonia.txt @@ -6,7 +6,7 @@ include "mapinfo/doomcommon.txt" clearepisodes episode map01 { - name = "The Plutonia Experiment" + name = "$TXT_PLUT_EP" key = "t" } diff --git a/wadsrc/static/mapinfo/tnt.txt b/wadsrc/static/mapinfo/tnt.txt index 12768a5c3..df10bfa7e 100644 --- a/wadsrc/static/mapinfo/tnt.txt +++ b/wadsrc/static/mapinfo/tnt.txt @@ -6,7 +6,7 @@ include "mapinfo/doomcommon.txt" clearepisodes episode map01 { - name = "TNT: Evilution" + name = "$TXT_TNT_EP" key = "t" } diff --git a/wadsrc/static/mapinfo/urbanbrawl.txt b/wadsrc/static/mapinfo/urbanbrawl.txt index 949be059e..07ddd02da 100644 --- a/wadsrc/static/mapinfo/urbanbrawl.txt +++ b/wadsrc/static/mapinfo/urbanbrawl.txt @@ -4,5 +4,6 @@ gameinfo { swapmenu = true cursorpic = "cursor" + forcenogfxsubstitution = true } diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 403123db7..cfed6b614 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -344,11 +344,13 @@ OptionValue AutoOffOn OptionMenuSettings { // These can be overridden if a different menu fonts requires it. - Linespacing 8 + Linespacing 17 + /* IfGame(Heretic, Hexen) { Linespacing 9 } + */ } DefaultOptionMenu @@ -378,6 +380,8 @@ OptionMenu "OptionsMenu" protected Submenu "$OPTMNU_DISPLAY", "VideoOptions" Submenu "$OPTMNU_VIDEO", "VideoModeMenu" StaticText " " + Submenu "$OS_TITLE", "os_Menu" + StaticText " " SafeCommand "$OPTMNU_DEFAULTS", "reset2defaults" SafeCommand "$OPTMNU_RESETTOSAVED", "reset2saved" Command "$OPTMNU_CONSOLE", "menuconsole" @@ -1216,30 +1220,43 @@ OptionString MapMarkFont OptionMenu AutomapOptions protected { Title "$AUTOMAPMNU_TITLE" + Option "$AUTOMAPMNU_COLORSET", "am_colorset", "MapColorTypes" Option "$AUTOMAPMNU_CUSTOMCOLORS", "am_customcolors", "YesNo" Submenu "$AUTOMAPMNU_SETCUSTOMCOLORS", "MapColorMenu" + + StaticText "" Submenu "$AUTOMAPMNU_CONTROLS", "MapControlsMenu" - StaticText " " + + StaticText "" Option "$AUTOMAPMNU_ROTATE", "am_rotate", "RotateTypes" Option "$AUTOMAPMNU_OVERLAY", "am_overlay", "OverlayTypes" Option "$AUTOMAPMNU_TEXTURED", "am_textured", "OnOff" Option "$AUTOMAPMNU_FOLLOW", "am_followplayer", "OnOff" - Option "$AUTOMAPMNU_PTOVERLAY", "am_portaloverlay", "OnOff" - Slider "$AUTOMAPMNU_EMPTYSPACEMARGIN", "am_emptyspacemargin", 0, 90, 5, 0 - StaticText " " + + StaticText "" Option "$AUTOMAPMNU_SHOWITEMS", "am_showitems", "OnOff" Option "$AUTOMAPMNU_SHOWMONSTERS", "am_showmonsters", "OnOff" Option "$AUTOMAPMNU_SHOWSECRETS", "am_showsecrets", "OnOff" Option "$AUTOMAPMNU_SHOWTIME", "am_showtime", "OnOff" Option "$AUTOMAPMNU_SHOWTOTALTIME", "am_showtotaltime", "OnOff" - Option "$AUTOMAPMNU_MAPSECRETS", "am_map_secrets", "SecretTypes" Option "$AUTOMAPMNU_SHOWMAPLABEL", "am_showmaplabel", "MaplabelTypes" - Option "$AUTOMAPMNU_DRAWMAPBACK", "am_drawmapback", "MapBackTypes" + + StaticText "" Option "$AUTOMAPMNU_SHOWKEYS", "am_showkeys", "OnOff" + Option "$AUTOMAPMNU_SHOWKEYS_ALWAYS", "am_showkeys_always", "OnOff" + + StaticText "" + Option "$AUTOMAPMNU_MAPSECRETS", "am_map_secrets", "SecretTypes" + Option "$AUTOMAPMNU_DRAWMAPBACK", "am_drawmapback", "MapBackTypes" Option "$AUTOMAPMNU_SHOWTRIGGERLINES", "am_showtriggerlines", "MapTriggers" Option "$AUTOMAPMNU_SHOWTHINGSPRITES", "am_showthingsprites", "STSTypes" - StaticText " " + + StaticText "" + Option "$AUTOMAPMNU_PTOVERLAY", "am_portaloverlay", "OnOff" + Slider "$AUTOMAPMNU_EMPTYSPACEMARGIN", "am_emptyspacemargin", 0, 90, 5, 0 + + StaticText "" Option "$AUTOMAPMNU_MARKFONT", "am_markfont", "MapMarkFont" Option "$AUTOMAPMNU_MARKCOLOR", "am_markcolor", "TextColors" } @@ -1255,18 +1272,24 @@ OptionMenu MapControlsMenu protected Title "$MAPCNTRLMNU_TITLE" ScrollTop 2 StaticTextSwitchable "$CNTRLMNU_SWITCHTEXT1", "$CNTRLMNU_SWITCHTEXT2", "ControlMessage" - StaticText "" - StaticText "$MAPCNTRLMNU_CONTROLS", 1 + + StaticText "" MapControl "$MAPCNTRLMNU_PANLEFT", "+am_panleft" MapControl "$MAPCNTRLMNU_PANRIGHT", "+am_panright" MapControl "$MAPCNTRLMNU_PANUP", "+am_panup" MapControl "$MAPCNTRLMNU_PANDOWN", "+am_pandown" + + StaticText "" MapControl "$MAPCNTRLMNU_ZOOMIN", "+am_zoomin" MapControl "$MAPCNTRLMNU_ZOOMOUT", "+am_zoomout" + + StaticText "" MapControl "$MAPCNTRLMNU_TOGGLEZOOM", "am_gobig" MapControl "$MAPCNTRLMNU_TOGGLEFOLLOW", "am_togglefollow" MapControl "$MAPCNTRLMNU_TOGGLEGRID", "am_togglegrid" MapControl "$MAPCNTRLMNU_TOGGLETEXTURE", "am_toggletexture" + + StaticText "" MapControl "$MAPCNTRLMNU_SETMARK", "am_setmark" MapControl "$MAPCNTRLMNU_CLEARMARK", "am_clearmarks" } @@ -1468,6 +1491,7 @@ OptionValue JumpCrouchFreeLook OptionMenu GameplayOptions protected { + Position -35 Title "$GMPLYMNU_TITLE" //Indent 222 Submenu "$GMPLYMNU_DEATHMATCH", "DeathmatchOptions" @@ -1510,6 +1534,7 @@ OptionMenu GameplayOptions protected OptionMenu DeathmatchOptions protected { + Position -35 Title "$GMPLYMNU_DEATHMATCH" Option "$GMPLYMNU_WEAPONSSTAY", "sv_weaponstay", "YesNo" @@ -1530,6 +1555,7 @@ OptionMenu DeathmatchOptions protected OptionMenu CoopOptions protected { + Position -35 Title "$GMPLYMNU_COOPERATIVE" Option "$GMPLYMNU_MULTIPLAYERWEAPONS", "sv_noweaponspawn", "NoYes" @@ -1564,6 +1590,7 @@ OptionValue CompatModes OptionMenu "CompatibilityOptions" protected { + Position -35 Title "$CMPTMNU_TITLE" Option "$CMPTMNU_MODE", "compatmode", "CompatModes", "", 1 StaticText " " @@ -1578,6 +1605,7 @@ OptionMenu "CompatibilityOptions" protected OptionMenu "CompatActorMenu" protected { + Position -35 Title "$CMPTMNU_ACTORBEHAVIOR" Option "$CMPTMNU_CORPSEGIBS", "compat_CORPSEGIBS", "YesNo" Option "$CMPTMNU_NOBLOCKFRIENDS", "compat_NOBLOCKFRIENDS", "YesNo" @@ -1593,6 +1621,7 @@ OptionMenu "CompatActorMenu" protected OptionMenu "CompatDehackedMenu" protected { + Position -35 Title "$CMPTMNU_DEHACKEDBEHAVIOR" Option "$CMPTMNU_DEHHEALTH", "compat_DEHHEALTH", "YesNo" Option "$CMPTMNU_MUSHROOM", "compat_MUSHROOM", "YesNo" @@ -1601,6 +1630,7 @@ OptionMenu "CompatDehackedMenu" protected OptionMenu "CompatMapMenu" protected { + Position -35 Title "$CMPTMNU_MAPACTIONBEHAVIOR" Option "$CMPTMNU_USEBLOCKING", "compat_USEBLOCKING", "YesNo" Option "$CMPTMNU_ANYBOSSDEATH", "compat_ANYBOSSDEATH", "YesNo" @@ -1619,6 +1649,7 @@ OptionMenu "CompatMapMenu" protected OptionMenu "CompatPhysicsMenu" protected { + Position -35 Title "$CMPTMNU_PHYSICSBEHAVIOR" Option "$CMPTMNU_NOPASSOVER", "compat_nopassover", "YesNo" Option "$CMPTMNU_BOOMSCROLL", "compat_BOOMSCROLL", "YesNo" @@ -1634,6 +1665,7 @@ OptionMenu "CompatPhysicsMenu" protected OptionMenu "CompatRenderMenu" protected { + Position -35 Title "$CMPTMNU_RENDERINGBEHAVIOR" Option "$CMPTMNU_POLYOBJ", "compat_POLYOBJ", "YesNo" Option "$CMPTMNU_MASKEDMIDTEX", "compat_MASKEDMIDTEX", "YesNo" @@ -1643,6 +1675,7 @@ OptionMenu "CompatRenderMenu" protected OptionMenu "CompatSoundMenu" protected { + Position -35 Title "$CMPTMNU_SOUNDBEHAVIOR" Option "$CMPTMNU_SOUNDSLOTS", "compat_soundslots", "YesNo" Option "$CMPTMNU_SILENTPICKUP", "compat_SILENTPICKUP", "YesNo" @@ -2606,3 +2639,21 @@ OptionString "LanguageOptions" "ptb", "Português do Brasil (PTB)" "rus", "Русский (RU)" } + +/*======================================= + * + * Option Search menu + * + *=======================================*/ + +OptionMenu "os_Menu" +{ + Class "os_Menu" + Title "$OS_TITLE" +} + +OptionValue "os_isanyof_values" +{ + 0, "$OS_ALL" + 1, "$OS_ANY" +} diff --git a/wadsrc/static/zscript.txt b/wadsrc/static/zscript.txt index 705f29798..510adc8f5 100644 --- a/wadsrc/static/zscript.txt +++ b/wadsrc/static/zscript.txt @@ -253,6 +253,11 @@ version "3.8" #include "zscript/ui/menu/reverbedit.zs" #include "zscript/ui/menu/textentermenu.zs" +#include "zscript/ui/menu/search/menu.zs" +#include "zscript/ui/menu/search/searchfield.zs" +#include "zscript/ui/menu/search/query.zs" +#include "zscript/ui/menu/search/anyoralloption.zs" + #include "zscript/ui/statscreen/statscreen.zs" #include "zscript/ui/statscreen/statscreen_coop.zs" #include "zscript/ui/statscreen/statscreen_dm.zs" diff --git a/wadsrc/static/zscript/base.zs b/wadsrc/static/zscript/base.zs index 6ff140ca7..ad01ca9a0 100644 --- a/wadsrc/static/zscript/base.zs +++ b/wadsrc/static/zscript/base.zs @@ -23,6 +23,7 @@ struct _ native // These are the global variables, the struct is only here to av native readonly Font bigfont; native readonly Font confont; native readonly Font NewConsoleFont; + native readonly Font NewSmallFont; native readonly Font intermissionfont; native readonly int CleanXFac; native readonly int CleanYFac; diff --git a/wadsrc/static/zscript/ui/menu/colorpickermenu.zs b/wadsrc/static/zscript/ui/menu/colorpickermenu.zs index d7ed52057..b8d9f6444 100644 --- a/wadsrc/static/zscript/ui/menu/colorpickermenu.zs +++ b/wadsrc/static/zscript/ui/menu/colorpickermenu.zs @@ -327,8 +327,7 @@ class ColorpickerMenu : OptionMenu screen.Clear (x + 48*CleanXfac_1, y, x + 48*2*CleanXfac_1, y + 48*CleanYfac_1, newColor); y += 49*CleanYfac_1; - screen.DrawText (SmallFont, Font.CR_GRAY, x+(24-SmallFont.StringWidth("Old")/2)*CleanXfac_1, y, "Old", DTA_CleanNoMove_1, true); - screen.DrawText (SmallFont, Font.CR_WHITE, x+(48+24-SmallFont.StringWidth("New")/2)*CleanXfac_1, y, "New", DTA_CleanNoMove_1, true); + screen.DrawText (SmallFont, Font.CR_GRAY, x+(48-SmallFont.StringWidth("---->")/2)*CleanXfac_1, y, "---->", DTA_CleanNoMove_1, true); } override void OnDestroy() diff --git a/wadsrc/static/zscript/ui/menu/loadsavemenu.zs b/wadsrc/static/zscript/ui/menu/loadsavemenu.zs index 971cb322c..02375e6b4 100644 --- a/wadsrc/static/zscript/ui/menu/loadsavemenu.zs +++ b/wadsrc/static/zscript/ui/menu/loadsavemenu.zs @@ -146,7 +146,6 @@ class LoadSaveMenu : ListMenu commentRight = commentLeft + commentWidth; commentBottom = commentTop + commentHeight; commentRows = commentHeight / rowHeight; - } @@ -191,9 +190,9 @@ class LoadSaveMenu : ListMenu if (manager.SavegameCount() > 0) { String text = (Selected == -1 || !manager.GetSavegame(Selected).bOldVersion)? Stringtable.Localize("$MNU_NOPICTURE") : Stringtable.Localize("$MNU_DIFFVERSION"); - int textlen = SmallFont.StringWidth(text) * CleanXfac; + int textlen = NewSmallFont.StringWidth(text) * CleanXfac; - screen.DrawText (SmallFont, Font.CR_GOLD, savepicLeft+(savepicWidth-textlen)/2, + screen.DrawText (NewSmallFont, Font.CR_GOLD, savepicLeft+(savepicWidth-textlen)/2, savepicTop+(savepicHeight-rowHeight)/2, text, DTA_CleanNoMove, true); } } @@ -206,7 +205,7 @@ class LoadSaveMenu : ListMenu for(int i = 0; i < numlinestoprint; i++) { screen.DrawText(NewConsoleFont, Font.CR_ORANGE, commentLeft / FontScale, (commentTop + rowHeight * i) / FontScale, BrokenSaveComment.StringAt(i), - DTA_VirtualWidthF, screen.GetWidth() / FontScale, DTA_VirtualHeightF, screen.GetHeight() / FontScale); + DTA_VirtualWidthF, screen.GetWidth() / FontScale, DTA_VirtualHeightF, screen.GetHeight() / FontScale, DTA_KeepRatio, true); } @@ -217,10 +216,10 @@ class LoadSaveMenu : ListMenu if (manager.SavegameCount() == 0) { String text = Stringtable.Localize("$MNU_NOFILES"); - int textlen = SmallFont.StringWidth(text) * CleanXfac; + int textlen = NewConsoleFont.StringWidth(text) * FontScale; screen.DrawText (NewConsoleFont, Font.CR_GOLD, (listboxLeft+(listboxWidth-textlen)/2) / FontScale, (listboxTop+(listboxHeight-rowHeight)/2) / FontScale, text, - DTA_VirtualWidthF, screen.GetWidth() / FontScale, DTA_VirtualHeightF, screen.GetHeight() / FontScale); + DTA_VirtualWidthF, screen.GetWidth() / FontScale, DTA_VirtualHeightF, screen.GetHeight() / FontScale, DTA_KeepRatio, true); return; } @@ -255,7 +254,7 @@ class LoadSaveMenu : ListMenu if (!mEntering) { screen.DrawText (NewConsoleFont, colr, (listboxLeft+1) / FontScale, (listboxTop+rowHeight*i + FontScale) / FontScale, node.SaveTitle, - DTA_VirtualWidthF, screen.GetWidth() / FontScale, DTA_VirtualHeightF, screen.GetHeight() / FontScale); + DTA_VirtualWidthF, screen.GetWidth() / FontScale, DTA_VirtualHeightF, screen.GetHeight() / FontScale, DTA_KeepRatio, true); } else { @@ -263,13 +262,13 @@ class LoadSaveMenu : ListMenu int length = NewConsoleFont.StringWidth(s) * FontScale; int displacement = min(0, listboxWidth - 2 - length); screen.DrawText (NewConsoleFont, Font.CR_WHITE, (listboxLeft + 1 + displacement) / FontScale, (listboxTop+rowHeight*i + FontScale) / FontScale, s, - DTA_VirtualWidthF, screen.GetWidth() / FontScale, DTA_VirtualHeightF, screen.GetHeight() / FontScale); + DTA_VirtualWidthF, screen.GetWidth() / FontScale, DTA_VirtualHeightF, screen.GetHeight() / FontScale, DTA_KeepRatio, true); } } else { screen.DrawText (NewConsoleFont, colr, (listboxLeft+1) / FontScale, (listboxTop+rowHeight*i + FontScale) / FontScale, node.SaveTitle, - DTA_VirtualWidthF, screen.GetWidth() / FontScale, DTA_VirtualHeightF, screen.GetHeight() / FontScale); + DTA_VirtualWidthF, screen.GetWidth() / FontScale, DTA_VirtualHeightF, screen.GetHeight() / FontScale, DTA_KeepRatio, true); } screen.ClearClipRect(); j++; @@ -475,6 +474,7 @@ class SaveMenu : LoadSaveMenu manager.InsertNewSaveNode(); TopItem = 0; Selected = manager.ExtractSaveData (-1); + UpdateSaveComment(); } //============================================================================= @@ -614,7 +614,7 @@ class LoadMenu : LoadSaveMenu Super.Init(parent, desc); TopItem = 0; Selected = manager.ExtractSaveData (-1); - + UpdateSaveComment(); } //============================================================================= diff --git a/wadsrc/static/zscript/ui/menu/menu.zs b/wadsrc/static/zscript/ui/menu/menu.zs index 2746f5585..6feee5467 100644 --- a/wadsrc/static/zscript/ui/menu/menu.zs +++ b/wadsrc/static/zscript/ui/menu/menu.zs @@ -285,8 +285,38 @@ class Menu : Object native ui version("2.4") static void DrawConText (int color, int x, int y, String str) { - screen.DrawText (ConFont, color, x, y, str, DTA_CellX, 8 * CleanXfac_1, DTA_CellY, 8 * CleanYfac_1); + screen.DrawText (ConFont, color, x, y, str, DTA_CellX, 8 * CleanXfac, DTA_CellY, 8 * CleanYfac); } + + static int OptionColor(int color) + { + if (color != Font.CR_UNTRANSLATED) return color; + // This needs fixing for mods with custom fonts. + return gameinfo.gametype == GAME_Doom ? Font.CR_RED : gameinfo.gametype == GAME_Chex ? Font.CR_GREEN : gameinfo.gametype == GAME_Strife ? Font.CR_GOLD : Font.CR_GRAY; + } + + static Font OptionFont() + { + return NewSmallFont; + } + + static int OptionHeight() + { + return OptionFont().GetHeight(); + } + + static int OptionWidth(String s) + { + return OptionFont().StringWidth(s); + } + + static void DrawOptionText(int x, int y, int color, String text, bool grayed = false) + { + String label = Stringtable.Localize(text); + int overlay = grayed? Color(96,48,0,0) : 0; + screen.DrawText (OptionFont(), OptionColor(color), x, y, text, DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay); + } + } diff --git a/wadsrc/static/zscript/ui/menu/optionmenu.zs b/wadsrc/static/zscript/ui/menu/optionmenu.zs index c06abf723..c3b7dab52 100644 --- a/wadsrc/static/zscript/ui/menu/optionmenu.zs +++ b/wadsrc/static/zscript/ui/menu/optionmenu.zs @@ -451,7 +451,7 @@ class OptionMenu : Menu } int ytop = y + mDesc.mScrollTop * 8 * CleanYfac_1; - int lastrow = screen.GetHeight() - SmallFont.GetHeight() * CleanYfac_1; + int lastrow = screen.GetHeight() - OptionHeight() * CleanYfac_1; int i; for (i = 0; i < mDesc.mItems.Size() && y <= lastrow; i++) @@ -468,7 +468,7 @@ class OptionMenu : Menu { if (((MenuTime() % 8) < 6) || GetCurrentMenu() != self) { - DrawConText(OptionMenuSettings.mFontColorSelection, cur_indent + 3 * CleanXfac_1, y+fontheight-9*CleanYfac_1, "\xd"); + DrawOptionText(cur_indent + 3 * CleanXfac_1, y, Font.CR_UNTRANSLATED, "◄"); } } y += fontheight; @@ -480,11 +480,11 @@ class OptionMenu : Menu if (CanScrollUp) { - DrawConText(Font.CR_ORANGE, 3 * CleanXfac_1, ytop, "\x1a"); + DrawOptionText(screen.GetWidth() - 11 * CleanXfac_1, ytop, Font.CR_UNTRANSLATED, "▲"); } if (CanScrollDown) { - DrawConText(Font.CR_ORANGE, 3 * CleanXfac_1, y - 8*CleanYfac_1, "\x1b"); + DrawOptionText(screen.GetWidth() - 11 * CleanXfac_1 , y - 8*CleanYfac_1, Font.CR_UNTRANSLATED, "▼"); } Super.Drawer(); } @@ -519,8 +519,8 @@ class GameplayMenu : OptionMenu Super.Drawer(); String s = String.Format("dmflags = %d dmflags2 = %d", dmflags, dmflags2); - screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue, - (screen.GetWidth() - SmallFont.StringWidth (s) * CleanXfac_1) / 2, 0, s, + screen.DrawText (OptionFont(), OptionMenuSettings.mFontColorValue, + (screen.GetWidth() - OptionWidth (s) * CleanXfac_1) / 2, 35 * CleanXfac_1, s, DTA_CleanNoMove_1, true); } } @@ -532,8 +532,8 @@ class CompatibilityMenu : OptionMenu Super.Drawer(); String s = String.Format("compatflags = %d compatflags2 = %d", compatflags, compatflags2); - screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue, - (screen.GetWidth() - SmallFont.StringWidth (s) * CleanXfac_1) / 2, 0, s, + screen.DrawText (OptionFont(), OptionMenuSettings.mFontColorValue, + (screen.GetWidth() - OptionWidth (s) * CleanXfac_1) / 2, 35 * CleanXfac_1, s, DTA_CleanNoMove_1, true); } } diff --git a/wadsrc/static/zscript/ui/menu/optionmenuitems.zs b/wadsrc/static/zscript/ui/menu/optionmenuitems.zs index df955bb78..19fb0429d 100644 --- a/wadsrc/static/zscript/ui/menu/optionmenuitems.zs +++ b/wadsrc/static/zscript/ui/menu/optionmenuitems.zs @@ -44,19 +44,28 @@ class OptionMenuItem : MenuItemBase mCentered = center; } + protected void drawText(int x, int y, int color, String text, bool grayed = false) + { + Menu.DrawOptionText(x, y, color, text, grayed); + } + protected int drawLabel(int indent, int y, int color, bool grayed = false) { String label = Stringtable.Localize(mLabel); - int overlay = grayed? Color(96,48,0,0) : 0; - int x; - int w = SmallFont.StringWidth(label) * CleanXfac_1; + int w = Menu.OptionWidth(label) * CleanXfac_1; if (!mCentered) x = indent - w; else x = (screen.GetWidth() - w) / 2; - screen.DrawText (SmallFont, color, x, y, label, DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay); + Menu.DrawOptionText(x, y, color, label, grayed); return x; } + + protected void drawValue(int indent, int y, int color, String text, bool grayed = false) + { + Menu.DrawOptionText(indent + CursorSpace(), y, color, text, grayed); + } + int CursorSpace() { @@ -71,11 +80,11 @@ class OptionMenuItem : MenuItemBase override int GetIndent() { if (mCentered) return 0; - return SmallFont.StringWidth(Stringtable.Localize(mLabel)); + return Menu.OptionWidth(Stringtable.Localize(mLabel)); } override bool MouseEvent(int type, int x, int y) - { +{ if (Selectable() && type == Menu.MOUSE_Release) { return Menu.GetCurrentMenu().MenuEvent(Menu.MKEY_Enter, true); @@ -140,8 +149,7 @@ class OptionMenuItemLabeledSubmenu : OptionMenuItemSubmenu String text = mLabelCVar.GetString(); if (text.Length() == 0) text = Stringtable.Localize("$notset"); - screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true); - + drawValue(indent, y, OptionMenuSettings.mFontColorValue, text); return indent; } } @@ -286,19 +294,16 @@ class OptionMenuItemOptionBase : OptionMenuItem //============================================================================= override int Draw(OptionMenuDescriptor desc, int y, int indent, bool selected) { - bool grayed = isGrayed(); - if (mCenter) { indent = (screen.GetWidth() / 2); } - drawLabel(indent, y, selected? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor, grayed); + drawLabel(indent, y, selected? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor, isGrayed()); - int overlay = grayed? Color(96,48,0,0) : 0; int Selection = GetSelection(); String text = StringTable.Localize(OptionValues.GetText(mValues, Selection)); if (text.Length() == 0) text = "Unknown"; - screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay); + drawValue(indent, y, OptionMenuSettings.mFontColorValue, text, isGrayed()); return indent; } @@ -502,11 +507,11 @@ class OptionMenuItemControlBase : OptionMenuItem description = KeyBindings.NameKeys (Key1, Key2); if (description.Length() > 0) { - Menu.DrawConText(Font.CR_WHITE, indent + CursorSpace(), y + (OptionMenuSettings.mLinespacing-8)*CleanYfac_1, description); + drawValue(indent, y, Font.CR_WHITE, description); } else { - screen.DrawText(SmallFont, Font.CR_BLACK, indent + CursorSpace(), y + (OptionMenuSettings.mLinespacing-8)*CleanYfac_1, "---", DTA_CleanNoMove_1, true); + drawValue(indent, y, Font.CR_BLACK, "---"); } return indent; } @@ -644,9 +649,9 @@ class OptionMenuItemStaticTextSwitchable : OptionMenuItem override int Draw(OptionMenuDescriptor desc, int y, int indent, bool selected) { String txt = StringTable.Localize(mCurrent? mAltText : mLabel); - int w = SmallFont.StringWidth(txt) * CleanXfac_1; + int w = Menu.OptionWidth(txt) * CleanXfac_1; int x = (screen.GetWidth() - w) / 2; - screen.DrawText (SmallFont, mColor, x, y, txt, DTA_CleanNoMove_1, true); + drawText(x, y, mColor, txt); return -1; } @@ -722,8 +727,8 @@ class OptionMenuSliderBase : OptionMenuItem String textbuf; double range; int maxlen = 0; - int right = x + (12*8 + 4) * CleanXfac_1; - int cy = y + (OptionMenuSettings.mLinespacing-8)*CleanYfac_1; + int right = x + (12*8 + 4) * CleanXfac; // length of slider. This uses the old ConFont and + int cy = y + CleanYFac; range = max - min; double ccur = clamp(cur, min, max) - min; @@ -731,7 +736,7 @@ class OptionMenuSliderBase : OptionMenuItem if (fracdigits >= 0) { textbuf = String.format(formater, max); - maxlen = SmallFont.StringWidth(textbuf) * CleanXfac_1; + maxlen = Menu.OptionWidth(textbuf) * CleanXfac_1; } mSliderShort = right + maxlen > screen.GetWidth(); @@ -746,13 +751,13 @@ class OptionMenuSliderBase : OptionMenuItem // On 320x200 we need a shorter slider Menu.DrawConText(Font.CR_WHITE, x, cy, "\x10\x11\x11\x11\x11\x11\x12"); Menu.DrawConText(Font.FindFontColor(gameinfo.mSliderColor), x + int((5 + ((ccur * 38) / range)) * CleanXfac_1), cy, "\x13"); - right -= 5*8*CleanXfac_1; + right -= 5*8*CleanXfac; } if (fracdigits >= 0 && right + maxlen <= screen.GetWidth()) { textbuf = String.format(formater, cur); - screen.DrawText(SmallFont, Font.CR_DARKGRAY, right, y, textbuf, DTA_CleanNoMove_1, true); + drawText(right, y, Font.CR_DARKGRAY, textbuf); } } @@ -971,9 +976,7 @@ class OptionMenuFieldBase : OptionMenuItem { bool grayed = mGrayCheck != null && !mGrayCheck.GetInt(); drawLabel(indent, y, selected ? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor, grayed); - int overlay = grayed? Color(96, 48, 0, 0) : 0; - - screen.DrawText(SmallFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, Represent(), DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay); + drawValue(indent, y, OptionMenuSettings.mFontColorValue, Represent(), grayed); return indent; } @@ -1022,7 +1025,7 @@ class OptionMenuItemTextField : OptionMenuFieldBase override String Represent() { - if (mEnter) return mEnter.GetText() .. SmallFont.GetCursor(); + if (mEnter) return mEnter.GetText() .. Menu.OptionFont().GetCursor(); else return GetCVarString(); } @@ -1032,7 +1035,7 @@ class OptionMenuItemTextField : OptionMenuFieldBase { // reposition the text so that the cursor is visible when in entering mode. String text = Represent(); - int tlen = SmallFont.StringWidth(text) * CleanXfac_1; + int tlen = Menu.OptionWidth(text) * CleanXfac_1; int newindent = screen.GetWidth() - tlen - CursorSpace(); if (newindent < indent) indent = newindent; } @@ -1044,7 +1047,7 @@ class OptionMenuItemTextField : OptionMenuFieldBase if (mkey == Menu.MKEY_Enter) { Menu.MenuSound("menu/choose"); - mEnter = TextEnterMenu.OpenTextEnter(Menu.GetCurrentMenu(), SmallFont, GetCVarString(), -1, fromcontroller); + mEnter = TextEnterMenu.OpenTextEnter(Menu.GetCurrentMenu(), Menu.OptionFont(), GetCVarString(), -1, fromcontroller); mEnter.ActivateMenu(); return true; } @@ -1156,7 +1159,7 @@ class OptionMenuItemScaleSlider : OptionMenuItemSlider if ((Selection == 0 || Selection == -1) && mClickVal <= 0) { String text = Selection == 0? TextZero : Selection == -1? TextNegOne : ""; - screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true); + drawValue(indent, y, OptionMenuSettings.mFontColorValue, text); } else { diff --git a/wadsrc/static/zscript/ui/menu/reverbedit.zs b/wadsrc/static/zscript/ui/menu/reverbedit.zs index 7bc799797..65fa5158e 100644 --- a/wadsrc/static/zscript/ui/menu/reverbedit.zs +++ b/wadsrc/static/zscript/ui/menu/reverbedit.zs @@ -132,8 +132,7 @@ class OptionMenuItemReverbSelect : OptionMenuItemSubMenu int x = drawLabel(indent, y, selected? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor); String text = ReverbEdit.GetSelectedEnvironment(); - screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true); - + drawValue(indent, y, OptionMenuSettings.mFontColorValue, text); return indent; } } @@ -210,7 +209,7 @@ class OptionMenuItemSliderReverbEditOption : OptionMenuSliderBase virtual String Represent() { - return mEnter.GetText() .. SmallFont.GetCursor(); + return mEnter.GetText() .. Menu.OptionFont().GetCursor(); } //============================================================================= @@ -221,7 +220,7 @@ class OptionMenuItemSliderReverbEditOption : OptionMenuSliderBase mDrawX = indent + CursorSpace(); if (mEnter) { - screen.DrawText(SmallFont, OptionMenuSettings.mFontColorValue, mDrawX, y, Represent(), DTA_CleanNoMove_1, true); + drawText(mDrawX, y, OptionMenuSettings.mFontColorValue, Represent()); } else { @@ -235,7 +234,7 @@ class OptionMenuItemSliderReverbEditOption : OptionMenuSliderBase if (mkey == Menu.MKEY_Enter) { Menu.MenuSound("menu/choose"); - mEnter = TextEnterMenu.OpenTextEnter(Menu.GetCurrentMenu(), SmallFont, String.Format("%.3f", GetSliderValue()), -1, fromcontroller); + mEnter = TextEnterMenu.OpenTextEnter(Menu.GetCurrentMenu(), Menu.OptionFont(), String.Format("%.3f", GetSliderValue()), -1, fromcontroller); mEnter.ActivateMenu(); return true; } diff --git a/wadsrc/static/zscript/ui/menu/search/anyoralloption.zs b/wadsrc/static/zscript/ui/menu/search/anyoralloption.zs new file mode 100644 index 000000000..69c1f53f9 --- /dev/null +++ b/wadsrc/static/zscript/ui/menu/search/anyoralloption.zs @@ -0,0 +1,33 @@ +//============================================================================= +// +// os_AnyOrAllOption class represents an Option Item for Option Search menu. +// Changing the value of this option causes the menu to refresh the search +// results. +// +//============================================================================= + +class os_AnyOrAllOption : OptionMenuItemOption +{ + os_AnyOrAllOption Init(os_Menu menu) + { + Super.Init("", "os_isanyof", "os_isanyof_values"); + + mMenu = menu; + + return self; + } + + override bool MenuEvent(int mkey, bool fromcontroller) + { + bool result = Super.MenuEvent(mkey, fromcontroller); + + if (mKey == Menu.MKEY_Left || mKey == Menu.MKEY_Right) + { + mMenu.search(); + } + + return result; + } + + private os_Menu mMenu; +} diff --git a/wadsrc/static/zscript/ui/menu/search/menu.zs b/wadsrc/static/zscript/ui/menu/search/menu.zs new file mode 100644 index 000000000..423be0250 --- /dev/null +++ b/wadsrc/static/zscript/ui/menu/search/menu.zs @@ -0,0 +1,218 @@ +//============================================================================= +// +// Option Search Menu class. +// This menu contains search field, and is dynamically filled with search +// results. +// +//============================================================================= + +class os_Menu : OptionMenu +{ + override void Init(Menu parent, OptionMenuDescriptor desc) + { + Super.Init(parent, desc); + + mDesc.mItems.clear(); + + addSearchField(); + + mDesc.mScrollPos = 0; + mDesc.mSelectedItem = 0; + mDesc.CalcIndent(); + } + + void search() + { + string text = mSearchField.GetText(); + let query = os_Query.fromString(text); + bool isAnyTermMatches = mIsAnyOfItem.mCVar.GetBool(); + + mDesc.mItems.clear(); + + addSearchField(text); + + bool found = listOptions(mDesc, "MainMenu", query, "", isAnyTermMatches); + + if (!found) { addNoResultsItem(mDesc); } + + mDesc.CalcIndent(); + } + + private void addSearchField(string query = "") + { + string searchLabel = StringTable.Localize("$OS_LABEL"); + + mSearchField = new("os_SearchField").Init(searchLabel, self, query); + mIsAnyOfItem = new("os_AnyOrAllOption").Init(self); + + mDesc.mItems.push(mSearchField); + mDesc.mItems.push(mIsAnyOfItem); + addEmptyLine(mDesc); + } + + private static bool listOptions(OptionMenuDescriptor targetDesc, + string menuName, + os_Query query, + string path, + bool isAnyTermMatches) + { + let desc = MenuDescriptor.GetDescriptor(menuName); + let listMenuDesc = ListMenuDescriptor(desc); + + if (listMenuDesc) + { + return listOptionsListMenu(listMenuDesc, targetDesc, query, path, isAnyTermMatches); + } + + let optionMenuDesc = OptionMenuDescriptor(desc); + + if (optionMenuDesc) + { + return listOptionsOptionMenu(optionMenuDesc, targetDesc, query, path, isAnyTermMatches); + } + + return false; + } + + private static bool listOptionsListMenu(ListMenuDescriptor sourceDesc, + OptionMenuDescriptor targetDesc, + os_Query query, + string path, + bool isAnyTermMatches) + { + int nItems = sourceDesc.mItems.size(); + bool found = false; + + for (int i = 0; i < nItems; ++i) + { + let item = sourceDesc.mItems[i]; + string actionN = item.GetAction(); + let textItem = ListMenuItemTextItem(item); + string newPath = textItem + ? makePath(path, textItem.mText) + : path; + + found |= listOptions(targetDesc, actionN, query, newPath, isAnyTermMatches); + } + + return found; + } + + private static bool listOptionsOptionMenu(OptionMenuDescriptor sourceDesc, + OptionMenuDescriptor targetDesc, + os_Query query, + string path, + bool isAnyTermMatches) + { + if (sourceDesc == targetDesc) { return false; } + + int nItems = sourceDesc.mItems.size(); + bool first = true; + bool found = false; + + for (int i = 0; i < nItems; ++i) + { + let item = sourceDesc.mItems[i]; + + if (item is "OptionMenuItemStaticText") { continue; } + + string label = StringTable.Localize(item.mLabel); + + if (!query.matches(label, isAnyTermMatches)) { continue; } + + found = true; + + if (first) + { + addEmptyLine(targetDesc); + addPathItem(targetDesc, path); + + first = false; + } + + let itemOptionBase = OptionMenuItemOptionBase(item); + + if (itemOptionBase) + { + itemOptionBase.mCenter = false; + } + + targetDesc.mItems.push(item); + } + + for (int i = 0; i < nItems; ++i) + { + let item = sourceDesc.mItems[i]; + string label = StringTable.Localize(item.mLabel); + string optionSearchTitle = StringTable.Localize("$OS_TITLE"); + + if (label == optionSearchTitle) { continue; } + + if (item is "OptionMenuItemSubMenu") + { + string newPath = makePath(path, label); + + found |= listOptions(targetDesc, item.GetAction(), query, newPath, isAnyTermMatches); + } + } + + return found; + } + + private static string makePath(string path, string label) + { + if (path.length() == 0) { return label; } + + int pathWidth = SmallFont.StringWidth(path .. "/" .. label); + int screenWidth = Screen.GetWidth(); + bool isTooWide = (pathWidth > screenWidth / 3); + string newPath = isTooWide + ? path .. "/" .. "\n" .. label + : path .. "/" .. label; + + return newPath; + } + + private static void addPathItem(OptionMenuDescriptor desc, string path) + { + Array lines; + path.split(lines, "\n"); + + int nLines = lines.size(); + + for (int i = 0; i < nLines; ++i) + { + OptionMenuItemStaticText text = new("OptionMenuItemStaticText").Init(lines[i], 1); + + desc.mItems.push(text); + } + } + + private static void addEmptyLine(OptionMenuDescriptor desc) + { + int nItems = desc.mItems.size(); + + if (nItems > 0) + { + let staticText = OptionMenuItemStaticText(desc.mItems[nItems - 1]); + + if (staticText != null && staticText.mLabel == "") { return; } + } + + let item = new("OptionMenuItemStaticText").Init(""); + + desc.mItems.push(item); + } + + private static void addNoResultsItem(OptionMenuDescriptor desc) + { + string noResults = StringTable.Localize("$OS_NO_RESULTS"); + let text = new("OptionMenuItemStaticText").Init(noResults, 0); + + addEmptyLine(desc); + desc.mItems.push(text); + } + + private os_AnyOrAllOption mIsAnyOfItem; + private os_SearchField mSearchField; +} diff --git a/wadsrc/static/zscript/ui/menu/search/query.zs b/wadsrc/static/zscript/ui/menu/search/query.zs new file mode 100644 index 000000000..691a85b59 --- /dev/null +++ b/wadsrc/static/zscript/ui/menu/search/query.zs @@ -0,0 +1,73 @@ +//============================================================================= +// +// Option Search Query class represents a search query. +// A search query consists constists of one or more terms (words). +// +// Query matching deponds on "os_is_any_of" variable. +// If this variable is "true", the text matches the query if any of the terms +// matches the query. +// If this variable is "false", the text matches the query only if all the +// terms match the query. +// +//============================================================================= + +class os_Query +{ + static os_Query fromString(string str) + { + let query = new("os_Query"); + + str.Split(query.mQueryParts, " ", TOK_SKIPEMPTY); + + return query; + } + + bool matches(string text, bool isSearchForAny) + { + return isSearchForAny + ? matchesAny(text) + : matchesAll(text); + } + + // private: ////////////////////////////////////////////////////////////////// + + private bool matchesAny(string text) + { + int nParts = mQueryParts.size(); + + for (int i = 0; i < nParts; ++i) + { + string queryPart = mQueryParts[i]; + + if (contains(text, queryPart)) { return true; } + } + + return false; + } + + private bool matchesAll(string text) + { + int nParts = mQueryParts.size(); + + for (int i = 0; i < nParts; ++i) + { + string queryPart = mQueryParts[i]; + + if (!contains(text, queryPart)) { return false; } + } + + return true; + } + + private static bool contains(string str, string substr) + { + str .toLower(); + substr.toLower(); + + bool contains = (str.IndexOf(substr) != -1); + + return contains; + } + + private Array mQueryParts; +} diff --git a/wadsrc/static/zscript/ui/menu/search/searchfield.zs b/wadsrc/static/zscript/ui/menu/search/searchfield.zs new file mode 100644 index 000000000..8a0d962bb --- /dev/null +++ b/wadsrc/static/zscript/ui/menu/search/searchfield.zs @@ -0,0 +1,52 @@ +//============================================================================= +// +// Option Search Field class. +// +// When the search query is entered, makes Search Menu perform a search. +// +//============================================================================= + +class os_SearchField : OptionMenuItemTextField +{ + os_SearchField Init(String label, os_Menu menu, string query) + { + Super.Init(label, ""); + + mMenu = menu; + + mText = query; + + return self; + } + + override bool MenuEvent(int mkey, bool fromcontroller) + { + if (mkey == Menu.MKEY_Enter) + { + Menu.MenuSound("menu/choose"); + mEnter = TextEnterMenu.OpenTextEnter(Menu.GetCurrentMenu(), SmallFont, mText, -1, fromcontroller); + mEnter.ActivateMenu(); + return true; + } + if (mkey == Menu.MKEY_Input) + { + mtext = mEnter.GetText(); + + mMenu.search(); + } + + return Super.MenuEvent(mkey, fromcontroller); + } + + override String Represent() + { + return mEnter + ? mEnter.GetText() .. SmallFont.GetCursor() + : mText; + } + + String GetText() { return mText; } + + private os_Menu mMenu; + private string mText; +} diff --git a/wadsrc/static/zscript/ui/menu/textentermenu.zs b/wadsrc/static/zscript/ui/menu/textentermenu.zs index 328c7aa94..f910eb8f4 100644 --- a/wadsrc/static/zscript/ui/menu/textentermenu.zs +++ b/wadsrc/static/zscript/ui/menu/textentermenu.zs @@ -84,7 +84,7 @@ class TextEnterMenu : Menu deprecated("3.8") static TextEnterMenu Open(Menu parent, String textbuffer, int maxlen, int sizemode, bool showgrid = false, bool allowcolors = false) { let me = new("TextEnterMenu"); - me.Init(parent, SmallFont, textbuffer, maxlen*8, showgrid, allowcolors); + me.Init(parent, Menu.OptionFont(), textbuffer, maxlen*8, showgrid, allowcolors); return me; } diff --git a/wadsrc/static/zscript/ui/statscreen/statscreen.zs b/wadsrc/static/zscript/ui/statscreen/statscreen.zs index 1cf100198..fe9becad9 100644 --- a/wadsrc/static/zscript/ui/statscreen/statscreen.zs +++ b/wadsrc/static/zscript/ui/statscreen/statscreen.zs @@ -353,6 +353,53 @@ class StatusScreen abstract play version("2.5") } } + //==================================================================== + // + // + //==================================================================== + + void drawTextScaled (Font fnt, double x, double y, String text, double scale, int translation = Font.CR_UNTRANSLATED) + { + screen.DrawText(fnt, translation, x / scale, y / scale, text, DTA_VirtualWidthF, screen.GetWidth() / scale, DTA_VirtualHeightF, screen.GetHeight() / scale); + } + + //==================================================================== + // + // + //==================================================================== + + void drawNumScaled (Font fnt, int x, int y, double scale, int n, int digits, int translation = Font.CR_UNTRANSLATED) + { + String s = String.Format("%d", n); + drawTextScaled(fnt, x - fnt.StringWidth(s) * scale, y, s, scale, translation); + } + + //==================================================================== + // + // + // + //==================================================================== + + void drawPercentScaled (Font fnt, int x, int y, int p, int b, double scale, bool show_total = true, int color = Font.CR_UNTRANSLATED) + { + if (p < 0) return; + + String s; + if (wi_percents) + { + s = String.Format("%d%%", b == 0 ? 100 : p * 100 / b); + } + else if (show_total) + { + s = String.Format("%d/%3d", p, b); + } + else + { + s = String.Format("%d", p); + } + drawTextScaled(fnt, x - fnt.StringWidth(s) * scale, y, s, scale, color); + } + //==================================================================== // // Display level completion time and par, or "sucks" message if overflow. diff --git a/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs b/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs index fb82cb36b..3c19243d4 100644 --- a/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs +++ b/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs @@ -2,6 +2,9 @@ class CoopStatusScreen : StatusScreen { int textcolor; + double FontScale; + int RowHeight; + Font displayFont; //==================================================================== // @@ -11,11 +14,14 @@ class CoopStatusScreen : StatusScreen override void initStats () { - textcolor = (gameinfo.gametype & GAME_Raven) ? Font.CR_GREEN : Font.CR_UNTRANSLATED; + textcolor = Font.CR_GRAY; CurState = StatCount; acceleratestage = 0; ng_state = 1; + displayFont = NewSmallFont; + FontScale = max(screen.GetHeight() / 480, 1); + RowHeight = max((displayFont.GetHeight() + 1) * FontScale, 1); cnt_pause = Thinker.TICRATE; @@ -223,7 +229,7 @@ class CoopStatusScreen : StatusScreen Vector2 readyoffset = TexMan.GetScaledOffset(readyico); height = int(readysize.Y - readyoffset.Y); maxiconheight = MAX(height, maxiconheight); - height = SmallFont.GetHeight() * CleanYfac; + height = displayFont.GetHeight() * FontScale; lineheight = MAX(height, maxiconheight * CleanYfac); ypadding = (lineheight - height + 1) / 2; y += CleanYfac; @@ -232,11 +238,11 @@ class CoopStatusScreen : StatusScreen text_secret = Stringtable.Localize("$SCORE_SECRET"); text_kills = Stringtable.Localize("$SCORE_KILLS"); - icon_x = 8 * CleanXfac; - name_x = icon_x + maxscorewidth * CleanXfac; - kills_x = name_x + (maxnamewidth + MAX(SmallFont.StringWidth("XXXXX"), SmallFont.StringWidth(text_kills)) + 8) * CleanXfac; - bonus_x = kills_x + ((bonus_len = SmallFont.StringWidth(text_bonus)) + 8) * CleanXfac; - secret_x = bonus_x + ((secret_len = SmallFont.StringWidth(text_secret)) + 8) * CleanXfac; + icon_x = 8 * FontScale; + name_x = icon_x + maxscorewidth * FontScale; + kills_x = name_x + (maxnamewidth + 1 + MAX(displayFont.StringWidth("XXXXXXXXXX"), displayFont.StringWidth(text_kills)) + 16) * FontScale; + bonus_x = kills_x + ((bonus_len = displayFont.StringWidth(text_bonus)) + 16) * FontScale; + secret_x = bonus_x + ((secret_len = displayFont.StringWidth(text_secret)) + 16) * FontScale; x = (screen.GetWidth() - secret_x) >> 1; icon_x += x; @@ -246,11 +252,11 @@ class CoopStatusScreen : StatusScreen secret_x += x; - screen.DrawText(SmallFont, textcolor, name_x, y, Stringtable.Localize("$SCORE_NAME"), DTA_CleanNoMove, true); - screen.DrawText(SmallFont, textcolor, kills_x - SmallFont.StringWidth(text_kills)*CleanXfac, y, text_kills, DTA_CleanNoMove, true); - screen.DrawText(SmallFont, textcolor, bonus_x - bonus_len*CleanXfac, y, text_bonus, DTA_CleanNoMove, true); - screen.DrawText(SmallFont, textcolor, secret_x - secret_len*CleanXfac, y, text_secret, DTA_CleanNoMove, true); - y += height + 6 * CleanYfac; + drawTextScaled(displayFont, name_x, y, Stringtable.Localize("$SCORE_NAME"), FontScale, textcolor); + drawTextScaled(displayFont, kills_x - displayFont.StringWidth(text_kills) * FontScale, y, text_kills, FontScale, textcolor); + drawTextScaled(displayFont, bonus_x - bonus_len * FontScale, y, text_bonus, FontScale, textcolor); + drawTextScaled(displayFont, secret_x - secret_len * FontScale, y, text_secret, FontScale, textcolor); + y += height + 6 * FontScale; missed_kills = wbs.maxkills; missed_items = wbs.maxitems; @@ -274,16 +280,16 @@ class CoopStatusScreen : StatusScreen { screen.DrawTexture(player.mo.ScoreIcon, true, icon_x, y, DTA_CleanNoMove, true); } - screen.DrawText(SmallFont, thiscolor, name_x, y + ypadding, player.GetUserName(), DTA_CleanNoMove, true); - drawPercent(SmallFont, kills_x, y + ypadding, cnt_kills[i], wbs.maxkills, false, thiscolor, true); + drawTextScaled(displayFont, name_x, y + ypadding, player.GetUserName(), FontScale, thiscolor); + drawPercentScaled(displayFont, kills_x, y + ypadding, cnt_kills[i], wbs.maxkills, FontScale, thiscolor); missed_kills -= cnt_kills[i]; if (ng_state >= 4) { - drawPercent(SmallFont, bonus_x, y + ypadding, cnt_items[i], wbs.maxitems, false, thiscolor, true); + drawPercentScaled(displayFont, bonus_x, y + ypadding, cnt_items[i], wbs.maxitems, FontScale, thiscolor); missed_items -= cnt_items[i]; if (ng_state >= 6) { - drawPercent(SmallFont, secret_x, y + ypadding, cnt_secret[i], wbs.maxsecret, false, thiscolor, true); + drawPercentScaled(displayFont, secret_x, y + ypadding, cnt_secret[i], wbs.maxsecret, FontScale, thiscolor); missed_secrets -= cnt_secret[i]; } } @@ -292,28 +298,28 @@ class CoopStatusScreen : StatusScreen // Draw "MISSED" line y += 3 * CleanYfac; - screen.DrawText(SmallFont, Font.CR_DARKGRAY, name_x, y, Stringtable.Localize("$SCORE_MISSED"), DTA_CleanNoMove, true); - drawPercent(SmallFont, kills_x, y, missed_kills, wbs.maxkills, false, Font.CR_DARKGRAY, true); + drawTextScaled(displayFont, name_x, y, Stringtable.Localize("$SCORE_MISSED"), FontScale, Font.CR_DARKGRAY); + drawPercentScaled(displayFont, kills_x, y, missed_kills, wbs.maxkills, FontScale, Font.CR_DARKGRAY); if (ng_state >= 4) { - drawPercent(SmallFont, bonus_x, y, missed_items, wbs.maxitems, false, Font.CR_DARKGRAY, true); + drawPercentScaled(displayFont, bonus_x, y, missed_items, wbs.maxitems, FontScale, Font.CR_DARKGRAY); if (ng_state >= 6) { - drawPercent(SmallFont, secret_x, y, missed_secrets, wbs.maxsecret, false, Font.CR_DARKGRAY, true); + drawPercentScaled(displayFont, secret_x, y, missed_secrets, wbs.maxsecret, FontScale, Font.CR_DARKGRAY); } } // Draw "TOTAL" line y += height + 3 * CleanYfac; - screen.DrawText(SmallFont, textcolor, name_x, y, Stringtable.Localize("$SCORE_TOTAL"), DTA_CleanNoMove, true); - drawNum(SmallFont, kills_x, y, wbs.maxkills, 0, false, textcolor, true); + drawTextScaled(displayFont, name_x, y, Stringtable.Localize("$SCORE_TOTAL"), FontScale, textcolor); + drawNumScaled(displayFont, kills_x, y, FontScale, wbs.maxkills, 0, textcolor); if (ng_state >= 4) { - drawNum(SmallFont, bonus_x, y, wbs.maxitems, 0, false, textcolor, true); + drawNumScaled(displayFont, bonus_x, y, FontScale, wbs.maxitems, 0, textcolor); if (ng_state >= 6) { - drawNum(SmallFont, secret_x, y, wbs.maxsecret, 0, false, textcolor, true); + drawNumScaled(displayFont, secret_x, y, FontScale, wbs.maxsecret, 0, textcolor); } } } -} \ No newline at end of file +} diff --git a/wadsrc/static/zscript/ui/statusbar/alt_hud.zs b/wadsrc/static/zscript/ui/statusbar/alt_hud.zs index f8befa09f..f3161df8d 100644 --- a/wadsrc/static/zscript/ui/statusbar/alt_hud.zs +++ b/wadsrc/static/zscript/ui/statusbar/alt_hud.zs @@ -170,14 +170,30 @@ class AltHud ui void DrawStatLine(int x, in out int y, String prefix, String text) { - y -= SmallFont.GetHeight()-1; - screen.DrawText(SmallFont, hudcolor_statnames, x, y, prefix, - DTA_KeepRatio, true, - DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0.75); + if (!hud_althudfont) + { + y -= SmallFont.GetHeight()-1; + screen.DrawText(SmallFont, hudcolor_statnames, x, y, prefix, + DTA_KeepRatio, true, + DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0.75); - screen.DrawText(SmallFont, hudcolor_stats, x+statspace, y, text, - DTA_KeepRatio, true, - DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0.75); + screen.DrawText(SmallFont, hudcolor_stats, x+statspace, y, text, + DTA_KeepRatio, true, + DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0.75); + } + else + { + double horzscale = 1.5; + int downscale = 2; + y -= NewSmallFont.GetHeight() / downscale; + screen.DrawText(NewSmallFont, hudcolor_statnames, x * horzscale, y * downscale, prefix, + DTA_KeepRatio, true, + DTA_VirtualWidthF, hudwidth * horzscale, DTA_VirtualHeight, hudheight * downscale, DTA_Alpha, 0.75); + + screen.DrawText(NewSmallFont, hudcolor_stats, (x+statspace) * horzscale, y * downscale, text, + DTA_KeepRatio, true, + DTA_VirtualWidthF, hudwidth * horzscale, DTA_VirtualHeight, hudheight * downscale, DTA_Alpha, 0.75); + } } void DrawStatus(PlayerInfo CPlayer, int x, int y) diff --git a/wadsrc_extra/static/filter/game-doom/fonts/bigfont/003C.lmp b/wadsrc_extra/static/filter/game-doom/fonts/bigfont/003C.lmp index 7a664bb04..454177945 100644 Binary files a/wadsrc_extra/static/filter/game-doom/fonts/bigfont/003C.lmp and b/wadsrc_extra/static/filter/game-doom/fonts/bigfont/003C.lmp differ diff --git a/wadsrc_extra/static/filter/game-doom/fonts/bigfont/00AB.lmp b/wadsrc_extra/static/filter/game-doom/fonts/bigfont/00AB.lmp new file mode 100644 index 000000000..dcbc89ed8 Binary files /dev/null and b/wadsrc_extra/static/filter/game-doom/fonts/bigfont/00AB.lmp differ diff --git a/wadsrc_extra/static/filter/game-doom/fonts/bigfont/00BB.lmp b/wadsrc_extra/static/filter/game-doom/fonts/bigfont/00BB.lmp new file mode 100644 index 000000000..04ec5c94b Binary files /dev/null and b/wadsrc_extra/static/filter/game-doom/fonts/bigfont/00BB.lmp differ diff --git a/wadsrc_extra/static/filter/game-doom/fonts/bigupper/003C.lmp b/wadsrc_extra/static/filter/game-doom/fonts/bigupper/003C.lmp index 5caa69157..09c814b42 100644 Binary files a/wadsrc_extra/static/filter/game-doom/fonts/bigupper/003C.lmp and b/wadsrc_extra/static/filter/game-doom/fonts/bigupper/003C.lmp differ diff --git a/wadsrc_extra/static/filter/game-doom/fonts/bigupper/00AB.lmp b/wadsrc_extra/static/filter/game-doom/fonts/bigupper/00AB.lmp new file mode 100644 index 000000000..6df87047c Binary files /dev/null and b/wadsrc_extra/static/filter/game-doom/fonts/bigupper/00AB.lmp differ diff --git a/wadsrc_extra/static/filter/game-doom/fonts/bigupper/00BB.lmp b/wadsrc_extra/static/filter/game-doom/fonts/bigupper/00BB.lmp new file mode 100644 index 000000000..6cec10b6f Binary files /dev/null and b/wadsrc_extra/static/filter/game-doom/fonts/bigupper/00BB.lmp differ diff --git a/wadsrc_extra/static/filter/game-heretic/fonts/defbigfont/00AB.lmp b/wadsrc_extra/static/filter/game-heretic/fonts/defbigfont/00AB.lmp new file mode 100644 index 000000000..1aec36d6c Binary files /dev/null and b/wadsrc_extra/static/filter/game-heretic/fonts/defbigfont/00AB.lmp differ diff --git a/wadsrc_extra/static/filter/game-heretic/fonts/defbigfont/00BB.lmp b/wadsrc_extra/static/filter/game-heretic/fonts/defbigfont/00BB.lmp new file mode 100644 index 000000000..b7695ecae Binary files /dev/null and b/wadsrc_extra/static/filter/game-heretic/fonts/defbigfont/00BB.lmp differ diff --git a/wadsrc_extra/static/filter/game-hexen/fonts/defbigfont/00AB.lmp b/wadsrc_extra/static/filter/game-hexen/fonts/defbigfont/00AB.lmp new file mode 100644 index 000000000..86305ddee Binary files /dev/null and b/wadsrc_extra/static/filter/game-hexen/fonts/defbigfont/00AB.lmp differ diff --git a/wadsrc_extra/static/filter/game-hexen/fonts/defbigfont/00BB.lmp b/wadsrc_extra/static/filter/game-hexen/fonts/defbigfont/00BB.lmp new file mode 100644 index 000000000..3117384c4 Binary files /dev/null and b/wadsrc_extra/static/filter/game-hexen/fonts/defbigfont/00BB.lmp differ diff --git a/wadsrc_extra/static/filter/game-strife/fonts/bigfont/00AB.lmp b/wadsrc_extra/static/filter/game-strife/fonts/bigfont/00AB.lmp index 24e73edd0..de9aecf8e 100644 Binary files a/wadsrc_extra/static/filter/game-strife/fonts/bigfont/00AB.lmp and b/wadsrc_extra/static/filter/game-strife/fonts/bigfont/00AB.lmp differ diff --git a/wadsrc_extra/static/filter/game-strife/fonts/bigfont/00BB.lmp b/wadsrc_extra/static/filter/game-strife/fonts/bigfont/00BB.lmp index 7afb1e282..6fb84af8b 100644 Binary files a/wadsrc_extra/static/filter/game-strife/fonts/bigfont/00BB.lmp and b/wadsrc_extra/static/filter/game-strife/fonts/bigfont/00BB.lmp differ diff --git a/wadsrc_extra/static/graphics/m_back_d.png b/wadsrc_extra/static/graphics/m_back_d.png index 2fb4a827d..d9ac14170 100644 Binary files a/wadsrc_extra/static/graphics/m_back_d.png and b/wadsrc_extra/static/graphics/m_back_d.png differ diff --git a/wadsrc_extra/static/graphics/m_back_h.png b/wadsrc_extra/static/graphics/m_back_h.png index fc45dcd7b..c3bcc7194 100644 Binary files a/wadsrc_extra/static/graphics/m_back_h.png and b/wadsrc_extra/static/graphics/m_back_h.png differ diff --git a/wadsrc_extra/static/graphics/m_back_s.png b/wadsrc_extra/static/graphics/m_back_s.png index ab63b4310..8149bb73e 100644 Binary files a/wadsrc_extra/static/graphics/m_back_s.png and b/wadsrc_extra/static/graphics/m_back_s.png differ diff --git a/wadsrc_extra/static/graphics/m_back_x.png b/wadsrc_extra/static/graphics/m_back_x.png index d785b6788..332ffa191 100644 Binary files a/wadsrc_extra/static/graphics/m_back_x.png and b/wadsrc_extra/static/graphics/m_back_x.png differ