Merge pull request #1133 from ChillerDragon/ConsolePages

Add commands for switching pages in console
This commit is contained in:
Dennis Felsing 2018-06-06 09:48:00 +02:00 committed by GitHub
commit 08c45ced0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View file

@ -771,6 +771,20 @@ void CGameConsole::ClientConsolePrintCallback(const char *pStr, void *pUserData,
((CGameConsole *)pUserData)->m_LocalConsole.PrintLine(pStr, Highlighted);
}
void CGameConsole::ConConsolePageUp(IConsole::IResult *pResult, void *pUserData)
{
CInstance *pConsole = ((CGameConsole *)pUserData)->CurrentConsole();
pConsole->m_BacklogActPage++;
}
void CGameConsole::ConConsolePageDown(IConsole::IResult *pResult, void *pUserData)
{
CInstance *pConsole = ((CGameConsole *)pUserData)->CurrentConsole();
--pConsole->m_BacklogActPage;
if(pConsole->m_BacklogActPage < 0)
pConsole->m_BacklogActPage = 0;
}
void CGameConsole::ConchainConsoleOutputLevelUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
{
pfnCallback(pResult, pCallbackUserData);
@ -816,6 +830,9 @@ void CGameConsole::OnConsoleInit()
Console()->Register("dump_local_console", "", CFGFLAG_CLIENT, ConDumpLocalConsole, this, "Dump local console");
Console()->Register("dump_remote_console", "", CFGFLAG_CLIENT, ConDumpRemoteConsole, this, "Dump remote console");
Console()->Register("console_page_up", "", CFGFLAG_CLIENT, ConConsolePageUp, this, "Previous page in console");
Console()->Register("console_page_down", "", CFGFLAG_CLIENT, ConConsolePageDown, this, "Next page in console");
Console()->Chain("console_output_level", ConchainConsoleOutputLevelUpdate, this);
}

View file

@ -92,6 +92,8 @@ class CGameConsole : public CComponent
static void ConClearRemoteConsole(IConsole::IResult *pResult, void *pUserData);
static void ConDumpLocalConsole(IConsole::IResult *pResult, void *pUserData);
static void ConDumpRemoteConsole(IConsole::IResult *pResult, void *pUserData);
static void ConConsolePageUp(IConsole::IResult *pResult, void *pUserData);
static void ConConsolePageDown(IConsole::IResult *pResult, void *pUserData);
static void ConchainConsoleOutputLevelUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
public: