- allow localization of Strife's log text.

This commit is contained in:
Christoph Oelckers 2019-02-02 16:56:58 +01:00
parent 64476cde7e
commit 235c4c0499
4 changed files with 7 additions and 4 deletions

View file

@ -923,7 +923,7 @@ class CommandDrawString : public SBarInfoCommand
break;
}
case LOGTEXT:
str = statusBar->CPlayer->LogText;
str = GStrings(statusBar->CPlayer->LogText);
break;
default:
break;

View file

@ -55,6 +55,7 @@
#include "vm.h"
#include "p_acs.h"
#include "sbarinfo.h"
#include "gstrings.h"
#include "events.h"
#include "../version.h"
@ -1064,7 +1065,7 @@ void DBaseStatusBar::DrawLog ()
hudheight = SCREENHEIGHT / scale;
int linelen = hudwidth<640? Scale(hudwidth,9,10)-40 : 560;
auto lines = V_BreakLines (SmallFont, linelen, CPlayer->LogText);
auto lines = V_BreakLines (SmallFont, linelen, GStrings(CPlayer->LogText));
int height = 20;
for (unsigned i = 0; i < lines.Size(); i++) height += SmallFont->GetHeight () + 1;

View file

@ -89,6 +89,7 @@
#include "actorinlines.h"
#include "p_acs.h"
#include "events.h"
#include "gstrings.h"
static FRandom pr_skullpop ("SkullPop");
@ -441,7 +442,7 @@ void player_t::SetLogText (const char *text)
{
// Print log text to console
AddToConsole(-1, TEXTCOLOR_GOLD);
AddToConsole(-1, LogText);
AddToConsole(-1, GStrings(LogText));
AddToConsole(-1, "\n");
}
}

View file

@ -432,7 +432,8 @@ class StrifeStatusBar : BaseStatusBar
if (CPlayer.LogText.Length() > 0)
{
BrokenLines lines = SmallFont2.BreakLines(CPlayer.LogText, 272);
let text = Stringtable.Localize(CPlayer.LogText);
BrokenLines lines = SmallFont2.BreakLines(text, 272);
for (i = 0; i < lines.Count(); ++i)
{
screen.DrawText(SmallFont2, Font.CR_UNTRANSLATED, left + 24 * xscale, top + (18 + i * 12)*yscale,