diff --git a/spt/feature.cpp b/spt/feature.cpp index 49410173e..5005b4dac 100644 --- a/spt/feature.cpp +++ b/spt/feature.cpp @@ -181,9 +181,9 @@ void Feature::InitConcommandBase(ConCommandBase& convar) bool Feature::AddHudCallback(const char* key, std::function func, ConVar& convar) { #ifdef SPT_HUD_ENABLED - bool result = spt_hud.AddHudCallback(key, - HudCallback( - func, [&convar]() { return convar.GetBool(); }, false)); + bool result = spt_hud_feat.AddHudCallback(key, + HudCallback( + func, [&convar]() { return convar.GetBool(); }, false)); if (result) { diff --git a/spt/features/boog.cpp b/spt/features/boog.cpp index 3121043b4..79df3db03 100644 --- a/spt/features/boog.cpp +++ b/spt/features/boog.cpp @@ -63,7 +63,8 @@ void BoogFeature::BoogTick() bool BoogFeature::ShouldDrawBoog() { - bool rval = ticksLeftToDrawBoog > 0 && y_spt_hud_edgebug.GetBool() && interfaces::surface && spt_hud.renderView; + bool rval = + ticksLeftToDrawBoog > 0 && y_spt_hud_edgebug.GetBool() && interfaces::surface && spt_hud_feat.renderView; if (rval) { @@ -78,7 +79,7 @@ bool BoogFeature::ShouldDrawBoog() void BoogFeature::DrawBoog() { auto surface = interfaces::surface; - auto renderView = spt_hud.renderView; + auto renderView = spt_hud_feat.renderView; if (boogFont == 0) { @@ -117,7 +118,7 @@ void BoogFeature::DrawBoog() bool BoogFeature::ShouldLoadFeature() { - return spt_hud.ShouldLoadFeature() && spt_playerio.ShouldLoadFeature(); + return spt_hud_feat.ShouldLoadFeature() && spt_playerio.ShouldLoadFeature(); } void BoogFeature::InitHooks() {} @@ -146,9 +147,9 @@ void BoogFeature::LoadFeature() if (boogHooked) { - bool result = spt_hud.AddHudDefaultGroup(HudCallback(std::bind(&BoogFeature::DrawBoog, this), - std::bind(&BoogFeature::ShouldDrawBoog, this), - false)); + bool result = spt_hud_feat.AddHudDefaultGroup(HudCallback(std::bind(&BoogFeature::DrawBoog, this), + std::bind(&BoogFeature::ShouldDrawBoog, this), + false)); if (result) { InitConcommandBase(y_spt_hud_edgebug); diff --git a/spt/features/ent_props.cpp b/spt/features/ent_props.cpp index a47b7a657..490f6066f 100644 --- a/spt/features/ent_props.cpp +++ b/spt/features/ent_props.cpp @@ -450,38 +450,39 @@ void EntProps::LoadFeature() [this](std::string) { int in_bubble = GetEnvironmentPortal() != NULL; - spt_hud.DrawTopHudElement(L"portal bubble: %d", in_bubble); + spt_hud_feat.DrawTopHudElement(L"portal bubble: %d", in_bubble); }, y_spt_hud_portal_bubble); } #endif - bool result = spt_hud.AddHudCallback("ent_info", - HudCallback( - [](std::string args) - { - std::string info; - if (args == "") - info = y_spt_hud_ent_info.GetString(); - else - info = args; - if (!whiteSpacesOnly(info)) - { - int entries = utils::FillInfoArray(info, - INFO_ARRAY, - MAX_ENTRIES, - INFO_BUFFER_SIZE, - PROP_SEPARATOR, - ENT_SEPARATOR); - for (int i = 0; i < entries; ++i) - { - spt_hud.DrawTopHudElement( - INFO_ARRAY + i * INFO_BUFFER_SIZE); - } - } - }, - []() { return true; }, - false)); + bool result = spt_hud_feat.AddHudCallback("ent_info", + HudCallback( + [](std::string args) + { + std::string info; + if (args == "") + info = y_spt_hud_ent_info.GetString(); + else + info = args; + if (!whiteSpacesOnly(info)) + { + int entries = + utils::FillInfoArray(info, + INFO_ARRAY, + MAX_ENTRIES, + INFO_BUFFER_SIZE, + PROP_SEPARATOR, + ENT_SEPARATOR); + for (int i = 0; i < entries; ++i) + { + spt_hud_feat.DrawTopHudElement( + INFO_ARRAY + i * INFO_BUFFER_SIZE); + } + } + }, + []() { return true; }, + false)); if (result) { diff --git a/spt/features/hops_hud.cpp b/spt/features/hops_hud.cpp index a62a88189..afcfed46a 100644 --- a/spt/features/hops_hud.cpp +++ b/spt/features/hops_hud.cpp @@ -440,7 +440,7 @@ static HopsHud spt_hops_hud; bool HopsHud::ShouldLoadFeature() { - return spt_hud.ShouldLoadFeature(); + return spt_hud_feat.ShouldLoadFeature(); } bool HopsHud::ShouldDraw() @@ -472,7 +472,7 @@ void HopsHud::PrintStrafeCol(std::function spt_hud.renderView->height) + if (y + fontTall * 2 > spt_hud_feat.renderView->height) { break; } @@ -488,7 +488,7 @@ void HopsHud::InitHooks() {} void HopsHud::LoadFeature() { - bool result = spt_hud.AddHudDefaultGroup( + bool result = spt_hud_feat.AddHudDefaultGroup( HudCallback(std::bind(&HopsHud::DrawHopHud, this), std::bind(&HopsHud::ShouldDraw, this), false)); if (result && OngroundSignal.Works && JumpSignal.Works) @@ -528,7 +528,7 @@ void HopsHud::DrawHopHud() swprintf_s(buffer, BUFFER_SIZE, fmt, value); \ DrawBuffer(); - if (hopsFont == 0 && !spt_hud.GetFont(FONT_Trebuchet24, hopsFont)) + if (hopsFont == 0 && !spt_hud_feat.GetFont(FONT_Trebuchet24, hopsFont)) { return; } @@ -538,7 +538,7 @@ void HopsHud::DrawHopHud() const Color white(255, 255, 255, 255); auto surface = interfaces::surface; - auto renderView = spt_hud.renderView; + auto renderView = spt_hud_feat.renderView; surface->DrawSetTextFont(hopsFont); surface->DrawSetTextColor(white); diff --git a/spt/features/hud.cpp b/spt/features/hud.cpp index 15ca30dd0..8ed9d5b06 100644 --- a/spt/features/hud.cpp +++ b/spt/features/hud.cpp @@ -15,7 +15,7 @@ extern ConVar _y_spt_overlay; -HUDFeature spt_hud; +HUDFeature spt_hud_feat; ConVar y_spt_hud("y_spt_hud", "1", 0, "When set to 1, displays SPT HUD."); ConVar y_spt_hud_left("y_spt_hud_left", "0", FCVAR_CHEAT, "When set to 1, displays SPT HUD on the left."); @@ -70,7 +70,7 @@ static int HudGroupCompletionFunc(AUTOCOMPLETION_FUNCTION_PARAMS) std::istringstream iss(base); std::vector args{std::istream_iterator{iss}, std::istream_iterator{}}; - + int argc = args.size(); switch (argc) { @@ -79,7 +79,7 @@ static int HudGroupCompletionFunc(AUTOCOMPLETION_FUNCTION_PARAMS) case 1: { std::vector suggestions; - for (const auto& group : spt_hud.hudUserGroups) + for (const auto& group : spt_hud_feat.hudUserGroups) { suggestions.push_back(group.first); } @@ -88,7 +88,7 @@ static int HudGroupCompletionFunc(AUTOCOMPLETION_FUNCTION_PARAMS) } case 2: { - if (args[1] == "all" || spt_hud.hudUserGroups.contains(args[1])) + if (args[1] == "all" || spt_hud_feat.hudUserGroups.contains(args[1])) return AutoCompleteList::AutoCompleteSuggest(base, incomplete, { @@ -112,10 +112,10 @@ static int HudGroupCompletionFunc(AUTOCOMPLETION_FUNCTION_PARAMS) case 3: case 4: { - if (args[2] == "add" || (argc == 4 && args [2] == "edit")) + if (args[2] == "add" || (argc == 4 && args[2] == "edit")) { std::vector suggestions; - for (const auto& group : spt_hud.hudCallbacks) + for (const auto& group : spt_hud_feat.hudCallbacks) { suggestions.push_back(group.first); } @@ -143,7 +143,7 @@ CON_COMMAND_F_COMPLETION(spt_hud_group, { if (args.ArgC() < 2) { - for (const auto& group : spt_hud.hudUserGroups) + for (const auto& group : spt_hud_feat.hudUserGroups) { Msg("%s\n", group.first.c_str()); } @@ -152,7 +152,7 @@ CON_COMMAND_F_COMPLETION(spt_hud_group, auto commandAction = [args](std::string name) -> bool { - HudUserGroup& group = spt_hud.hudUserGroups[name]; + HudUserGroup& group = spt_hud_feat.hudUserGroups[name]; int argc = args.ArgC(); if (argc == 2) @@ -174,7 +174,7 @@ CON_COMMAND_F_COMPLETION(spt_hud_group, } std::string element = args.Arg(3); - if (!spt_hud.hudCallbacks.contains(element)) + if (!spt_hud_feat.hudCallbacks.contains(element)) { Msg("%s is not a HUD element.\n", element.c_str()); return false; @@ -210,7 +210,7 @@ CON_COMMAND_F_COMPLETION(spt_hud_group, return false; } std::string element = args.Arg(4); - if (!spt_hud.hudCallbacks.contains(element)) + if (!spt_hud_feat.hudCallbacks.contains(element)) { Msg("%s is not a HUD element.\n", element.c_str()); return false; @@ -265,7 +265,7 @@ CON_COMMAND_F_COMPLETION(spt_hud_group, if (argc == 3) { std::string fontName = "Invalid"; - for (const auto& kv : spt_hud.fonts) + for (const auto& kv : spt_hud_feat.fonts) { if (kv.second == group.font) { @@ -277,7 +277,7 @@ CON_COMMAND_F_COMPLETION(spt_hud_group, } else if (argc == 4) { - if (!spt_hud.GetFont(args.Arg(3), group.font)) + if (!spt_hud_feat.GetFont(args.Arg(3), group.font)) { Msg("Invalid font name.\n"); return false; @@ -319,13 +319,13 @@ CON_COMMAND_F_COMPLETION(spt_hud_group, std::string name = args.Arg(1); if (name == "all") { - for (auto& kv : spt_hud.hudUserGroups) + for (auto& kv : spt_hud_feat.hudUserGroups) { if (!commandAction(kv.first)) return; } } - else if (spt_hud.hudUserGroups.contains(name)) + else if (spt_hud_feat.hudUserGroups.contains(name)) { commandAction(name); } @@ -348,13 +348,13 @@ CON_COMMAND(spt_hud_group_add, "Add a HUD group. Usage: spt_hud_group_add suggestions; - for (const auto& group : spt_hud.hudUserGroups) + for (const auto& group : spt_hud_feat.hudUserGroups) { suggestions.push_back(group.first); } @@ -389,11 +389,11 @@ CON_COMMAND_F_COMPLETION(spt_hud_group_remove, std::string name = args.Arg(1); if (name == "all") { - spt_hud.hudUserGroups.clear(); + spt_hud_feat.hudUserGroups.clear(); } - else if (spt_hud.hudUserGroups.contains(name)) + else if (spt_hud_feat.hudUserGroups.contains(name)) { - spt_hud.hudUserGroups.erase(name); + spt_hud_feat.hudUserGroups.erase(name); } else { @@ -647,7 +647,7 @@ void HUDFeature::LoadFeature() cl_showpos = g_pCVar->FindVar("cl_showpos"); cl_showfps = g_pCVar->FindVar("cl_showfps"); - bool result = spt_hud.AddHudDefaultGroup(HudCallback( + bool result = spt_hud_feat.AddHudDefaultGroup(HudCallback( std::bind(&HUDFeature::DrawDefaultHUD, this), []() { return y_spt_hud.GetBool(); }, false)); if (result) { @@ -793,7 +793,7 @@ void HUDFeature::DrawHUD(bool overlay) IMPL_HOOK_THISCALL(HUDFeature, void, CEngineVGui__Paint, void*, PaintMode_t mode) { - if (spt_hud.loadingSuccessful && mode & PAINT_INGAMEPANELS) + if (spt_hud_feat.loadingSuccessful && mode & PAINT_INGAMEPANELS) { #ifdef SPT_OVERLAY_ENABLED /* @@ -805,20 +805,20 @@ IMPL_HOOK_THISCALL(HUDFeature, void, CEngineVGui__Paint, void*, PaintMode_t mode * both views. */ Assert(spt_overlay.mainView); - spt_hud.renderView = spt_overlay.mainView; - spt_hud.DrawHUD(false); + spt_hud_feat.renderView = spt_overlay.mainView; + spt_hud_feat.DrawHUD(false); if (_y_spt_overlay.GetBool()) { Assert(spt_overlay.overlayView); - spt_hud.renderView = spt_overlay.overlayView; - spt_hud.DrawHUD(true); + spt_hud_feat.renderView = spt_overlay.overlayView; + spt_hud_feat.DrawHUD(true); } #else - Assert(spt_hud.renderView); - spt_hud.DrawHUD(false); + Assert(spt_hud_feat.renderView); + spt_hud_feat.DrawHUD(false); #endif } - spt_hud.ORIG_CEngineVGui__Paint(thisptr, mode); + spt_hud_feat.ORIG_CEngineVGui__Paint(thisptr, mode); } HudCallback::HudCallback() : drawInOverlay(false) {} @@ -830,7 +830,7 @@ HudCallback::HudCallback(std::function drawable, std::functio HudUserGroup::HudUserGroup() : x(0), y(0), shouldDraw(true), textcolor(255, 255, 255, 255), background(0, 0, 0, 0) { - if (!spt_hud.GetFont(FONT_DefaultFixedOutline, font)) + if (!spt_hud_feat.GetFont(FONT_DefaultFixedOutline, font)) { font = 0; } @@ -843,7 +843,7 @@ std::string HudUserGroup::ToString() const ss << "pos: (" << x << ", " << y << ")\n"; std::string fontName = "Invalid"; - for (const auto& kv : spt_hud.fonts) + for (const auto& kv : spt_hud_feat.fonts) { if (kv.second == font) { diff --git a/spt/features/hud.hpp b/spt/features/hud.hpp index 397c77bf9..99dc38363 100644 --- a/spt/features/hud.hpp +++ b/spt/features/hud.hpp @@ -140,4 +140,4 @@ class HUDFeature : public FeatureWrapper Color StringToColor(const std::string& color); std::string ColorToString(Color color); -extern HUDFeature spt_hud; +extern HUDFeature spt_hud_feat; diff --git a/spt/features/ihud.cpp b/spt/features/ihud.cpp index 120f24b31..fd16c4490 100644 --- a/spt/features/ihud.cpp +++ b/spt/features/ihud.cpp @@ -575,7 +575,7 @@ void InputHud::InitHooks() bool InputHud::ShouldLoadFeature() { - return spt_hud.ShouldLoadFeature(); + return spt_hud_feat.ShouldLoadFeature(); } void InputHud::LoadFeature() @@ -585,7 +585,7 @@ void InputHud::LoadFeature() if (CreateMoveSignal.Works) CreateMoveSignal.Connect(this, &InputHud::CreateMove); - bool result = spt_hud.AddHudDefaultGroup(HudCallback( + bool result = spt_hud_feat.AddHudDefaultGroup(HudCallback( std::bind(&InputHud::DrawInputHud, this), []() { return y_spt_ihud.GetBool(); }, false)); if (result) { @@ -804,7 +804,7 @@ void InputHud::DrawInputHud() { vgui::HFont anglesSettingFont; - if (!spt_hud.GetFont(anglesSetting.font, anglesSettingFont)) + if (!spt_hud_feat.GetFont(anglesSetting.font, anglesSettingFont)) { return; } @@ -821,8 +821,8 @@ void InputHud::DrawInputHud() // get offset from percentage int ihudSizeX, ihudSizeY; GetCurrentSize(ihudSizeX, ihudSizeY); - xOffset = (spt_hud.renderView->width - ihudSizeX) * y_spt_ihud_x.GetFloat() * 0.01f; - yOffset = (spt_hud.renderView->height - ihudSizeY) * y_spt_ihud_y.GetFloat() * 0.01f; + xOffset = (spt_hud_feat.renderView->width - ihudSizeX) * y_spt_ihud_x.GetFloat() * 0.01f; + yOffset = (spt_hud_feat.renderView->height - ihudSizeY) * y_spt_ihud_y.GetFloat() * 0.01f; gridSize = y_spt_ihud_grid_size.GetInt(); padding = y_spt_ihud_grid_padding.GetInt(); @@ -990,7 +990,7 @@ void InputHud::DrawRectAndCenterTxt(Color buttonColor, { vgui::HFont rectFont; - if (!spt_hud.GetFont(fontName, rectFont)) + if (!spt_hud_feat.GetFont(fontName, rectFont)) { return; } diff --git a/spt/features/isg.cpp b/spt/features/isg.cpp index 36d90b430..24e928722 100644 --- a/spt/features/isg.cpp +++ b/spt/features/isg.cpp @@ -85,7 +85,9 @@ void ISGFeature::LoadFeature() #ifdef SPT_HUD_ENABLED AddHudCallback( - "isg", [](std::string) { spt_hud.DrawTopHudElement(L"isg: %d", IsISGActive()); }, y_spt_hud_isg); + "isg", + [](std::string) { spt_hud_feat.DrawTopHudElement(L"isg: %d", IsISGActive()); }, + y_spt_hud_isg); #endif } } diff --git a/spt/features/overlay.cpp b/spt/features/overlay.cpp index 889851f0c..055b9e672 100644 --- a/spt/features/overlay.cpp +++ b/spt/features/overlay.cpp @@ -127,7 +127,7 @@ void Overlay::LoadFeature() InitConcommandBase(_y_spt_overlay_no_roll); #ifdef SPT_HUD_ENABLED - bool result = spt_hud.AddHudDefaultGroup(HudCallback( + bool result = spt_hud_feat.AddHudDefaultGroup(HudCallback( std::bind(&Overlay::DrawCrosshair, this), []() { return true; }, true)); if (result) @@ -151,7 +151,7 @@ IMPL_HOOK_THISCALL(Overlay, { #ifdef SPT_HUD_TEXTONLY - spt_hud.renderView = cameraView; + spt_hud_feat.renderView = cameraView; spt_overlay.ORIG_CViewRender__RenderView(thisptr, cameraView, nClearFlags, whatToDraw); #else @@ -209,7 +209,7 @@ IMPL_HOOK_THISCALL(Overlay, IMPL_HOOK_THISCALL(Overlay, void, CViewRender__RenderView_4044, void*, CViewSetup* cameraView, bool drawViewmodel) { - spt_hud.renderView = cameraView; + spt_hud_feat.renderView = cameraView; spt_overlay.ORIG_CViewRender__RenderView_4044(thisptr, cameraView, drawViewmodel); } @@ -240,8 +240,8 @@ void Overlay::DrawCrosshair() } interfaces::surface->DrawSetColor(r, g, b, a); - int x = spt_hud.renderView->x + spt_hud.renderView->width / 2; - int y = spt_hud.renderView->y + spt_hud.renderView->height / 2; + int x = spt_hud_feat.renderView->x + spt_hud_feat.renderView->width / 2; + int y = spt_hud_feat.renderView->y + spt_hud_feat.renderView->height / 2; int width = _y_spt_overlay_crosshair_size.GetInt(); int thickness = _y_spt_overlay_crosshair_thickness.GetInt(); diff --git a/spt/features/playerio.cpp b/spt/features/playerio.cpp index 84695bb09..f7317945b 100644 --- a/spt/features/playerio.cpp +++ b/spt/features/playerio.cpp @@ -828,11 +828,11 @@ void DrawFlagsHud(const wchar* hudName, { if (mutuallyExclusiveFlags && (flags & mask) == u) { - spt_hud.DrawTopHudElement(L"%s: %s", hudName, nameArray[u]); + spt_hud_feat.DrawTopHudElement(L"%s: %s", hudName, nameArray[u]); } else if (!mutuallyExclusiveFlags && (filter & (1 << u))) { - spt_hud.DrawTopHudElement(L"%s: %d", nameArray[u], (flags & (1 << u)) != 0); + spt_hud_feat.DrawTopHudElement(L"%s: %d", nameArray[u], (flags & (1 << u)) != 0); } } } @@ -871,15 +871,15 @@ void PlayerIOFeature::LoadFeature() [this](std::string) { auto vars = GetMovementVars(); - spt_hud.DrawTopHudElement(L"accelerate: %.3f", vars.Accelerate); - spt_hud.DrawTopHudElement(L"airaccelerate: %.3f", vars.Airaccelerate); - spt_hud.DrawTopHudElement(L"ent friction: %.3f", vars.EntFriction); - spt_hud.DrawTopHudElement(L"frametime: %.3f", vars.Frametime); - spt_hud.DrawTopHudElement(L"friction %.3f", vars.Friction); - spt_hud.DrawTopHudElement(L"maxspeed: %.3f", vars.Maxspeed); - spt_hud.DrawTopHudElement(L"stopspeed: %.3f", vars.Stopspeed); - spt_hud.DrawTopHudElement(L"wishspeed cap: %.3f", vars.WishspeedCap); - spt_hud.DrawTopHudElement(L"onground: %d", (int)vars.OnGround); + spt_hud_feat.DrawTopHudElement(L"accelerate: %.3f", vars.Accelerate); + spt_hud_feat.DrawTopHudElement(L"airaccelerate: %.3f", vars.Airaccelerate); + spt_hud_feat.DrawTopHudElement(L"ent friction: %.3f", vars.EntFriction); + spt_hud_feat.DrawTopHudElement(L"frametime: %.3f", vars.Frametime); + spt_hud_feat.DrawTopHudElement(L"friction %.3f", vars.Friction); + spt_hud_feat.DrawTopHudElement(L"maxspeed: %.3f", vars.Maxspeed); + spt_hud_feat.DrawTopHudElement(L"stopspeed: %.3f", vars.Stopspeed); + spt_hud_feat.DrawTopHudElement(L"wishspeed cap: %.3f", vars.WishspeedCap); + spt_hud_feat.DrawTopHudElement(L"onground: %d", (int)vars.OnGround); }, y_spt_hud_vars); #endif @@ -898,8 +898,11 @@ void PlayerIOFeature::LoadFeature() [this](std::string) { Vector accel = currentVelocity - previousVelocity; - spt_hud.DrawTopHudElement(L"accel(xyz): %.3f %.3f %.3f", accel.x, accel.y, accel.z); - spt_hud.DrawTopHudElement(L"accel(xy): %.3f", accel.Length2D()); + spt_hud_feat.DrawTopHudElement(L"accel(xyz): %.3f %.3f %.3f", + accel.x, + accel.y, + accel.z); + spt_hud_feat.DrawTopHudElement(L"accel(xy): %.3f", accel.Length2D()); }, y_spt_hud_accel); } @@ -913,13 +916,13 @@ void PlayerIOFeature::LoadFeature() : m_vecAbsOrigin.GetValue(); int precision = (mode == 1) ? 2 : mode; - spt_hud.DrawTopHudElement(L"pos: %.*f %.*f %.*f", - precision, - pos.x, - precision, - pos.y, - precision, - pos.z); + spt_hud_feat.DrawTopHudElement(L"pos: %.*f %.*f %.*f", + precision, + pos.x, + precision, + pos.y, + precision, + pos.z); }, spt_hud_position); @@ -931,13 +934,13 @@ void PlayerIOFeature::LoadFeature() QAngle ang = utils::GetPlayerEyeAngles(); int precision = (mode < 2) ? 2 : mode; - spt_hud.DrawTopHudElement(L"ang: %.*f %.*f %.*f", - precision, - ang.x, - precision, - ang.y, - precision, - ang.z); + spt_hud_feat.DrawTopHudElement(L"ang: %.*f %.*f %.*f", + precision, + ang.x, + precision, + ang.y, + precision, + ang.z); }, spt_hud_angles); @@ -948,12 +951,12 @@ void PlayerIOFeature::LoadFeature() int mode = (args == "") ? y_spt_hud_velocity.GetInt() : std::stoi(args); Vector currentVel = GetPlayerVelocity(); if (mode != 2) - spt_hud.DrawTopHudElement(L"vel(xyz): %.3f %.3f %.3f", - currentVel.x, - currentVel.y, - currentVel.z); + spt_hud_feat.DrawTopHudElement(L"vel(xyz): %.3f %.3f %.3f", + currentVel.x, + currentVel.y, + currentVel.z); if (mode != 3) - spt_hud.DrawTopHudElement(L"vel(xy): %.3f", currentVel.Length2D()); + spt_hud_feat.DrawTopHudElement(L"vel(xy): %.3f", currentVel.Length2D()); }, y_spt_hud_velocity); @@ -964,7 +967,7 @@ void PlayerIOFeature::LoadFeature() Vector currentVel = GetPlayerVelocity(); QAngle angles; VectorAngles(currentVel, Vector(0, 0, 1), angles); - spt_hud.DrawTopHudElement(L"vel(p/y/r): %.3f %.3f %.3f", angles.x, angles.y, angles.z); + spt_hud_feat.DrawTopHudElement(L"vel(p/y/r): %.3f %.3f %.3f", angles.x, angles.y, angles.z); }, y_spt_hud_velocity_angles); @@ -978,7 +981,7 @@ void PlayerIOFeature::LoadFeature() Vector v = spt_playerio.GetPlayerEyePos(); QAngle q; std::wstring result = calculateWillAGSG(v, q); - spt_hud.DrawTopHudElement(L"ag sg: %s", result.c_str()); + spt_hud_feat.DrawTopHudElement(L"ag sg: %s", result.c_str()); }, y_spt_hud_ag_sg_tester); } diff --git a/spt/features/saveloads.cpp b/spt/features/saveloads.cpp index ddb8b2406..99fd484ee 100644 --- a/spt/features/saveloads.cpp +++ b/spt/features/saveloads.cpp @@ -119,12 +119,12 @@ void SaveloadsFeature::LoadFeature() [this](std::string) { if (execute) - spt_hud.DrawTopHudElement(L"SAVELOADS: %i / %i (%i left)", - startIndex, - endIndex, - endIndex - startIndex); + spt_hud_feat.DrawTopHudElement(L"SAVELOADS: %i / %i (%i left)", + startIndex, + endIndex, + endIndex - startIndex); else - spt_hud.DrawTopHudElement(L"SAVELOADS: Not executing"); + spt_hud_feat.DrawTopHudElement(L"SAVELOADS: Not executing"); }, y_spt_hud_saveloads_showcurindex); #endif diff --git a/spt/features/shadow.cpp b/spt/features/shadow.cpp index 3c69a7917..19a21be7b 100644 --- a/spt/features/shadow.cpp +++ b/spt/features/shadow.cpp @@ -79,8 +79,8 @@ void ShadowPosition::LoadFeature() { const Vector& pos = PlayerHavokPos; const QAngle& ang = PlayerHavokAngles; - spt_hud.DrawTopHudElement(L"shadow pos (xyz): %.3f %.3f %.3f", pos.x, pos.y, pos.z); - spt_hud.DrawTopHudElement(L"shadow ang (pyr): %.3f %.3f %.3f", ang.x, ang.y, ang.z); + spt_hud_feat.DrawTopHudElement(L"shadow pos (xyz): %.3f %.3f %.3f", pos.x, pos.y, pos.z); + spt_hud_feat.DrawTopHudElement(L"shadow ang (pyr): %.3f %.3f %.3f", ang.x, ang.y, ang.z); }, y_spt_hud_shadow_info); #endif diff --git a/spt/features/tas.cpp b/spt/features/tas.cpp index 280f2ff79..f616c2e74 100644 --- a/spt/features/tas.cpp +++ b/spt/features/tas.cpp @@ -313,9 +313,9 @@ void TASFeature::LoadFeature() "script_progress", [this](std::string) { - spt_hud.DrawTopHudElement(L"frame: %d / %d", - scripts::g_TASReader.GetCurrentTick(), - scripts::g_TASReader.GetCurrentScriptLength()); + spt_hud_feat.DrawTopHudElement(L"frame: %d / %d", + scripts::g_TASReader.GetCurrentTick(), + scripts::g_TASReader.GetCurrentScriptLength()); }, y_spt_hud_script_progress); #endif diff --git a/spt/features/tracing.cpp b/spt/features/tracing.cpp index 20edd7513..f925d5b1b 100644 --- a/spt/features/tracing.cpp +++ b/spt/features/tracing.cpp @@ -551,7 +551,7 @@ void Tracing::LoadFeature() trace_t tr; Strafe::Trace(tr, v, v + Vector(1, 1, 1)); int oob = interfaces::engineTraceClient->PointOutsideWorld(v) && !tr.startsolid; - spt_hud.DrawTopHudElement(L"oob: %d", oob); + spt_hud_feat.DrawTopHudElement(L"oob: %d", oob); }, y_spt_hud_oob); } diff --git a/spt/features/visualizations/portal_placement.cpp b/spt/features/visualizations/portal_placement.cpp index c61259ea9..28313e03e 100644 --- a/spt/features/visualizations/portal_placement.cpp +++ b/spt/features/visualizations/portal_placement.cpp @@ -574,30 +574,30 @@ void PortalPlacement::LoadFeature() if (res1 == PORTAL_PLACEMENT_FAIL_NO_SERVER) { - spt_hud.DrawTopHudElement(L"Portal: No server player"); + spt_hud_feat.DrawTopHudElement(L"Portal: No server player"); } else if (res1 == PORTAL_PLACEMENT_FAIL_NO_WEAPON) { - spt_hud.DrawTopHudElement(L"Portal: No portalgun"); + spt_hud_feat.DrawTopHudElement(L"Portal: No portalgun"); } else if (mode == 0 || mode == 1) { - spt_hud.DrawColorTopHudElement(blueTextColor, L"Portal1: %d", res1 > 0.5f); - spt_hud.DrawColorTopHudElement(orangeTextColor, L"Portal2: %d", res2 > 0.5f); + spt_hud_feat.DrawColorTopHudElement(blueTextColor, L"Portal1: %d", res1 > 0.5f); + spt_hud_feat.DrawColorTopHudElement(orangeTextColor, L"Portal2: %d", res2 > 0.5f); } else if (mode == 2) { - spt_hud.DrawColorTopHudElement(blueTextColor, + spt_hud_feat.DrawColorTopHudElement(blueTextColor, L"Portal1: %s", PlacementResultToString(spt_pp.p1)); - spt_hud.DrawColorTopHudElement(orangeTextColor, + spt_hud_feat.DrawColorTopHudElement(orangeTextColor, L"Portal2: %s", PlacementResultToString(spt_pp.p2)); } else { - spt_hud.DrawColorTopHudElement(blueTextColor, L"Portal1: %f", res1); - spt_hud.DrawColorTopHudElement(orangeTextColor, L"Portal2: %f", res2); + spt_hud_feat.DrawColorTopHudElement(blueTextColor, L"Portal1: %f", res1); + spt_hud_feat.DrawColorTopHudElement(orangeTextColor, L"Portal2: %f", res2); } }, y_spt_hud_portal_placement);