Skip to content

Commit 82337fd

Browse files
committed
2 parents 715f16e + 213444f commit 82337fd

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

TempleWare-CS2/source/templeware/config/config.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ namespace Config {
4545
float aimbot_fov = 0;
4646
bool rcs = 0;
4747
bool fov_circle = 0;
48+
ImVec4 fovCircleColor = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
4849
}

TempleWare-CS2/source/templeware/config/config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ namespace Config {
4444
extern float aimbot_fov;
4545
extern bool rcs;
4646
extern bool fov_circle;
47+
extern ImVec4 fovCircleColor;
4748
}

TempleWare-CS2/source/templeware/config/configmanager.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ namespace internal_config
148148
Config::teamcolVisualChams.z,
149149
Config::teamcolVisualChams.w
150150
};
151+
j["fovCircleColor"] = {
152+
Config::fovCircleColor.x,
153+
Config::fovCircleColor.y,
154+
Config::fovCircleColor.z,
155+
Config::fovCircleColor.w
156+
};
151157

152158
auto filePath = GetConfigPath(configName);
153159
std::ofstream ofs(filePath);
@@ -268,6 +274,14 @@ namespace internal_config
268274
Config::teamcolVisualChams.w = arr[3].get<float>();
269275
}
270276

277+
if (j.contains("fovCircleColor") && j["fovCircleColor"].is_array() && j["fovCircleColor"].size() == 4) {
278+
auto arr = j["fovCircleColor"];
279+
Config::fovCircleColor.x = arr[0].get<float>();
280+
Config::fovCircleColor.y = arr[1].get<float>();
281+
Config::fovCircleColor.z = arr[2].get<float>();
282+
Config::fovCircleColor.w = arr[3].get<float>();
283+
}
284+
271285
ifs.close();
272286
}
273287

TempleWare-CS2/source/templeware/menu/hud.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,20 @@ Hud::Hud() {
1212
}
1313

1414
float CalculateFovRadius(float fovDegrees, float screenWidth, float screenHeight, float gameVerticalFOV) {
15-
// Horizontal FOV conversion to radians
1615
float aspectRatio = screenWidth / screenHeight;
1716
float fovRadians = fovDegrees * (DirectX::XM_PI / 180.0f);
1817

19-
// Calculate radius based on in-game vertical FOV and screen height
2018
float screenRadius = std::tan(fovRadians / 2.0f) * (screenHeight / 2.0f) / std::tan(gameVerticalFOV * (DirectX::XM_PI / 180.0f) / 2.0f);
2119

2220
static float flScalingMultiplier = 2.5f;
2321

2422
return screenRadius * flScalingMultiplier;
2523
}
2624

27-
void RenderFovCircle(ImDrawList* drawList, float fov, ImVec2 screenCenter, float screenWidth, float screenHeight, uint32_t color, float thickness) {
25+
void RenderFovCircle(ImDrawList* drawList, float fov, ImVec2 screenCenter, float screenWidth, float screenHeight, float thickness) {
2826
float radius = CalculateFovRadius(fov, screenWidth, screenHeight, H::g_flActiveFov);
29-
drawList->AddCircle(screenCenter, radius, color, 100, thickness); // 100 segments for smoothness
27+
uint32_t color = ImGui::ColorConvertFloat4ToU32(Config::fovCircleColor);
28+
drawList->AddCircle(screenCenter, radius, color, 100, thickness);
3029
}
3130

3231
void Hud::render() {
@@ -69,6 +68,6 @@ void Hud::render() {
6968
if (Config::fov_circle) {
7069
ImVec2 Center = ImVec2(ImGui::GetIO().DisplaySize.x / 2.f, ImGui::GetIO().DisplaySize.y / 2.f);
7170

72-
RenderFovCircle(drawList, Config::aimbot_fov, Center, ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y, ImColor(255, 255, 255, 255), 1.f);
71+
RenderFovCircle(drawList, Config::aimbot_fov, Center, ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y, 1.f);
7372
}
7473
}

TempleWare-CS2/source/templeware/menu/menu.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ void Menu::render() {
117117

118118
ImGui::SliderFloat("FOV", &Config::aimbot_fov, 0.f, 90.f);
119119
ImGui::Checkbox("DrawFOV", &Config::fov_circle);
120+
if (Config::fov_circle) {
121+
ImGui::ColorEdit4("Color##FovColor", (float*)&Config::fovCircleColor);
122+
}
120123
ImGui::Checkbox("RCS", &Config::rcs);
121124
ImGui::Separator();
122125
break;

0 commit comments

Comments
 (0)