From a90b37544ab9444618f4f86189f45c7e7ac0cd26 Mon Sep 17 00:00:00 2001 From: def Date: Sat, 2 Nov 2013 03:09:56 +0100 Subject: [PATCH] More HUD control --- src/game/client/components/hud.cpp | 8 +++++--- src/game/client/components/menus_settings.cpp | 12 ++++++++++++ src/game/variables.h | 2 ++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/game/client/components/hud.cpp b/src/game/client/components/hud.cpp index 9d46d9966..6391fa232 100644 --- a/src/game/client/components/hud.cpp +++ b/src/game/client/components/hud.cpp @@ -468,12 +468,13 @@ void CHud::OnRender() { if(m_pClient->m_Snap.m_pLocalCharacter && !(m_pClient->m_Snap.m_pGameInfoObj->m_GameStateFlags&GAMESTATEFLAG_GAMEOVER)) { - RenderHealthAndAmmo(m_pClient->m_Snap.m_pLocalCharacter); + if (g_Config.m_ClShowhudHealthAmmo) + RenderHealthAndAmmo(m_pClient->m_Snap.m_pLocalCharacter); RenderDDRaceEffects(); } else if(m_pClient->m_Snap.m_SpecInfo.m_Active) { - if(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW) + if(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW && g_Config.m_ClShowhudHealthAmmo) RenderHealthAndAmmo(&m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_SpecInfo.m_SpectatorID].m_Cur); RenderSpectatorHud(); } @@ -481,7 +482,8 @@ void CHud::OnRender() RenderGameTimer(); RenderPauseNotification(); RenderSuddenDeath(); - RenderScoreHud(); + if (g_Config.m_ClShowhudScore) + RenderScoreHud(); RenderWarmupTimer(); RenderFps(); if(Client()->State() != IClient::STATE_DEMOPLAYBACK) diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 7db3fef3c..e9622e8d8 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -1100,6 +1100,18 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView) g_Config.m_ClAntiPingGrenade ^= 1; } + MainView.HSplitTop(20.0f, &Button, &MainView); + if(DoButton_CheckBox(&g_Config.m_ClShowhudScore, Localize("HUD: Show score"), g_Config.m_ClShowhudScore, &Button)) + { + g_Config.m_ClShowhudScore ^= 1; + } + + MainView.HSplitTop(20.0f, &Button, &MainView); + if(DoButton_CheckBox(&g_Config.m_ClShowhudHealthAmmo, Localize("HUD: Show health + ammo"), g_Config.m_ClShowhudHealthAmmo, &Button)) + { + g_Config.m_ClShowhudHealthAmmo ^= 1; + } + CUIRect aRects[2]; CUIRect Label; MainView.HSplitTop(5.0f, 0, &MainView); diff --git a/src/game/variables.h b/src/game/variables.h index ffd9c6377..90d66a9a3 100644 --- a/src/game/variables.h +++ b/src/game/variables.h @@ -16,6 +16,8 @@ MACRO_CONFIG_INT(ClNameplatesSize, cl_nameplates_size, 50, 0, 100, CFGFLAG_CLIEN MACRO_CONFIG_INT(ClAutoswitchWeapons, cl_autoswitch_weapons, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Auto switch weapon on pickup") MACRO_CONFIG_INT(ClShowhud, cl_showhud, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame HUD") +MACRO_CONFIG_INT(ClShowhudHealthAmmo, cl_showhud_healthammo, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame HUD (Health + Ammo)") +MACRO_CONFIG_INT(ClShowhudScore, cl_showhud_score, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame HUD (Score)") MACRO_CONFIG_INT(ClShowChatFriends, cl_show_chat_friends, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show only chat messages from friends") MACRO_CONFIG_INT(ClShowfps, cl_showfps, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame FPS counter")