- update of console code.
Backports con_pulsetext and toggle messages for CVARs from Raze.
This commit is contained in:
parent
c415518066
commit
700304bf46
10 changed files with 44 additions and 7 deletions
|
|
@ -87,8 +87,13 @@ CCMD (toggleconsole)
|
|||
C_ToggleConsole();
|
||||
}
|
||||
|
||||
bool CheckCheatmode (bool printmsg)
|
||||
bool CheckCheatmode (bool printmsg, bool sponly)
|
||||
{
|
||||
if (sponly && netgame)
|
||||
{
|
||||
if (printmsg) Printf("Not in a singleplayer game.\n");
|
||||
return true;
|
||||
}
|
||||
if ((G_SkillProperty(SKILLP_DisableCheats) || netgame || deathmatch) && (!sv_cheats))
|
||||
{
|
||||
if (printmsg) Printf ("sv_cheats must be true to enable this command.\n");
|
||||
|
|
|
|||
|
|
@ -114,6 +114,12 @@ int ConBottom, ConScroll, RowAdjust;
|
|||
uint64_t CursorTicker;
|
||||
constate_e ConsoleState = c_up;
|
||||
|
||||
double NotifyFontScale = 1;
|
||||
|
||||
void C_SetNotifyFontScale(double scale)
|
||||
{
|
||||
NotifyFontScale = scale;
|
||||
}
|
||||
|
||||
static int TopLine, InsertLine;
|
||||
|
||||
|
|
@ -145,6 +151,7 @@ CUSTOM_CVAR(Int, con_scaletext, 0, CVAR_ARCHIVE) // Scale notify text at high r
|
|||
{
|
||||
if (self < 0) self = 0;
|
||||
}
|
||||
CVAR(Bool, con_pulsetext, false, CVAR_ARCHIVE)
|
||||
|
||||
CUSTOM_CVAR(Int, con_scale, 0, CVAR_ARCHIVE)
|
||||
{
|
||||
|
|
@ -931,6 +938,11 @@ int PrintString (int iprintlevel, const char *outline)
|
|||
return 0; // Don't waste time on calculating this if nothing at all was printed...
|
||||
}
|
||||
|
||||
void C_ClearMessages()
|
||||
{
|
||||
NotifyStrings.Clear();
|
||||
}
|
||||
|
||||
int VPrintf (int printlevel, const char *format, va_list parms)
|
||||
{
|
||||
FString outline;
|
||||
|
|
@ -1107,6 +1119,10 @@ void FNotifyBuffer::Draw()
|
|||
continue;
|
||||
|
||||
double alpha = (j < NOTIFYFADETIME) ? 1. * j / NOTIFYFADETIME : 1;
|
||||
if (con_pulsetext)
|
||||
{
|
||||
alpha *= 0.7 + 0.3 * sin(I_msTime() / 100.);
|
||||
}
|
||||
|
||||
if (notify.PrintLevel >= PRINTLEVELS)
|
||||
color = CR_UNTRANSLATED;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue