Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more options to show text entities #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
21 changes: 14 additions & 7 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 @@ -1724,7 +1724,7 @@ void CMapLayers::OnRender()
{
Graphics()->BlendNormal();
RenderTileLayer(TileLayerCounter - 2, Color);
if(g_Config.m_ClTextEntities)
if(g_Config.m_ClTextEntities && g_Config.m_ClTextEntitiesTeleport)
{
Graphics()->TextureSet(m_pImages->GetOverlayCenter());
RenderTileLayer(TileLayerCounter - 1, Color);
Expand Down Expand Up @@ -1761,12 +1761,19 @@ 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);
Graphics()->TextureSet(m_pImages->GetOverlayTop());
RenderTileLayer(TileLayerCounter - 1, Color);
if(g_Config.m_ClTextEntitiesSpeedBoost & 1)
{
Graphics()->TextureSet(m_pImages->GetOverlayBottom());
RenderTileLayer(TileLayerCounter - 2, Color);
}

if(g_Config.m_ClTextEntitiesSpeedBoost & 2)
{
Graphics()->TextureSet(m_pImages->GetOverlayTop());
RenderTileLayer(TileLayerCounter - 1, 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
Loading