Пользователь
-
Автор темы
- #1
Onetap v2 watermark (imgui).
C++:
void c_menu::draw_watermark()
{
std::string cheat_name = "onetap.su";
std::string user_name = "llama is gay";
std::string time_name = g_ctx.globals.time;
std::string space = " | ";
std::string delay_name = "delay: ";
std::string tick_name = "tick";
std::string ms_name = "ms";
std::string ping = std::to_string(g_ctx.globals.ping);
std::string tickrate = std::to_string(int(1.0 / m_globals()->m_intervalpertick));
std::string server = "unknown";
INetChannelInfo* nci = m_engine()->GetNetChannelInfo();
if (nci)
{
server = nci->GetAddress();
if (!strcmp(server.c_str(), crypt_str("loopback")))
server = crypt_str("local server");
else if (m_gamerules()->m_bIsValveDS())
server = crypt_str("valve");
}
std::string watermark_name = cheat_name + space + user_name + space + time_name;
if (m_engine()->IsConnected() && m_engine()->IsInGame())
watermark_name = cheat_name + space + user_name + space + server + space + delay_name + ping + ms_name + space + tickrate + tick_name + space + time_name;
ImGui::PushFont(segoe_ui);
ImGui::SetNextWindowPos(ImVec2(1366 - (ImGui::CalcTextSize(watermark_name.c_str()).x + 14 + 8), 10));
ImGui::SetNextWindowSize(ImVec2(ImGui::CalcTextSize(watermark_name.c_str()).x + 14, 32));
ImGui::Begin("Watermark", nullptr, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_::ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_::ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_::ImGuiWindowFlags_NoNavFocus | ImGuiWindowFlags_::ImGuiWindowFlags_NoNav);
{
ImDrawList* draw = ImGui::GetWindowDrawList();
ImVec2 pos = ImGui::GetWindowPos();
ImVec2 size = ImGui::GetWindowSize();
draw->AddRectFilled(pos, pos + ImVec2(ImGui::CalcTextSize(watermark_name.c_str()).x + 15, 31), ImColor(33, 35, 40), 5);
draw->AddRectFilled(pos + ImVec2(2, 2), pos + ImVec2(ImGui::CalcTextSize(watermark_name.c_str()).x + 12, 30), ImColor(45, 48, 55), 3);
draw->AddRectFilledMultiColorRounded(pos + ImVec2(2, 2), pos + ImVec2(ImGui::CalcTextSize(watermark_name.c_str()).x + 12, 7), ImColor(45, 48, 55), ImColor(201, 113, 45), ImColor(254, 184, 100), ImColor(254, 184, 100), ImColor(201, 113, 45), 4);
draw->AddText(pos + ImVec2(8, 17 - ImGui::CalcTextSize(watermark_name.c_str()).y / 2), ImColor(214, 217, 225), watermark_name.c_str());
}
ImGui::End();
ImGui::PopFont();
}