Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can click through ImGui window. #7213

Closed
Barkie12 opened this issue Jan 9, 2024 · 1 comment
Closed

Can click through ImGui window. #7213

Barkie12 opened this issue Jan 9, 2024 · 1 comment

Comments

@Barkie12
Copy link

Barkie12 commented Jan 9, 2024

Version/Branch of Dear ImGui:

Version 1.89.9

Back-ends:

imgui_impl_dx11.cpp

Compiler, OS:

Windows 10 + vs2022

Full config/build information:

No response

Details:

My Issue/Question:

How do i make it so i cant click through the ImGui window anymore.
For example if the menu is open and i click on the menu it will also click on the actual lets say "game".

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

void c_overlay::render_callback()
{	// Our state
	ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);

	ImGuiIO& io = ImGui::GetIO(); (void)io;
	io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;     // Enable Keyboard Controls
	io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;      // Enable Gamepad Controls
	ImGui::GetIO().MouseDrawCursor = overlay->show_menu;

	if (overlay->show_menu)
	{
		ImGui::Begin(xorstr_("Lab Core"), 0, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoInputs);

		if (ImGui::BeginTabBar("TabBar"))
		{
			if (ImGui::BeginTabItem("ESP"))
			{
				ImGui::SetCursorPos({ 31.f,50.f });
				ImGui::Checkbox("Box ESP", &esp->draw_box);
				//ToggleButton("Box ESP", &esp->draw_box);

				ImGui::SetCursorPos({ 31.f,90.f });
				ImGui::Checkbox("Tank Names", &esp->draw_name);

				ImGui::SetCursorPos({ 31.f,130.f });
				ImGui::Checkbox("Draw Tracers", &esp->draw_tracer);

				ImGui::SetCursorPos({ 250.f,50.f });
				ImGui::Checkbox("Reload Bar", &esp->draw_reload_bar);

				ImGui::SetCursorPos({ 250.f,90.f });
				ImGui::Checkbox("Tank Distances", &esp->draw_distance);

				ImGui::SetCursorPos({ 250.f,130.f });
				ImGui::Checkbox("Chams", &esp->draw_fuel_chams);

				ImGui::SetCursorPos({ 31.f,180.f });
				ImGui::PushItemWidth(189.000000);
				ImGui::Text("Change max distance for ESP");
				ImGui::PopItemWidth();

				ImGui::SetCursorPos({ 31.f,200.f });
				ImGui::PushItemWidth(278.000000);
				ImGui::SliderInt("Max Draw Distance", &esp->max_distance, 0, 10000);
				ImGui::PopItemWidth();
				ImGui::EndTabItem();
			}

			if (ImGui::BeginTabItem("Aimbot"))
			{
				ImGui::SetCursorPos({ 31.f,50.f });
				ImGui::Checkbox("Show Prediction Circles", &esp->draw_prediciton_circle);

				ImGui::SetCursorPos({ 300.f,50.f });
				ImGui::Checkbox("Penetration Crosshair", &misc->penetration_crosshair);

				ImGui::SetCursorPos({ 300.f,90.f });
				ImGui::Checkbox("Bomb Prediction", &misc->draw_bomb_prediction);

				const int MAX_KEY_CODES = 256;
				ImGui::SetCursorPos({ 31.f,90.f });
				if (ImGui::Button("Change Aim Key")) {

					capturing_new_key = true;
				}

				if (capturing_new_key) {
					ImVec4 greencolor(128 / 255.0f, 255 / 255.0f, 128 / 255.0f, 1.0f);
					ImGui::TextColored(greencolor, ("Press a key to set as Aimbot Key..."));
					for (int i = 1; i <= 255; i++) {
						if (GetAsyncKeyState(i) & 0x8000) {

							aimbot->aimbot_key = i;


							capturing_new_key = false;
						}
					}
				}
				else {
					ImGui::SetCursorPos({ 31.f,130.f });
					ImGui::PushItemWidth(175.000000);
					ImVec4 lightRedColor(255 / 255.0f, 91 / 255.0f, 91 / 255.0f, 1.0f);
					ImGui::TextColored(lightRedColor, ("Current Aim Key: %s", key_names[aimbot->aimbot_key]));
					ImGui::PopItemWidth();
				}
				//ImGui::Checkbox("Use Mouse", &aimbot->use_mouse);
				//ImGui::SliderInt("Smooth", &aimbot->aimbot_smooth, 1, 20);
				ImGui::EndTabItem();
			}

			if (ImGui::BeginTabItem("Misc"))  // Third tab for other settings
			{
				ImGui::Checkbox("Stream Proof", &stream_proof_enabled);
				ImGui::Checkbox("Show Extra Info", &enemystats);
				/*if (stream_proof_enabled && !stream_proofing)
				{
					driver->hide_window(overlay->get_hwnd());
					stream_proofing = true;
				}
				else if (!stream_proof_enabled && stream_proofing)
				{
					driver->show_window(overlay->get_hwnd());
					stream_proofing = false;
				}*/
				ImGui::EndTabItem();
			}
			if (ImGui::BeginTabItem("Misc Colors"))
			{

				ImGui::SetCursorPos({ 31.f,50.f });
				if (ImGui::BeginCombo("##BombPrediction", "Bomb Prediction")) {
					ImGui::ColorEdit3("Not Ready", (float*)&Bomb_circle_notready, ImGuiColorEditFlags_NoInputs);
					ImGui::ColorEdit3("Ready", (float*)&Bomb_circle_ready, ImGuiColorEditFlags_NoInputs);
					ImGui::EndCombo();
				}
				ImGui::SetCursorPos({ 31.f,90.f });
				if (ImGui::BeginCombo("##PredictionCircles", "Prediction Circles")) {
					ImGui::ColorEdit3("Circle One", (float*)&prediction_circle_color, ImGuiColorEditFlags_NoInputs);
					ImGui::ColorEdit3("Circle Two", (float*)&prediction_circle_color2, ImGuiColorEditFlags_NoInputs);
					ImGui::EndCombo();
				}
				ImGui::SetCursorPos({ 31.f,130.f });
				if (ImGui::BeginCombo("##Misc", "Misc")) {
					ImGui::ColorEdit3("Front Outline", (float*)&tank_front_color, ImGuiColorEditFlags_NoInputs);
					ImGui::ColorEdit3("Front Circle", (float*)&front_circle_color, ImGuiColorEditFlags_NoInputs);
					ImGui::EndCombo();
				}
				ImGui::EndTabItem();
			}
			if (ImGui::BeginTabItem("Tank Colors"))
			{

				//Heavy Tank
				ImGui::ColorEdit3("Heavy Tank Visible##Color5", (float*)&heavy_tank_visible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::ColorEdit3("Heavy Tank Invisible##Color6", (float*)&heavy_tank_invisible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::Spacing();
				ImGui::Spacing();
				//Medium Tank
				ImGui::ColorEdit3("Medium Tank Visible##Color7", (float*)&medium_tank_visible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::ColorEdit3("Medium Tank Invisible##Color8", (float*)&medium_tank_invisible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::Spacing();
				ImGui::Spacing();
				//Light Tank
				ImGui::ColorEdit3("Light Tank Visible##Color9", (float*)&light_tank_visible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::ColorEdit3("Light Tank Invisible##Color10", (float*)&light_tank_invisible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::Spacing();
				ImGui::Spacing();
				//SPAA Tank
				ImGui::ColorEdit3("SPAA Tank Visible##Color11", (float*)&spaa_tank_visible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::ColorEdit3("SPAA Tank Invisible##Color12", (float*)&spaa_tank_invisible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::Spacing();
				ImGui::Spacing();
				//SPG Tank
				ImGui::ColorEdit3("SPG Tank Visible##Color13", (float*)&spg_tank_visible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::ColorEdit3("SPG Tank Invisible##Color14", (float*)&spg_tank_invisible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::EndTabItem();
			}
			if (ImGui::BeginTabItem("Plane Colors"))
			{

				//bomber plane
				ImGui::ColorEdit3("Bomber Plane Visible##Color15", (float*)&bomber_plane_visible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::ColorEdit3("Bomber Plane Invisible##Color16", (float*)&bomber_plane_invisible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::Spacing();
				ImGui::Spacing();
				//assault plane
				ImGui::ColorEdit3("Assault Plane Visible##Color17", (float*)&assault_plane_visible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::ColorEdit3("Assault Plane Invisible##Color18", (float*)&assault_plane_invisible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::Spacing();
				ImGui::Spacing();
				//fighter plane
				ImGui::ColorEdit3("Fighter Plane Visible##Color19", (float*)&fighter_plane_visible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::ColorEdit3("Fighter Plane Invisible##Color20", (float*)&fighter_plane_invisible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::Spacing();
				ImGui::Spacing();
				//helicopter plane
				ImGui::ColorEdit3("Helicopter Visible##Color21", (float*)&helicopter_plane_visible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::ColorEdit3("Helicopter Invisible##Color22", (float*)&helicopter_plane_invisible_color, ImGuiColorEditFlags_NoInputs);
				ImGui::EndTabItem();
			}

			if (ImGui::BeginTabItem("Config"))
			{

				if (ImGui::Button("Save Config"))
					misc->save_config();
				if (ImGui::Button("Load Config"))
					misc->load_config();

			}


			ImGui::EndTabBar();
		}

		if (show_player_info)
		{
			static auto add_unit_to_viewer = [](Unit* unit)
			{
				if (unit->GetUnitState() != 0)
					return;

				auto pinfo = unit->GetPlayerInfo();
				if ((uintptr_t)pinfo > 0x1000)
				{
					if (ImGui::CollapsingHeader(pinfo->GetPlayerName().c_str()))
					{
						ImGui::Text("Unit: 0x%X", (uintptr_t)unit); ImGui::SameLine(); if (ImGui::Button("Print")) { std::cout << std::hex << (uintptr_t)unit << std::dec << std::endl; };
						ImGui::Text("Player Name: %s", pinfo->GetPlayerName().c_str()); if (ImGui::Button("Print")) { std::cout << pinfo->GetPlayerName().c_str() << std::endl; };
						auto info = unit->GetInfo();
						ImGui::Text("Tank Info: 0x%X", (uintptr_t)info); ImGui::SameLine(); if (ImGui::Button("Print")) { std::cout << std::hex << (uintptr_t)info << std::dec << std::endl; };
						ImGui::Text("Tank Name: %s", info->GetUnitName()); if (ImGui::Button("Print")) { std::cout << info->GetUnitName() << std::endl; };

						auto local_turret = unit->get_turret();
						ImGui::Text("Tank Turret: 0x%X", (uintptr_t)local_turret); ImGui::SameLine(); if (ImGui::Button("Print")) { std::cout << std::hex << (uintptr_t)local_turret << std::dec << std::endl; };
						if (local_turret)
						{
							auto local_weapon_count = local_turret->get_weapon_count();
							ImGui::Text("Turret Weapon Count: %i", local_weapon_count);
							for (int weapon_index = 0; weapon_index < local_weapon_count; weapon_index++)
							{
								auto local_weapon = local_turret->get_weapon(weapon_index);
								if (local_weapon)
								{
									ImGui::Text("Weapon: 0x%X", (uintptr_t)local_weapon); ImGui::SameLine(); if (ImGui::Button("Print")) { std::cout << std::hex << (uintptr_t)local_weapon << std::dec << std::endl; };
									auto local_weapon_name = local_weapon->get_weapon_name();
									if (ImGui::CollapsingHeader(local_weapon_name.c_str()))
									{
										auto local_round_info = local_weapon->get_round_info();
										ImGui::Text("Round Info: 0x%X", (uintptr_t)local_round_info); ImGui::SameLine(); if (ImGui::Button("Print")) { std::cout << std::hex << (uintptr_t)local_round_info << std::dec << std::endl; };
										//std::cout << "Local Round Info: " << std::hex << (uintptr_t)local_round_info << std::dec << std::endl;
										if (local_round_info)
										{
											auto round_mass = local_round_info->get_mass();
											ImGui::Text("Round Mass: %0.1f", round_mass);
											auto round_caliber = local_round_info->get_caliber();
											ImGui::Text("Round Caliber: %0.1f", round_caliber);
											auto round_length = local_round_info->get_length();
											ImGui::Text("Round Length: %0.1f", round_length);
											auto round_velocity = local_round_info->get_velocity();
											ImGui::Text("Round Velocity: %0.1f", round_velocity);
										}
									}
								}
							}
						}
					}
				}
			};

			//ImGui::SetNextWindowPos(ImVec2(10, 250));
			ImGui::Begin("Player Viewer");
			ImGui::BeginChild("Scrolling");
			int id = 0;
			for (auto unit : entity_update->get_player_list())
			{
				ImGui::BeginChild("UnitInfo");
				ImGui::PushID(id);
				add_unit_to_viewer(unit);
				ImGui::PopID();
				ImGui::EndChild();
				id++;
			}

			ImGui::EndChild();
			ImGui::End();
		}
		ImGui::End();
	}
	if (enemystats)
	{
		ImGui::SetNextWindowBgAlpha(0.7f);  // Adjust alpha as needed
		ImGui::SetNextWindowPos(ImVec2(10, 10));
		ImGui::Begin("Enemy Info", &enemystats, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysAutoResize);
		ImVec4 lightRedColor(255 / 255.0f, 91 / 255.0f, 91 / 255.0f, 1.0f);
		ImGui::TextColored(lightRedColor, "Enemy Count: %i", entity_update->get_unit_list().size());
		ImGui::Spacing();
		ImGui::Spacing();
		ImGui::TextColored(light_tank_visible_color.Value, "Light Tanks : % i ", esp->light_tank_count);
		ImGui::TextColored(medium_tank_visible_color.Value, "Medium Tanks: %i ", esp->medium_tank_count);
		ImGui::TextColored(heavy_tank_visible_color.Value, "Heavy Tanks: %i ", esp->heavy_tank_count);
		ImGui::TextColored(spaa_tank_visible_color.Value, "SPAA Tanks: %i ", esp->spa_tank_count);
		ImGui::TextColored(spg_tank_visible_color.Value, "SPG Tanks: %i ", esp->spg_tank_count);
		ImGui::Spacing();
		ImGui::Spacing();
		ImGui::TextColored(bomber_plane_visible_color.Value, "Bomber Planes: %i ", esp->bomber_plane_count);
		ImGui::TextColored(assault_plane_visible_color.Value, "Assault Planes: %i ", esp->assault_plane_count);
		ImGui::TextColored(fighter_plane_visible_color.Value, "Fighter Planes: %i ", esp->fighter_plane_count);
		ImGui::TextColored(helicopter_plane_visible_color.Value, "Helicopter Planes: %i ", esp->helicopter_plane_count);
		ImGui::End();
	}
@ocornut
Copy link
Owner

ocornut commented Jan 9, 2024

Sorry but #1586

@ocornut ocornut closed this as completed Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants