- fixed the notification display.

This commit is contained in:
Christoph Oelckers 2020-06-30 22:01:43 +02:00
parent e0bd85935a
commit 8aaadfad1b
5 changed files with 15 additions and 22 deletions

View File

@ -46,7 +46,7 @@
static uint64_t FirstFrameStartTime;
static uint64_t CurrentFrameStartTime;
static uint64_t FreezeTime;
int GameTicRate;
int GameTicRate = 35; // make sure it is not 0, even if the client doesn't set it.
double TimeScale = 1.0;

View File

@ -154,7 +154,7 @@ CVAR(Int, developer, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
EXTERN_CVAR(Int, uiscale);
bool generic_ui = true;
CVAR(Bool, generic_ui, false, CVAR_ARCHIVE)
struct History
@ -785,7 +785,7 @@ void FNotifyBuffer::AddString(int printlevel, FString source)
width = screen->GetWidth() / active_con_scaletext(twod, generic_ui);
FFont *font = generic_ui ? NewSmallFont : AlternativeSmallFont;
FFont* font = generic_ui ? NewSmallFont : SmallFont ? SmallFont : AlternativeSmallFont;
if (font == nullptr) return; // Without an initialized font we cannot handle the message (this is for those which come here before the font system is ready.)
if (AddType == APPENDLINE && Text.Size() > 0 && Text[Text.Size() - 1].PrintLevel == printlevel)
@ -905,7 +905,7 @@ int PrintString (int iprintlevel, const char *outline)
I_PrintStr(outline);
conbuffer->AddText(printlevel, outline);
if (vidactive && (iprintlevel & PRINT_NOTIFY))
if (vidactive && (iprintlevel & PRINT_NOTIFY)) // The logic here is inverse to ZDoom because most texts getting here should not be on screem.
{
NotifyStrings.AddString(printlevel, outline);
}
@ -1065,7 +1065,7 @@ void FNotifyBuffer::Tick()
if (i > 0)
{
Text.Delete(0, i);
FFont* font = generic_ui ? NewSmallFont : AlternativeSmallFont;
FFont* font = generic_ui ? NewSmallFont : SmallFont ? SmallFont : AlternativeSmallFont;
Top += font->GetHeight();
}
}
@ -1079,7 +1079,7 @@ void FNotifyBuffer::Draw()
//if (gamestate == GS_FULLCONSOLE || gamestate == GS_DEMOSCREEN/* || menuactive != MENU_Off*/)
//return;
FFont* font = generic_ui ? NewSmallFont : AlternativeSmallFont;
FFont* font = generic_ui ? NewSmallFont : SmallFont? SmallFont : AlternativeSmallFont;
line = Top + font->GetDisplacement();
canskip = true;

View File

@ -230,7 +230,6 @@ void spriteglass(int spriteNum,int glassCnt);
void lotsofcolourglass(int spriteNum,int wallNum,int glassCnt);
void lotsofglass(int spriteNum,int wallnum,int glassCnt);
void G_AddUserQuote(const char *daquote);
void G_BackToMenu(void);
void G_DumpDebugInfo(void);

View File

@ -1951,8 +1951,6 @@ MAIN_LOOP_RESTART:
lockclock = 0;
g_player[myconnectindex].ps->fta = 0;
for (int & q : user_quote_time)
q = 0;
if (ud.warp_on == 1)
{
@ -2152,16 +2150,6 @@ int G_DoMoveThings(void)
if (g_RTSPlaying > 0)
g_RTSPlaying--;
for (int & i : user_quote_time)
{
if (i)
{
if (--i > hud_messagetime)
i = hud_messagetime;
if (!i) pub = NUMPAGES;
}
}
// Name display when aiming at opponents
if (cl_idplayers && (g_netServer || ud.multimode > 1)
)

View File

@ -320,7 +320,10 @@ void P_DoQuote(int32_t q, DukePlayer_t *p)
{
auto qu = quoteMgr.GetQuote(q);
if (p == g_player[screenpeek].ps && qu[0] != '\0')
Printf((cq ? PRINT_LOW : PRINT_MEDIUM) | PRINT_NOTIFY, "%s\n", qu);
{
int printlevel = hud_messages == 1 ? PRINT_MEDIUM : PRINT_MEDIUM | PRINT_NOTIFY;
Printf(printlevel, "%s\n", qu);
}
}
@ -344,8 +347,11 @@ void GameInterface::DoPrintMessage(int prio, const char* t)
if (p->fta > 0)
if (p->ftq == QUOTE_RESERVED || p->ftq == QUOTE_RESERVED2) return;
if (p == g_player[screenpeek].ps)
Printf(prio|PRINT_NOTIFY, cq ? TEXTCOLOR_TAN "%s\n" : "%s\n", t);
if (p == g_player[screenpeek].ps)
{
if (hud_messages == 2) prio |= PRINT_NOTIFY;
Printf(prio, cq ? TEXTCOLOR_TAN "%s\n" : "%s\n", t);
}
if (hud_messages == 1)
{