Add setting to ignore clan in friends and enable by default

This commit is contained in:
def 2014-12-12 17:15:29 +01:00
parent dfa804fb58
commit 3b0f768478
3 changed files with 11 additions and 3 deletions

View file

@ -73,7 +73,7 @@ bool CFriends::IsFriend(const char *pName, const char *pClan, bool PlayersOnly)
unsigned ClanHash = str_quickhash(pClan);
for(int i = 0; i < m_NumFriends; ++i)
{
if(m_aFriends[i].m_ClanHash == ClanHash &&
if((g_Config.m_ClFriendsIgnoreClan || m_aFriends[i].m_ClanHash == ClanHash) &&
((!PlayersOnly && m_aFriends[i].m_aName[0] == 0) || m_aFriends[i].m_NameHash == NameHash))
return true;
}

View file

@ -26,7 +26,8 @@ MACRO_CONFIG_INT(ClAutoDemoMax, cl_auto_demo_max, 10, 0, 1000, CFGFLAG_SAVE|CFGF
MACRO_CONFIG_INT(ClAutoScreenshot, cl_auto_screenshot, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Automatically take game over screenshot")
MACRO_CONFIG_INT(ClAutoScreenshotMax, cl_auto_screenshot_max, 10, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Maximum number of automatically created screenshots (0 = no limit)")
MACRO_CONFIG_INT(ClResetWantedWeaponOnDeath, cl_reset_wanted_weapon_on_death, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Reset wanted weapon on death")
MACRO_CONFIG_INT(ClPrintBroadcasts, cl_print_broadcasts, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Print broadcasts into console")
MACRO_CONFIG_INT(ClPrintBroadcasts, cl_print_broadcasts, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Print broadcasts to console")
MACRO_CONFIG_INT(ClFriendsIgnoreClan, cl_friends_ignore_clan, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Ignore clan tag when searching for friends")
MACRO_CONFIG_INT(ClEventthread, cl_eventthread, 0, 0, 1, CFGFLAG_CLIENT, "Enables the usage of a thread to pump the events")

View file

@ -203,6 +203,13 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView)
g_Config.m_ClPrintBroadcasts ^= 1;
}
Right.HSplitTop(5.0f, 0, &Right);
Right.HSplitTop(20.0f, &Button, &Right);
if (DoButton_CheckBox(&g_Config.m_ClFriendsIgnoreClan, Localize("Ignore clan tag for friends"), g_Config.m_ClFriendsIgnoreClan, &Button))
{
g_Config.m_ClFriendsIgnoreClan ^= 1;
}
Left.HSplitTop(20.0f, 0, &Left);
Left.HSplitTop(20.0f, &Label, &Left);
Button.VSplitRight(20.0f, &Button, 0);
@ -217,7 +224,7 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView)
g_Config.m_ClCpuThrottle= static_cast<int>(DoScrollbarH(&g_Config.m_ClCpuThrottle, &Button, g_Config.m_ClCpuThrottle/100.0f)*100.0f+0.1f);
}
Left.HSplitTop(20.0f, 0, &Left);
Left.HSplitTop(30.0f, 0, &Left);
Left.HSplitTop(20.0f, &Button, &Left);
if (DoButton_CheckBox(&g_Config.m_ClCpuThrottleInactive, Localize("CPU Throttle when window is inactive"), g_Config.m_ClCpuThrottleInactive, &Button))
{