InGame Radar / Render Radar?В каком исходнике имеется нормальный рабочий радар с настройкой на базе CS GO Simple
Хоть какой-то, а лучше обаInGame Radar / Render Radar?
Хоть какой-то, а лучше оба
void Visuals::AddToDrawList() {
for (auto i = 1; i <= g_EntityList->GetHighestEntityIndex(); ++i) {
auto entity = C_BaseEntity::GetEntityByIndex(i);
...
if (!entity)
continue;
if (entity == g_LocalPlayer)
continue;
if (g_Options.misc_ingame_radar)
entity->m_bSpotted() = true;
void DrawRadar() {
auto visible = Color::Red;
auto Tvisible = Color::White;
ImGuiStyle& style = ImGui::GetStyle();
ImVec2 oldPadding = style.WindowPadding;
float oldAlpha = style.Colors[ImGuiCol_WindowBg].w;
style.WindowPadding = ImVec2(0, 0);
//style.WindowTitleAlign = ImVec2(0.5f, 0.5f);
//style.Colors[ImGuiCol_WindowBg].w = 1.0f;
ImGui::PushStyleVar(ImGuiStyleVar_WindowTitleAlign, ImVec2(0.5f, 0.5f));
if (ImGui::Begin("Radar", nullptr, ImVec2(150, 170), 0.7F, ImGuiWindowFlags_NoCollapse))
//if (ImGui::Begin("Radar", &_visible, ImVec2(200, 200)), ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize)
{
ImVec2 siz = ImGui::GetWindowSize();
ImVec2 pos = ImGui::GetWindowPos();
ImDrawList* windowDrawList = ImGui::GetWindowDrawList();
windowDrawList->AddLine(ImVec2(pos.x + (siz.x / 2), pos.y + 0), ImVec2(pos.x + (siz.x / 2), pos.y + siz.y), ImColor(64, 72, 95), 1.5f);
windowDrawList->AddLine(ImVec2(pos.x + 0, pos.y + (siz.y / 2)), ImVec2(pos.x + siz.x, pos.y + (siz.y / 2)), ImColor(64, 72, 95), 1.5f);
static auto GetU32 = [](Color _color) {
return ((_color[3] & 0xff) << 24) + ((_color[2] & 0xff) << 16) + ((_color[1] & 0xff) << 8)
+ (_color[0] & 0xff);
};
static auto RotatePoint = [](Vector EntityPos, Vector LocalPlayerPos, int posX, int posY, int sizeX, int sizeY, float angle, float zoom) {
float r_1, r_2;
float x_1, y_1;
r_1 = -(EntityPos.y - LocalPlayerPos.y);
r_2 = EntityPos.x - LocalPlayerPos.x;
float Yaw = angle - 90.0f;
float yawToRadian = DEG2RAD(Yaw);
x_1 = r_2 * cosf(yawToRadian) - r_1 * sin(yawToRadian) / 20.0f;
y_1 = r_2 * sinf(yawToRadian) + r_1 * cos(yawToRadian) / 20.0f;
x_1 *= zoom;
y_1 *= zoom;
int sizX = sizeX / 2;
int sizY = sizeY / 2;
x_1 += sizX;
y_1 += sizY;
if (x_1 < 5)
x_1 = 5;
if (x_1 > sizeX - 5)
x_1 = sizeX - 5;
if (y_1 < 5)
y_1 = 5;
if (y_1 > sizeY - 5)
y_1 = sizeY - 5;
x_1 += posX;
y_1 += posY;
return Vector2D(x_1, y_1);
};
if (g_EngineClient->IsInGame() && g_EngineClient->IsConnected()) {
if (g_LocalPlayer) {
Vector LocalPos = g_LocalPlayer->GetEyePos();
QAngle ang;
g_EngineClient->GetViewAngles(&ang);
for (int i = 1; i <= g_GlobalVars->maxClients; ++i) {
auto player = C_BasePlayer::GetPlayerByIndex(i);
if (!player || player->IsDormant() || !player->IsAlive())
continue;
bool bIsEnemy = g_LocalPlayer->m_iTeamNum() != player->m_iTeamNum();
if (g_Options.misc_radar_enemyonly && !bIsEnemy)
continue;
bool viewCheck = false;
Vector2D EntityPos = RotatePoint(Vector(player->m_vecOrigin().x, player->m_vecOrigin().y, 0), LocalPos, pos.x, pos.y, siz.x, siz.y, ang.yaw, 0.5f);
//ImU32 clr = (bIsEnemy ? (isVisibled ? Color::LightGreen() : Color::Blue()) : Color::White()).GetU32();
ImU32 clr = GetU32(bIsEnemy ? (visible) : Tvisible);
int s = 4;
windowDrawList->AddCircleFilled(ImVec2(EntityPos.x, EntityPos.y), s, clr);
}
}
}
}
ImGui::End();
ImGui::PopStyleVar();
style.WindowPadding = oldPadding;
style.Colors[ImGuiCol_WindowBg].w = oldAlpha;
}
void Menu::Render()
if (g_Options.misc_radar)
DrawRadar();
Проект предоставляет различный материал, относящийся к сфере киберспорта, программирования, ПО для игр, а также позволяет его участникам общаться на многие другие темы. Почта для жалоб: admin@yougame.biz