Skip to content

Commit

Permalink
fix specname plate team, change outline zoom fade
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrc6 committed Apr 6, 2022
1 parent 22f9a01 commit 696a46f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/game/client/components/nameplates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ void CNamePlates::OnRender()
continue;
}

if(m_pClient->m_aClients[i].m_SpecCharPresent || (g_Config.m_ClFixKoGSpec && g_Config.m_ClFixKoGSpecNames && m_pClient->m_aClients[i].m_Team== TEAM_SPECTATORS))
if(m_pClient->m_aClients[i].m_SpecCharPresent || (g_Config.m_ClFixKoGSpec && g_Config.m_ClFixKoGSpecNames && m_pClient->m_aClients[i].m_Team== TEAM_SPECTATORS && !(m_pClient->IsOtherTeam(i))))
{
vec2 Pos = m_pClient->m_aClients[i].m_SpecChar;

if(g_Config.m_ClFixKoGSpec && g_Config.m_ClFixKoGSpecNames && m_pClient->m_aClients[i].m_Team == TEAM_SPECTATORS)
if(g_Config.m_ClFixKoGSpec && g_Config.m_ClFixKoGSpecNames && m_pClient->m_aClients[i].m_Team == TEAM_SPECTATORS && !(m_pClient->IsOtherTeam(i)))
Pos = m_pClient->m_aClients[i].m_RenderPos;

RenderNameplatePos(Pos, pInfo, 0.4f, true);
Expand Down
27 changes: 21 additions & 6 deletions src/game/client/render_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,16 @@ void CRenderTools::RenderGameTileOutlines(CTile *pTiles, int w, int h, float Sca
int StartX = (int)(ScreenX0 / Scale) - 1;
int EndY = (int)(ScreenY1 / Scale) + 1;
int EndX = (int)(ScreenX1 / Scale) + 1;

if(EndX - StartX > Graphics()->ScreenWidth() / 12 || EndY - StartY > Graphics()->ScreenHeight() / 12)
return;

int MaxScale = 12;
if(EndX - StartX > Graphics()->ScreenWidth() / MaxScale || EndY - StartY > Graphics()->ScreenHeight() / MaxScale)
{
int EdgeX = (EndX - StartX)-(Graphics()->ScreenWidth() / MaxScale);
StartX += EdgeX / 2;
EndX -= EdgeX / 2;
int EdgeY = (EndY - StartY) - (Graphics()->ScreenHeight() / MaxScale);
StartY += EdgeY / 2;
EndY -= EdgeY / 2;
}
Graphics()->TextureClear();
Graphics()->QuadsBegin();
ColorRGBA col = ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f);
Expand Down Expand Up @@ -634,8 +640,17 @@ void CRenderTools::RenderTeleOutlines(CTile *pTiles, CTeleTile *pTele, int w, in
int EndY = (int)(ScreenY1 / Scale) + 1;
int EndX = (int)(ScreenX1 / Scale) + 1;

if(EndX - StartX > Graphics()->ScreenWidth() / 12 || EndY - StartY > Graphics()->ScreenHeight() / 12)
return;
int MaxScale = 12;
if(EndX - StartX > Graphics()->ScreenWidth() / MaxScale || EndY - StartY > Graphics()->ScreenHeight() / MaxScale)
{
int EdgeX = (EndX - StartX) - (Graphics()->ScreenWidth() / MaxScale);
StartX += EdgeX / 2;
EndX -= EdgeX / 2;
int EdgeY = (EndY - StartY) - (Graphics()->ScreenHeight() / MaxScale);
StartY += EdgeY / 2;
EndY -= EdgeY / 2;
}


Graphics()->TextureClear();
Graphics()->QuadsBegin();
Expand Down

0 comments on commit 696a46f

Please sign in to comment.