mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #1133 from ChillerDragon/ConsolePages
Add commands for switching pages in console
This commit is contained in:
commit
08c45ced0f
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue