𝐅𝐄𝐀𝐓𝐔𝐑𝐄𝐒𝐓𝐈𝐂 𝐋𝐄𝐀𝐊𝐒
رفتن به کانال در Telegram
📌 Educational & Research Purpose Only 🔍 Sharing publicly available source code for learning ❌ No selling ❌ No buying ❌ No promotions ⚠️ I am not responsible for misuse 📚 For knowledge & awareness only
نمایش بیشتر1 763
مشترکین
+524 ساعت
+367 روز
+21230 روز
آرشیو پست ها
1 762
4 Rᴇᴘᴏʀᴛs ᴀʀᴇ Bʟᴏᴄᴋᴇᴅ ʙʏ @teleprotectorbot
708 Cʜᴀɴɴᴇʟs ᴀʀᴇ Sᴀᴠᴇᴅ Fʀᴏᴍ Rᴇᴘᴏʀᴛs ɪɴ Lᴀsᴛ 24 Hᴏᴜʀs
1 762
// Update basic controller/player and count strings
g_LocalController = localController;
g_LocalPlayer = localPlayer;
std::string sEnemy = std::to_string((int)totalEnemies);
std::string sBot = std::to_string((int)totalBots);
// Define heart centers for Enemy and Bot
ImVec2 heartCenterEnemy = { glWidth / 2 - 65, 65 };
ImVec2 heartCenterBot = { glWidth / 2 + 65, 65 };
// Base heart size (static size when count is 0)
float baseHeartSize = 50.0f;
// Time counter for animation (static so it persists across frames)
static float timeCounter = 0.0f;
// Increase timeCounter with a higher multiplier for fast pulsation
timeCounter += ImGui::GetIO().DeltaTime * 10.0f;
// Calculate pulse factors: if count > 0, animate heartbeat; else, remain static (factor = 1.0)
float pulseFactorEnemy = (totalEnemies > 0) ? (1.0f + 0.2f * sin(timeCounter)) : 1.0f;
float pulseFactorBot = (totalBots > 0) ? (1.0f + 0.2f * sin(timeCounter)) : 1.0f;
// Calculate effective heart sizes based on pulse factor
float heartSizeEnemy = baseHeartSize * pulseFactorEnemy;
float heartSizeBot = baseHeartSize * pulseFactorBot;
// Helper lambda function to draw a heart shape using its parametric equation
auto DrawHeart = [&](ImVec2 center, float size, ImU32 color) {
// Use a small increment for a smooth heart outline
for (float t = 0.0f; t <= IM_PI * 2; t += 0.01f) {
float x = 16 * sin(t) * sin(t) * sin(t);
float y = 13 * cos(t) - 5 * cos(2 * t) - 2 * cos(3 * t) - cos(4 * t);
// Scale the heart shape and position it relative to the center
ImVec2 pos = ImVec2(center.x + x * size / 20.0f, center.y - y * size / 20.0f);
// Draw a small filled circle at each computed point
draw->AddCircleFilled(pos, 1.5f, color);
}
};
// Draw Enemy heart
ImU32 colorEnemy = IM_COL32(255, 0, 0, 200); // Red heart color
DrawHeart(heartCenterEnemy, heartSizeEnemy, colorEnemy);
// Draw Enemy count (centered) inside the heart
ImVec2 textSizeEnemy = ImGui::CalcTextSize2(sEnemy.c_str(), 0, ((float)density / 14.0f));
ImVec2 textPosEnemy = ImVec2(heartCenterEnemy.x - textSizeEnemy.x / 2.0f,
heartCenterEnemy.y - textSizeEnemy.y / 2.0f);
draw->AddText(NULL, ((float)density / 14.0f), textPosEnemy, IM_COL32(0, 0, 0, 255), sEnemy.c_str());
// Draw Bot heart
ImU32 colorBot = IM_COL32(0, 255, 0, 200); // Green heart color
DrawHeart(heartCenterBot, heartSizeBot, colorBot);
// Draw Bot count (centered) inside the heart
ImVec2 textSizeBot = ImGui::CalcTextSize2(sBot.c_str(), 0, ((float)density / 14.0f));
ImVec2 textPosBot = ImVec2(heartCenterBot.x - textSizeBot.x / 2.0f,
heartCenterBot.y - textSizeBot.y / 2.0f);
draw->AddText(NULL, ((float)density / 14.0f), textPosBot, IM_COL32(0, 0, 0, 255), sBot.c_str());
}}
