Fix sightlines and broken Menu entries

This commit is contained in:
BenCat07 2021-05-05 13:28:48 +02:00 committed by LightCat
parent 0ad17e5a9b
commit fed65faaf8
2 changed files with 27 additions and 43 deletions

View File

@ -7,7 +7,7 @@
<AutoVariable width="fill" target="lightesp.enable" label="Enable light ESP" tooltip="Show a red and green dot on the heads of enemies."/> <AutoVariable width="fill" target="lightesp.enable" label="Enable light ESP" tooltip="Show a red and green dot on the heads of enemies."/>
</List> </List>
</Box> </Box>
<Box padding="12 6 6 6" width="content" height="content" name="Targets" y="81"> <Box padding="12 6 6 6" width="content" height="content" name="Targets" y="65">
<List width="150"> <List width="150">
<AutoVariable width="fill" target="esp.show.teammates" label="Teammate ESP" tooltip="Shows ESP on teammates."/> <AutoVariable width="fill" target="esp.show.teammates" label="Teammate ESP" tooltip="Shows ESP on teammates."/>
<AutoVariable width="fill" target="esp.show.local" label="ESP on local player" tooltip="Shows ESP on yourself."/> <AutoVariable width="fill" target="esp.show.local" label="ESP on local player" tooltip="Shows ESP on yourself."/>
@ -71,7 +71,13 @@
<AutoVariable width="fill" target="esp.box.corner-size" label="Corner size"/> <AutoVariable width="fill" target="esp.box.corner-size" label="Corner size"/>
<AutoVariable width="fill" target="esp.bones" label="Bone ESP"/> <AutoVariable width="fill" target="esp.bones" label="Bone ESP"/>
<AutoVariable width="fill" target="esp.bones.color" label="Bone color" tooltip="Colors bones according to player state."/> <AutoVariable width="fill" target="esp.bones.color" label="Bone color" tooltip="Colors bones according to player state."/>
<AutoVariable width="fill" target="esp.sightlines" label="Sightlines"/> <LabeledObject width="fill" label="Sightlines">
<Select target="esp.sightlines">
<Option name="Off" value="0"/>
<Option name="Snipers only" value="1"/>
<Option name="All" value="2"/>
</Select>
</LabeledObject>
<AutoVariable width="fill" target="esp.expand" label="Expand" tooltip="Make ESP larger or smaller."/> <AutoVariable width="fill" target="esp.expand" label="Expand" tooltip="Make ESP larger or smaller."/>
<LabeledObject width="fill" label="Text position"> <LabeledObject width="fill" label="Text position">
<Select target="esp.text-position"> <Select target="esp.text-position">
@ -91,13 +97,6 @@
<Option name="Corners" value="2"/> <Option name="Corners" value="2"/>
</Select> </Select>
</LabeledObject> </LabeledObject>
<LabeledObject width="fill" label="Tracer mode">
<Select target="esp.tracers-mode">
<Option name="Off" value="0"/>
<Option name="Center" value="1"/>
<Option name="Bottom" value="2"/>
</Select>
</LabeledObject>
<LabeledObject width="fill" label="Health mode" tooltip="Sets the healthbar mode."> <LabeledObject width="fill" label="Health mode" tooltip="Sets the healthbar mode.">
<Select target="esp.health-bar"> <Select target="esp.health-bar">
<Option name="None" value="0"/> <Option name="None" value="0"/>
@ -109,7 +108,7 @@
<AutoVariable width="fill" target="esp.hide-invis" label="Hide invisible"/> <AutoVariable width="fill" target="esp.hide-invis" label="Hide invisible"/>
</List> </List>
</Box> </Box>
<Box padding="12 6 6 6" width="content" height="content" name="Player Info" x="170" y="300"> <Box padding="12 6 6 6" width="content" height="content" name="Player Info" x="170" y="270">
<List width="150"> <List width="150">
<AutoVariable width="fill" target="misc.playerinfo.draw-kda" label="Draw K/D over head"/> <AutoVariable width="fill" target="misc.playerinfo.draw-kda" label="Draw K/D over head"/>
<AutoVariable width="fill" target="misc.playerinfo.draw-level" label="That's how Mafia works"/> <AutoVariable width="fill" target="misc.playerinfo.draw-level" label="That's how Mafia works"/>
@ -131,21 +130,7 @@
<AutoVariable width="fill" target="esp.online.software" label="Online: software"/> <AutoVariable width="fill" target="esp.online.software" label="Online: software"/>
</List> </List>
</Box> </Box>
<Box padding="12 6 6 6" width="content" height="content" name="Emoji" x="340" y="155"> <Box padding="12 6 6 6" width="content" height="content" name="Dominatemark" x="340" y="155">
<List width="150">
<LabeledObject width="fill" label="Mode" tooltip="Shows an emoji on the heads of ESP targets.">
<Select target="esp.emoji.mode">
<Option name="None" value="0"/>
<Option name="Joy" value="1"/>
<Option name="Thinking" value="2"/>
</Select>
</LabeledObject>
<AutoVariable width="fill" target="esp.emoji.min-size" label="Min size"/>
<AutoVariable width="fill" target="esp.emoji.scaling" label="Scaling"/>
<AutoVariable width="fill" target="esp.emoji.size" label="Size"/>
</List>
</Box>
<Box padding="12 6 6 6" width="content" height="content" name="Dominatemark" x="340" y="240">
<List width="150"> <List width="150">
<AutoVariable width="fill" target="dominatemark.enable" label="Enable" tooltip="Enables a mark on people you are dominating, similar to the one shown if someone is dominating you."/> <AutoVariable width="fill" target="dominatemark.enable" label="Enable" tooltip="Enables a mark on people you are dominating, similar to the one shown if someone is dominating you."/>
<AutoVariable width="fill" target="dominatemark.min-size" label="Draw min size"/> <AutoVariable width="fill" target="dominatemark.min-size" label="Draw min size"/>

View File

@ -475,20 +475,10 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent)
auto position = ent->m_vecDormantOrigin(); auto position = ent->m_vecDormantOrigin();
if (!position) if (!position)
return; return;
static Vector screen;
if (!draw::EntityCenterToScreen(ent, screen))
return;
// Reset the collide cache
ent_data.has_collide = false;
// Get if ent should be transparent
bool transparent = vischeck && ent_data.transparent;
// Sightline esp // Sightline esp
if (sightlines && type == ENTITY_PLAYER) if (sightlines && type == ENTITY_PLAYER)
{ {
// Logic for using the enum to sort out snipers // Logic for using the enum to sort out snipers
if ((int) sightlines == 2 || ((int) sightlines == 1 && CE_INT(ent, netvar.iClass) == tf_sniper)) if ((int) sightlines == 2 || ((int) sightlines == 1 && CE_INT(ent, netvar.iClass) == tf_sniper))
{ {
@ -527,8 +517,8 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent)
// Get the end distance from the trace // Get the end distance from the trace
float end_distance = trace.endpos.DistTo(eye_position); float end_distance = trace.endpos.DistTo(eye_position);
// Loop and look back untill we have a vector on screen // Loop and look back until we have a vector on screen
for (int i = 1; i > 400; i++) for (int i = 1; i < 500; i++)
{ {
// Subtract 40 multiplyed by the tick from the end distance // Subtract 40 multiplyed by the tick from the end distance
// and use that as our length to check // and use that as our length to check
@ -555,9 +545,9 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent)
found_scn1 = false; found_scn1 = false;
// Loop and look back untill we have a vector on screen // Loop and look back untill we have a vector on screen
for (int i = 1; i > 400; i++) for (int i = 1; i < 500; i++)
{ {
// Multiply starting distance by 40, multiplyed by the // Multiply starting distance by 15, multiplyed by the
// loop tick // loop tick
Vector start_vector = forward_t * (10 * i) + eye_position; Vector start_vector = forward_t * (10 * i) + eye_position;
// We dont want it to go too far // We dont want it to go too far
@ -580,6 +570,17 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent)
} }
} }
} }
static Vector screen;
if (!draw::EntityCenterToScreen(ent, screen))
return;
// Reset the collide cache
ent_data.has_collide = false;
// Get if ent should be transparent
bool transparent = vischeck && ent_data.transparent;
// Box esp // Box esp
if (box_esp || box_3d_player || box_3d_building) if (box_esp || box_3d_player || box_3d_building)
{ {
@ -725,7 +726,6 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent)
{ {
draw::RectangleOutlined(min_x, min_y - 6, max_x - min_x + 1, 7, border, 0.5f); draw::RectangleOutlined(min_x, min_y - 6, max_x - min_x + 1, 7, border, 0.5f);
draw::Rectangle(min_x + hbw, min_y - 5, -hbw, 5, hp); draw::Rectangle(min_x + hbw, min_y - 5, -hbw, 5, hp);
} }
// Bottom horizontal health bar // Bottom horizontal health bar
else if (*healthbar == 2) else if (*healthbar == 2)
@ -910,7 +910,7 @@ void _FASTCALL ProcessEntity(CachedEntity *ent)
{ {
// We don't actually care about this vector at all. It just exists so WorldToScreen can function normally // We don't actually care about this vector at all. It just exists so WorldToScreen can function normally
static Vector origin_screen; static Vector origin_screen;
if (!draw::WorldToScreen(*origin, origin_screen)) if (!sightlines && ent->m_Type() != ENTITY_PLAYER && !draw::WorldToScreen(*origin, origin_screen))
return; return;
} }
@ -1348,7 +1348,6 @@ void _FASTCALL ProcessEntity(CachedEntity *ent)
} }
else if (ent->m_Type() == ENTITY_PLAYER && ent->m_bAlivePlayer()) else if (ent->m_Type() == ENTITY_PLAYER && ent->m_bAlivePlayer())
{ {
// Local player handling // Local player handling
if (!(local_esp && g_IInput->CAM_IsThirdPerson()) && ent->m_IDX == g_IEngine->GetLocalPlayer()) if (!(local_esp && g_IInput->CAM_IsThirdPerson()) && ent->m_IDX == g_IEngine->GetLocalPlayer())
return; return;
@ -1675,7 +1674,7 @@ void _FASTCALL DrawBox(CachedEntity *ent, const rgba_t &clr)
// Function to draw box corners, Used by DrawBox // Function to draw box corners, Used by DrawBox
void BoxCorners(int minx, int miny, int maxx, int maxy, const rgba_t &color, bool transparent) void BoxCorners(int minx, int miny, int maxx, int maxy, const rgba_t &color, bool transparent)
{ {
const rgba_t &black = transparent ? colors::Transparent(colors::black) : colors::black; const rgba_t &black = transparent ? colors::Transparent(colors::black) : colors::black;
const float heightSize = ((float) *box_corner_size_height / 100) * (maxy - miny - 3); const float heightSize = ((float) *box_corner_size_height / 100) * (maxy - miny - 3);
const float widthSize = ((float) *box_corner_size_width / 100) * (maxx - minx - 2); const float widthSize = ((float) *box_corner_size_width / 100) * (maxx - minx - 2);