mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Other teams alpha settable
This commit is contained in:
parent
78d29e3301
commit
e85d594f81
|
@ -204,7 +204,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, 1, 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")
|
||||
MACRO_CONFIG_INT(ClBackgroundHue, cl_background_hue, 0, 0, 255, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Background color hue")
|
||||
|
|
|
@ -1232,10 +1232,13 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView)
|
|||
g_Config.m_ClOverlayEntities = (int)(DoScrollbarH(&g_Config.m_ClOverlayEntities, &Button, g_Config.m_ClOverlayEntities/100.0f)*100.0f);
|
||||
}
|
||||
|
||||
Left.HSplitTop(20.0f, &Button, &Left);
|
||||
if(DoButton_CheckBox(&g_Config.m_ClShowOthers, Localize("Show players in other teams by default"), g_Config.m_ClShowOthers, &Button))
|
||||
{
|
||||
g_Config.m_ClShowOthers ^= 1;
|
||||
CUIRect Button, Label;
|
||||
Left.HSplitTop(20.0f, &Button, &Left);
|
||||
Button.VSplitLeft(120.0f, &Label, &Button);
|
||||
Button.HMargin(2.0f, &Button);
|
||||
UI()->DoLabelScaled(&Label, Localize("Other teams"), 14.0f, -1);
|
||||
g_Config.m_ClShowOthersAlpha = (int)(DoScrollbarH(&g_Config.m_ClShowOthersAlpha, &Button, g_Config.m_ClShowOthersAlpha /100.0f)*100.0f);
|
||||
}
|
||||
|
||||
Left.HSplitTop(20.0f, &Button, &Left);
|
||||
|
|
|
@ -47,7 +47,7 @@ void CNamePlates::RenderNameplate(
|
|||
if (OtherTeam)
|
||||
{
|
||||
TextRender()->TextOutlineColor(0.0f, 0.0f, 0.0f, 0.2f);
|
||||
TextRender()->TextColor(rgb.r, rgb.g, rgb.b, 0.4f);
|
||||
TextRender()->TextColor(rgb.r, rgb.g, rgb.b, g_Config.m_ClShowOthersAlpha / 100.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -247,8 +247,8 @@ void CPlayers::RenderHook(
|
|||
|
||||
if (OtherTeam)
|
||||
{
|
||||
RenderInfo.m_ColorBody.a = 0.4f;
|
||||
RenderInfo.m_ColorFeet.a = 0.4f;
|
||||
RenderInfo.m_ColorBody.a = g_Config.m_ClShowOthersAlpha / 100.0f;
|
||||
RenderInfo.m_ColorFeet.a = g_Config.m_ClShowOthersAlpha / 100.0f;
|
||||
}
|
||||
|
||||
// set size
|
||||
|
@ -345,7 +345,7 @@ void CPlayers::RenderHook(
|
|||
RenderTools()->SelectSprite(SPRITE_HOOK_HEAD);
|
||||
IGraphics::CQuadItem QuadItem(HookPos.x, HookPos.y, 24,16);
|
||||
if (OtherTeam)
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.4f);
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, g_Config.m_ClShowOthersAlpha / 100.0f);
|
||||
Graphics()->QuadsDraw(&QuadItem, 1);
|
||||
|
||||
// render chain
|
||||
|
@ -359,7 +359,7 @@ void CPlayers::RenderHook(
|
|||
}
|
||||
|
||||
if (OtherTeam)
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.4f);
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, g_Config.m_ClShowOthersAlpha / 100.0f);
|
||||
Graphics()->QuadsDraw(Array, i);
|
||||
Graphics()->QuadsSetRotation(0);
|
||||
Graphics()->QuadsEnd();
|
||||
|
@ -563,7 +563,7 @@ void CPlayers::RenderPlayer(
|
|||
|
||||
float Alpha = 1.0f;
|
||||
if (OtherTeam)
|
||||
Alpha = 0.4f;
|
||||
Alpha = g_Config.m_ClShowOthersAlpha / 100.0f;
|
||||
|
||||
do {
|
||||
OldPos = NewPos;
|
||||
|
@ -616,7 +616,7 @@ void CPlayers::RenderPlayer(
|
|||
RenderTools()->SelectSprite(g_pData->m_Weapons.m_aId[iw].m_pSpriteBody, Direction.x < 0 ? SPRITE_FLAG_FLIP_Y : 0);
|
||||
|
||||
if (OtherTeam)
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.4f);
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, g_Config.m_ClShowOthersAlpha / 100.0f);
|
||||
|
||||
vec2 Dir = Direction;
|
||||
float Recoil = 0.0f;
|
||||
|
@ -758,8 +758,8 @@ void CPlayers::RenderPlayer(
|
|||
|
||||
if (OtherTeam)
|
||||
{
|
||||
RenderInfo.m_ColorBody.a = 0.4f;
|
||||
RenderInfo.m_ColorFeet.a = 0.4f;
|
||||
RenderInfo.m_ColorBody.a = g_Config.m_ClShowOthersAlpha / 100.0f;
|
||||
RenderInfo.m_ColorFeet.a = g_Config.m_ClShowOthersAlpha / 100.0f;
|
||||
}
|
||||
|
||||
switch (Player.m_Weapon)
|
||||
|
@ -785,8 +785,8 @@ void CPlayers::RenderPlayer(
|
|||
|
||||
if (OtherTeam)
|
||||
{
|
||||
RenderInfo.m_ColorBody.a = 0.4f;
|
||||
RenderInfo.m_ColorFeet.a = 0.4f;
|
||||
RenderInfo.m_ColorBody.a = g_Config.m_ClShowOthersAlpha / 100.0f;
|
||||
RenderInfo.m_ColorFeet.a = g_Config.m_ClShowOthersAlpha / 100.0f;
|
||||
}
|
||||
|
||||
if (g_Config.m_ClShowDirection && (!pInfo.m_Local || DemoPlayer()->IsPlaying()))
|
||||
|
@ -796,7 +796,7 @@ void CPlayers::RenderPlayer(
|
|||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_ARROW].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
if (OtherTeam)
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.4f);
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, g_Config.m_ClShowOthersAlpha / 100.0f);
|
||||
IGraphics::CQuadItem QuadItem(Position.x-30, Position.y - 70, 22, 22);
|
||||
Graphics()->QuadsSetRotation(GetAngle(vec2(1,0))+pi);
|
||||
Graphics()->QuadsDraw(&QuadItem, 1);
|
||||
|
@ -807,7 +807,7 @@ void CPlayers::RenderPlayer(
|
|||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_ARROW].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
if (OtherTeam)
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.4f);
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, g_Config.m_ClShowOthersAlpha / 100.0f);
|
||||
IGraphics::CQuadItem QuadItem(Position.x+30, Position.y - 70, 22, 22);
|
||||
Graphics()->QuadsDraw(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
|
@ -817,7 +817,7 @@ void CPlayers::RenderPlayer(
|
|||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_ARROW].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
if (OtherTeam)
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.4f);
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, g_Config.m_ClShowOthersAlpha / 100.0f);
|
||||
IGraphics::CQuadItem QuadItem(Position.x, Position.y - 70, 22, 22);
|
||||
Graphics()->QuadsSetRotation(GetAngle(vec2(0,1))+pi);
|
||||
Graphics()->QuadsDraw(&QuadItem, 1);
|
||||
|
@ -890,7 +890,7 @@ void CPlayers::RenderPlayer(
|
|||
if (OtherTeam)
|
||||
{
|
||||
TextRender()->TextOutlineColor(0.0f, 0.0f, 0.0f, 0.2f);
|
||||
TextRender()->TextColor(rgb.r, rgb.g, rgb.b, 0.4f);
|
||||
TextRender()->TextColor(rgb.r, rgb.g, rgb.b, g_Config.m_ClShowOthersAlpha / 100.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1094,18 +1094,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_ClShowOthers))
|
||||
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))))
|
||||
{
|
||||
// no need to send, default settings
|
||||
//if(!(m_ShowOthers == -1 && g_Config.m_ClShowOthers))
|
||||
{
|
||||
CNetMsg_Cl_ShowOthers Msg;
|
||||
Msg.m_Show = g_Config.m_ClShowOthers;
|
||||
Msg.m_Show = g_Config.m_ClShowOthersAlpha ? 1 : 0;
|
||||
Client()->SendPackMsg(&Msg, MSGFLAG_VITAL);
|
||||
}
|
||||
|
||||
// update state
|
||||
m_ShowOthers[g_Config.m_ClDummy] = g_Config.m_ClShowOthers;
|
||||
m_ShowOthers[g_Config.m_ClDummy] = g_Config.m_ClShowOthersAlpha ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue