Bring back old cl_showothers

This commit is contained in:
def 2014-05-25 00:59:52 +02:00
parent 2bffe87905
commit af12bd92ec
3 changed files with 14 additions and 6 deletions

View file

@ -205,6 +205,7 @@ MACRO_CONFIG_INT(ClRaceShowGhost, cl_race_show_ghost, 1, 0, 1, CFGFLAG_CLIENT|CF
MACRO_CONFIG_INT(ClRaceSaveGhost, cl_race_save_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Save ghost")
MACRO_CONFIG_INT(ClDDRaceScoreBoard, cl_ddrace_scoreboard, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Enable DDRace Scoreboard ")
MACRO_CONFIG_INT(SvResetPickus, sv_reset_pickups, 0, 0, 1, CFGFLAG_SERVER, "Whether the weapons are reset on passing the start tile or not")
MACRO_CONFIG_INT(ClShowOthers, cl_show_others, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show players in other teams")
MACRO_CONFIG_INT(ClShowOthersAlpha, cl_show_others_alpha, 40, 0, 100, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show players in other teams (alpha value, 0 invisible, 100 fully visible)")
MACRO_CONFIG_INT(ClOverlayEntities, cl_overlay_entities, 0, 0, 100, CFGFLAG_CLIENT, "Overlay game tiles with a percentage of opacity")
MACRO_CONFIG_INT(ClShowQuads, cl_show_quads, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show quads")

View file

@ -1116,7 +1116,7 @@ void CMenus::RenderSettings(CUIRect MainView)
void CMenus::RenderSettingsDDRace(CUIRect MainView)
{
CUIRect Button, Left, Right, HUD, Demo, Gameplay, Miscellaneous, Label;
CUIRect Button, Left, Right, LeftLeft, HUD, Demo, Gameplay, Miscellaneous, Label;
MainView.HSplitTop(130.0f, &HUD , &MainView);
@ -1235,10 +1235,17 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView)
{
CUIRect Button, Label;
Left.HSplitTop(20.0f, &Button, &Left);
Button.VSplitLeft(120.0f, &Label, &Button);
Button.VSplitMid(&LeftLeft, &Button);
Button.VSplitLeft(60.0f, &Label, &Button);
Button.HMargin(2.0f, &Button);
UI()->DoLabelScaled(&Label, Localize("Show others"), 14.0f, -1);
UI()->DoLabelScaled(&Label, Localize("Alpha"), 14.0f, -1);
g_Config.m_ClShowOthersAlpha = (int)(DoScrollbarH(&g_Config.m_ClShowOthersAlpha, &Button, g_Config.m_ClShowOthersAlpha /100.0f)*100.0f);
if(DoButton_CheckBox(&g_Config.m_ClShowOthers, Localize("Show others"), g_Config.m_ClShowOthers, &LeftLeft))
{
g_Config.m_ClShowOthers ^= 1;
}
}
Left.HSplitTop(20.0f, &Button, &Left);

View file

@ -1096,18 +1096,18 @@ void CGameClient::OnNewSnapshot()
m_DDRaceMsgSent[1] = true;
}
if(m_ShowOthers[g_Config.m_ClDummy] == -1 || (m_ShowOthers[g_Config.m_ClDummy] != -1 && ((m_ShowOthers[g_Config.m_ClDummy] && !g_Config.m_ClShowOthersAlpha) || (!m_ShowOthers[g_Config.m_ClDummy] && g_Config.m_ClShowOthersAlpha))))
if(m_ShowOthers[g_Config.m_ClDummy] == -1 || (m_ShowOthers[g_Config.m_ClDummy] != -1 && m_ShowOthers[g_Config.m_ClDummy] != g_Config.m_ClShowOthers))
{
// no need to send, default settings
//if(!(m_ShowOthers == -1 && g_Config.m_ClShowOthers))
{
CNetMsg_Cl_ShowOthers Msg;
Msg.m_Show = g_Config.m_ClShowOthersAlpha ? 1 : 0;
Msg.m_Show = g_Config.m_ClShowOthers;
Client()->SendPackMsg(&Msg, MSGFLAG_VITAL);
}
// update state
m_ShowOthers[g_Config.m_ClDummy] = g_Config.m_ClShowOthersAlpha ? 1 : 0;
m_ShowOthers[g_Config.m_ClDummy] = g_Config.m_ClShowOthers;
}
}