Skip to content

Commit

Permalink
add more options to show text entities
Browse files Browse the repository at this point in the history
  • Loading branch information
mwinkens committed Feb 26, 2025
1 parent 33ae913 commit 5533850
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/engine/shared/config_variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ MACRO_CONFIG_INT(ClNamePlatesStrongSize, cl_nameplates_strong_size, 30, -50, 100
MACRO_CONFIG_INT(ClAfkEmote, cl_afk_emote, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show zzz emote next to afk players")
MACRO_CONFIG_INT(ClTextEntities, cl_text_entities, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Render textual entity data")
MACRO_CONFIG_INT(ClTextEntitiesSize, cl_text_entities_size, 100, 1, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Size of textual entity data from 1 to 100%")
MACRO_CONFIG_INT(ClTextEntitiesSpeedBoost, cl_text_entities_speed_boost, 1, 0, 3, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Render textual speedup data (0 - off, 1 - Force, 2 - MaxSpeed, 3 - Force + MaxSpeed)")
MACRO_CONFIG_INT(ClTextEntitiesTeleport, cl_text_entities_teleport, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Render textual speedup data (0 - off, 1 - Teleporter numbers)")
MACRO_CONFIG_INT(ClTextEntitiesSwitch, cl_text_entities_switch, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Render textual switch data (0 - off, 1 - Switch numbers)")
MACRO_CONFIG_INT(ClStreamerMode, cl_streamer_mode, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Censor sensitive information such as /save password")

MACRO_CONFIG_COL(ClAuthedPlayerColor, cl_authed_player_color, 5898211, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Color of name of authenticated player in scoreboard")
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/maplayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,7 @@ void CMapLayers::OnRender()
{
Graphics()->BlendNormal();
RenderTileLayer(TileLayerCounter - 3, Color);
if(g_Config.m_ClTextEntities)
if(g_Config.m_ClTextEntities && g_Config.m_ClTextEntitiesSwitch)
{
Graphics()->TextureSet(m_pImages->GetOverlayTop());
RenderTileLayer(TileLayerCounter - 2, Color);
Expand Down Expand Up @@ -1761,7 +1761,7 @@ void CMapLayers::OnRender()
RenderTileLayer(TileLayerCounter - 3, Color);
Graphics()->WrapNormal();

if(g_Config.m_ClTextEntities)
if(g_Config.m_ClTextEntities && g_Config.m_ClTextEntitiesSpeedBoost)
{
Graphics()->TextureSet(m_pImages->GetOverlayBottom());
RenderTileLayer(TileLayerCounter - 2, Color);
Expand Down
13 changes: 8 additions & 5 deletions src/game/client/render_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ void CRenderTools::RenderTile(int x, int y, unsigned char Index, float Scale, Co

void CRenderTools::RenderTeleOverlay(CTeleTile *pTele, int w, int h, float Scale, float Alpha) const
{
if(!g_Config.m_ClTextEntities)
if(!g_Config.m_ClTextEntities || !g_Config.m_ClTextEntitiesTeleport)
return;

float ScreenX0, ScreenY0, ScreenX1, ScreenY1;
Expand Down Expand Up @@ -831,9 +831,12 @@ void CRenderTools::RenderSpeedupOverlay(CSpeedupTile *pSpeedup, int w, int h, fl
// draw force and max speed
if(g_Config.m_ClTextEntities)
{
str_format(aBuf, sizeof(aBuf), "%d", Force);
TextRender()->Text(mx * Scale, (my + 0.5f + ToCenterOffset / 2) * Scale, Size * Scale / 2.f, aBuf);
if(MaxSpeed)
if(g_Config.m_ClTextEntitiesSpeedBoost&1)
{
str_format(aBuf, sizeof(aBuf), "%d", Force);
TextRender()->Text(mx * Scale, (my + 0.5f + ToCenterOffset / 2) * Scale, Size * Scale / 2.f, aBuf);
}
if(MaxSpeed && g_Config.m_ClTextEntitiesSpeedBoost&2)
{
str_format(aBuf, sizeof(aBuf), "%d", MaxSpeed);
TextRender()->Text(mx * Scale, (my + ToCenterOffset / 2) * Scale, Size * Scale / 2.f, aBuf);
Expand All @@ -848,7 +851,7 @@ void CRenderTools::RenderSpeedupOverlay(CSpeedupTile *pSpeedup, int w, int h, fl

void CRenderTools::RenderSwitchOverlay(CSwitchTile *pSwitch, int w, int h, float Scale, float Alpha) const
{
if(!g_Config.m_ClTextEntities)
if(!g_Config.m_ClTextEntities || !g_Config.m_ClTextEntitiesSwitch)
return;

float ScreenX0, ScreenY0, ScreenX1, ScreenY1;
Expand Down

0 comments on commit 5533850

Please sign in to comment.