Auto-bind F7 to show server console if it's free

This commit is contained in:
def 2020-09-05 23:15:14 +02:00
parent 2cdc7d0faf
commit 9a5ee2cdbf
3 changed files with 41 additions and 36 deletions

View file

@ -182,8 +182,7 @@ MACRO_CONFIG_INT(SvHit, sv_hit, 1, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Whether p
MACRO_CONFIG_INT(SvEndlessDrag, sv_endless_drag, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Turns endless hooking on/off")
MACRO_CONFIG_INT(SvTestingCommands, sv_test_cmds, 0, 0, 1, CFGFLAG_SERVER, "Turns testing commands aka cheats on/off (setting only works in initial config)")
MACRO_CONFIG_INT(SvFreezeDelay, sv_freeze_delay, 3, 1, 30, CFGFLAG_SERVER|CFGFLAG_GAME, "How many seconds the players will remain frozen (applies to all except delayed freeze in switch layer & deepfreeze)")
MACRO_CONFIG_INT(ClDDRaceBinds, cl_race_binds, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Enable Default DDRace builds when pressing the reset binds button")
MACRO_CONFIG_INT(ClDDRaceBindsSet, cl_race_binds_set, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Whether the DDRace binds set or not (this is automated you don't need to use this)")
MACRO_CONFIG_INT(ClDDRaceBindsSet, cl_race_binds_set, 0, 0, 2, CFGFLAG_CLIENT|CFGFLAG_SAVE, "What level the DDRace binds are set to (this is automated, you don't need to use this)")
MACRO_CONFIG_INT(SvEndlessSuperHook, sv_endless_super_hook, 0, 0, 1, CFGFLAG_SERVER, "Endless hook for super players on/off")
MACRO_CONFIG_INT(SvHideScore, sv_hide_score, 0, 0, 1, CFGFLAG_SERVER, "Whether players scores will be announced or not")
MACRO_CONFIG_INT(SvSaveWorseScores, sv_save_worse_scores, 1, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Whether to save worse scores when you already have a better one")

View file

@ -252,8 +252,7 @@ void CBinds::SetDefaults()
Bind(KEY_P, "say /pause");
// DDRace
if(g_Config.m_ClDDRaceBinds)
g_Config.m_ClDDRaceBindsSet = 0;
SetDDRaceBinds(false);
}
@ -446,6 +445,13 @@ void CBinds::ConfigSaveCallback(IConfig *pConfig, void *pUserData)
// DDRace
void CBinds::SetDDRaceBinds(bool FreeOnly)
{
if(g_Config.m_ClDDRaceBindsSet < 2)
{
Bind(KEY_F7, "toggle_server_console", FreeOnly);
}
if(g_Config.m_ClDDRaceBindsSet < 1)
{
Bind(KEY_KP_PLUS, "zoom+", FreeOnly);
Bind(KEY_KP_MINUS, "zoom-", FreeOnly);
@ -475,6 +481,7 @@ void CBinds::SetDDRaceBinds(bool FreeOnly)
Bind(KEY_MOUSE_3, "+spectate", FreeOnly);
Bind(KEY_MINUS, "spectate_previous", FreeOnly);
Bind(KEY_EQUALS, "spectate_next", FreeOnly);
g_Config.m_ClDDRaceBindsSet = 1;
}
g_Config.m_ClDDRaceBindsSet = 2;
}

View file

@ -332,7 +332,6 @@ void CGameClient::OnInit()
m_ShowOthers[1] = -1;
// Set free binds to DDRace binds if it's active
if(!g_Config.m_ClDDRaceBindsSet && g_Config.m_ClDDRaceBinds)
gs_Binds.SetDDRaceBinds(true);
if(g_Config.m_ClTimeoutCode[0] == '\0' || str_comp(g_Config.m_ClTimeoutCode, "hGuEYnfxicsXGwFq") == 0)