From 1fc7af8f4c498673bbe0faea691c96896027642f Mon Sep 17 00:00:00 2001 From: Shichiha <77842398+Shichiha@users.noreply.github.com> Date: Fri, 27 May 2022 15:41:30 +0900 Subject: [PATCH 1/2] tracer middle --- cheat-library/src/user/cheat/esp/ESP.cpp | 2 ++ cheat-library/src/user/cheat/esp/ESP.h | 1 + cheat-library/src/user/cheat/esp/ESPRender.cpp | 8 +++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cheat-library/src/user/cheat/esp/ESP.cpp b/cheat-library/src/user/cheat/esp/ESP.cpp index 23edc7c..c08d00a 100644 --- a/cheat-library/src/user/cheat/esp/ESP.cpp +++ b/cheat-library/src/user/cheat/esp/ESP.cpp @@ -29,6 +29,7 @@ namespace cheat::feature NF(f_ArrowRadius, "Arrow Radius", "ESP", 100.0f), NF(f_OutlineThickness, "Outline Thickness", "ESP", 1.0f), NF(f_TracerSize, "Tracer Size", "ESP", 1.0f), + NF(f_MiddleScreenTracer, "Middle Screen Tracer", "ESP", false), NF(f_DrawDistance, "Draw Distance", "ESP", false), NF(f_DrawName, "Draw Name", "ESP", false), @@ -71,6 +72,7 @@ namespace cheat::feature ConfigWidget(f_Fill); ConfigWidget(f_FillTransparency, 0.01f, 0.0f, 1.0f, "Transparency of filled part."); + ConfigWidget(f_MiddleScreenTracer, "Draw tracer from middle part of the screen."); if (f_DrawTracerMode.value() == DrawTracerMode::OffscreenArrows && BeginGroupPanel("Arrow tracer options", ImVec2(-1, 0), true)) diff --git a/cheat-library/src/user/cheat/esp/ESP.h b/cheat-library/src/user/cheat/esp/ESP.h index 979b435..e609e24 100644 --- a/cheat-library/src/user/cheat/esp/ESP.h +++ b/cheat-library/src/user/cheat/esp/ESP.h @@ -38,6 +38,7 @@ namespace cheat::feature config::Field f_ArrowRadius; config::Field f_OutlineThickness; config::Field f_TracerSize; + config::Field f_MiddleScreenTracer; config::Field f_FontSize; config::Field f_FontOutline; diff --git a/cheat-library/src/user/cheat/esp/ESPRender.cpp b/cheat-library/src/user/cheat/esp/ESPRender.cpp index 0e37786..e35314d 100644 --- a/cheat-library/src/user/cheat/esp/ESPRender.cpp +++ b/cheat-library/src/user/cheat/esp/ESPRender.cpp @@ -388,7 +388,13 @@ namespace cheat::feature::esp::render return; auto draw = ImGui::GetBackgroundDrawList(); - draw->AddLine(s_AvatarPosition, *screenPos, color); + ImRect screen_rect = { 0.0f, 0.0f, ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y }; + auto screen_center = screen_rect.GetCenter(); + auto& esp = ESP::GetInstance(); + if (!esp.f_MiddleScreenTracer) + draw->AddLine(s_AvatarPosition, *screenPos, color); + else + draw->AddLine(screen_center, *screenPos, color); } #define PI 3.14159265358979323846 From 7d61da7607045ff496cf82b10af2cbc533c47a2c Mon Sep 17 00:00:00 2001 From: Callow <37184274+CallowBlack@users.noreply.github.com> Date: Sun, 12 Jun 2022 15:50:43 +0300 Subject: [PATCH 2/2] pr #42: little refactor --- cheat-library/src/user/cheat/esp/ESPRender.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cheat-library/src/user/cheat/esp/ESPRender.cpp b/cheat-library/src/user/cheat/esp/ESPRender.cpp index e35314d..32a1342 100644 --- a/cheat-library/src/user/cheat/esp/ESPRender.cpp +++ b/cheat-library/src/user/cheat/esp/ESPRender.cpp @@ -388,13 +388,19 @@ namespace cheat::feature::esp::render return; auto draw = ImGui::GetBackgroundDrawList(); - ImRect screen_rect = { 0.0f, 0.0f, ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y }; - auto screen_center = screen_rect.GetCenter(); + auto& esp = ESP::GetInstance(); - if (!esp.f_MiddleScreenTracer) - draw->AddLine(s_AvatarPosition, *screenPos, color); - else + if (esp.f_MiddleScreenTracer) + { + ImRect screen_rect = { 0.0f, 0.0f, ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y }; + auto screen_center = screen_rect.GetCenter(); draw->AddLine(screen_center, *screenPos, color); + } + else + { + draw->AddLine(s_AvatarPosition, *screenPos, color); + } + } #define PI 3.14159265358979323846