diff options
| author | oy <Tom_Adams@web.de> | 2010-08-18 00:06:00 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-08-18 00:06:00 +0200 |
| commit | cabecb7fa937b5e4efa859ea62722468f91a5089 (patch) | |
| tree | d9da92814dd049dfef7bdcfa9069955504341b8c /src/game/client/components/binds.cpp | |
| parent | 16f201794de61e237b4a7644d28f043dc1b987bb (diff) | |
| download | zcatch-cabecb7fa937b5e4efa859ea62722468f91a5089.tar.gz zcatch-cabecb7fa937b5e4efa859ea62722468f91a5089.zip | |
added output level for console print function, categorised the debug messages and merged them into the new functionality. Closes #8
Diffstat (limited to 'src/game/client/components/binds.cpp')
| -rw-r--r-- | src/game/client/components/binds.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/game/client/components/binds.cpp b/src/game/client/components/binds.cpp index 1fb5ecc5..4b0db425 100644 --- a/src/game/client/components/binds.cpp +++ b/src/game/client/components/binds.cpp @@ -30,10 +30,12 @@ void CBinds::Bind(int KeyId, const char *pStr) return; str_copy(m_aaKeyBindings[KeyId], pStr, sizeof(m_aaKeyBindings[KeyId])); + char aBuf[256]; if(!m_aaKeyBindings[KeyId][0]) - dbg_msg("binds", "unbound %s (%d)", Input()->KeyName(KeyId), KeyId); + str_format(aBuf, sizeof(aBuf), "unbound %s (%d)", Input()->KeyName(KeyId), KeyId); else - dbg_msg("binds", "bound %s (%d) = %s", Input()->KeyName(KeyId), KeyId, m_aaKeyBindings[KeyId]); + str_format(aBuf, sizeof(aBuf), "bound %s (%d) = %s", Input()->KeyName(KeyId), KeyId, m_aaKeyBindings[KeyId]); + Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "binds", aBuf); } @@ -136,7 +138,9 @@ void CBinds::ConBind(IConsole::IResult *pResult, void *pUserData) if(!id) { - dbg_msg("binds", "key %s not found", pKeyName); + char aBuf[256]; + str_format(aBuf, sizeof(aBuf), "key %s not found", pKeyName); + pBinds->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "binds", aBuf); return; } @@ -152,7 +156,9 @@ void CBinds::ConUnbind(IConsole::IResult *pResult, void *pUserData) if(!id) { - dbg_msg("binds", "key %s not found", pKeyName); + char aBuf[256]; + str_format(aBuf, sizeof(aBuf), "key %s not found", pKeyName); + pBinds->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "binds", aBuf); return; } @@ -175,8 +181,8 @@ void CBinds::ConDumpBinds(IConsole::IResult *pResult, void *pUserData) { if(pBinds->m_aaKeyBindings[i][0] == 0) continue; - str_format(aBuf, sizeof(aBuf), "[binds] %s (%d) = %s", pBinds->Input()->KeyName(i), i, pBinds->m_aaKeyBindings[i]); - pBinds->Console()->Print(aBuf); + str_format(aBuf, sizeof(aBuf), "%s (%d) = %s", pBinds->Input()->KeyName(i), i, pBinds->m_aaKeyBindings[i]); + pBinds->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "binds", aBuf); } } |