diff --git a/src/backend/looped/self/hud.cpp b/src/backend/looped/self/hud.cpp index ecfe3e2f..4a0d9f9b 100644 --- a/src/backend/looped/self/hud.cpp +++ b/src/backend/looped/self/hud.cpp @@ -1,16 +1,18 @@ #include "backend/looped/looped.hpp" #include "natives.hpp" #include "core/data/hud_component_names.hpp" -#include namespace big { static bool bLastHideRadar = false; + static bool bHasHUDBeenHidden = false; void looped::self_hud() { const bool bHideRadar = g->self.hide_radar; const bool bHideAmmo = g->self.hide_ammo; + const bool bForceShowElement = g->self.force_show_hud_element; + const bool bForceShowHUD = g->self.force_show_hud; auto& bHudComponents = g->self.hud_components_states; if (bHideRadar) @@ -28,6 +30,11 @@ namespace big HUD::DISPLAY_AMMO_THIS_FRAME(false); } + if (bForceShowHUD) { + HUD::DISPLAY_HUD_WHEN_NOT_IN_STATE_OF_PLAY_THIS_FRAME(); + HUD::DISPLAY_HUD_WHEN_PAUSED_THIS_FRAME(); + } + if ( std::all_of( std::begin(bHudComponents), @@ -36,14 +43,22 @@ namespace big ) ) { HUD::DISPLAY_HUD(false); + bHasHUDBeenHidden = true; } else { HUD::DISPLAY_HUD(true); - for (int i = 0; i < (int)HudComponents::HUD_WEAPONS; i++) + bHasHUDBeenHidden = false; + } + + if (!bHasHUDBeenHidden) + { + for (int i = 0; i < static_cast(HudComponents::HUD_WEAPONS); i++) { if (bHudComponents[i]) HUD::HIDE_HUD_COMPONENT_THIS_FRAME(i + 1); + else if (!bHudComponents[i] && bForceShowElement) + HUD::SHOW_HUD_COMPONENT_THIS_FRAME(i + 1); } } } diff --git a/src/backend/looped/weapons/force_crosshairs.cpp b/src/backend/looped/weapons/force_crosshairs.cpp index 2159f948..741fd04c 100644 --- a/src/backend/looped/weapons/force_crosshairs.cpp +++ b/src/backend/looped/weapons/force_crosshairs.cpp @@ -1,12 +1,13 @@ #include "backend/looped/looped.hpp" #include "natives.hpp" +#include "core/enums.hpp" namespace big { void looped::weapons_force_crosshairs() { if (g->weapons.force_crosshairs) { - HUD::SHOW_HUD_COMPONENT_THIS_FRAME(14 /*RETICLE*/); + HUD::SHOW_HUD_COMPONENT_THIS_FRAME(static_cast(HudComponents::RETICLE)); } } } \ No newline at end of file diff --git a/src/core/globals.hpp b/src/core/globals.hpp index 1d03f283..c448e995 100644 --- a/src/core/globals.hpp +++ b/src/core/globals.hpp @@ -184,6 +184,8 @@ namespace big bool hide_ammo = false; int selected_hud_component = 1; bool hud_components_states[(int)HudComponents::HUD_WEAPONS] = { false }; + bool force_show_hud_element = false; + bool force_show_hud = false; bool mobile_radio = false; }; @@ -640,6 +642,8 @@ namespace big this->self.selected_hud_component = j["self"]["selected_hud_component"]; for (int i = 0; i < (int)HudComponents::HUD_WEAPONS; i++) this->self.hud_components_states[i] = j["self"]["hud_components_states"].at(i); + this->self.force_show_hud_element = j["self"]["force_show_hud_element"]; + this->self.force_show_hud = j["self"]["force_show_hud"]; this->self.unlimited_oxygen = j["self"]["unlimited_oxygen"]; this->self.no_water_collision = j["self"]["no_water_collision"]; this->self.mobile_radio = j["self"]["mobile_radio"]; @@ -979,6 +983,8 @@ namespace big this->self.hud_components_states[20], this->self.hud_components_states[21] }) }, + { "force_show_hud_element", this->self.force_show_hud_element }, + { "force_show_hud", this->self.force_show_hud }, { "unlimited_oxygen", this->self.unlimited_oxygen }, { "no_water_collision", this->self.no_water_collision }, { "mobile_radio", this->self.mobile_radio }, @@ -1154,16 +1160,16 @@ namespace big { "enabled", this->esp.enabled }, { "hide_self", this->esp.hide_self }, { "global_render_distance", nlohmann::json::array({ - this->esp.global_render_distance[0], - this->esp.global_render_distance[1] }) + this->esp.global_render_distance[0], + this->esp.global_render_distance[1] }) }, { "tracer_render_distance", nlohmann::json::array({ - this->esp.tracer_render_distance[0], - this->esp.tracer_render_distance[1] }) + this->esp.tracer_render_distance[0], + this->esp.tracer_render_distance[1] }) }, { "box_render_distance", nlohmann::json::array({ - this->esp.box_render_distance[0], - this->esp.box_render_distance[1] }) + this->esp.box_render_distance[0], + this->esp.box_render_distance[1] }) }, { "enemy_color", this->esp.enemy_color }, { "enemy_near_color", this->esp.enemy_near_color }, @@ -1180,12 +1186,12 @@ namespace big { "scale_health_from_dist", this->esp.scale_health_from_dist }, { "scale_armor_from_dist", this->esp.scale_armor_from_dist }, { "tracer_draw_position", nlohmann::json::array({ - this->esp.tracer_draw_position[0], - this->esp.tracer_draw_position[1] }) + this->esp.tracer_draw_position[0], + this->esp.tracer_draw_position[1] }) }, { "distance_threshold", nlohmann::json::array({ - this->esp.distance_threshold[0], - this->esp.distance_threshold[1] }) + this->esp.distance_threshold[0], + this->esp.distance_threshold[1] }) } } }, diff --git a/src/services/context_menu/context_menu_service.cpp b/src/services/context_menu/context_menu_service.cpp index e874abc8..ed07fa0c 100644 --- a/src/services/context_menu/context_menu_service.cpp +++ b/src/services/context_menu/context_menu_service.cpp @@ -313,7 +313,7 @@ namespace big if (g_context_menu_service->enabled) { - HUD::SHOW_HUD_COMPONENT_THIS_FRAME(14 /*RETICLE*/); + HUD::SHOW_HUD_COMPONENT_THIS_FRAME(static_cast(HudComponents::RETICLE)); g_context_menu_service->get_entity_closest_to_screen_center(); diff --git a/src/views/self/view_self.cpp b/src/views/self/view_self.cpp index 71a3045c..c55c81fd 100644 --- a/src/views/self/view_self.cpp +++ b/src/views/self/view_self.cpp @@ -75,11 +75,8 @@ namespace big if (g->self.invisibility) { ImGui::Checkbox("Locally Visible", &g->self.local_visibility); } - ImGui::Checkbox("Keep Player Clean", &g->self.clean_player); - ImGui::Checkbox("No Collision", &g->self.no_collision); - ImGui::Checkbox("Mobile Radio", &g->self.mobile_radio); ImGui::EndGroup(); @@ -173,6 +170,10 @@ namespace big ImGui::Checkbox("Hide Ammo", &g->self.hide_ammo); + ImGui::SameLine(); + + ImGui::Checkbox("Force show HUD", &g->self.force_show_hud); + ImGui::Combo("##hud_comp_combo", &g->self.selected_hud_component, hud_component_names, (int)HudComponents::HUD_WEAPONS); ImGui::SameLine(); components::button("Hide", [] { @@ -200,6 +201,10 @@ namespace big g->self.hud_components_states[i] = false; } }); + ImGui::SameLine(); + ImGui::Checkbox("Force show HUD element", &g->self.force_show_hud_element); + if (ImGui::IsItemHovered()) + ImGui::SetTooltip("To force show a HUD specific element, click Hide all then click Show on the desired element."); ImGui::EndGroup();