diff --git a/Osiris/Config.cpp b/Osiris/Config.cpp index 0cfb8971..db67f36b 100644 --- a/Osiris/Config.cpp +++ b/Osiris/Config.cpp @@ -569,6 +569,11 @@ static void from_json(const json& j, Config::Misc::KeyBoardDisplay& kbd) static void from_json(const json& j, Config::Misc::Watermark& o) { read(j, "Enabled", o.enabled); + read(j, "Cheat", o.cheat); + read(j, "User", o.user); + read(j, "Fps", o.fps); + read(j, "Latency", o.latency); + read(j, "Time", o.wtime); read(j, "Pos", o.pos); } @@ -1215,7 +1220,11 @@ static void to_json(json& j, const Config::Misc::KeyBoardDisplay& o, const Confi static void to_json(json& j, const Config::Misc::Watermark& o, const Config::Misc::Watermark& dummy = {}) { WRITE("Enabled", enabled); - + WRITE("Cheat", cheat); + WRITE("User", user); + WRITE("Fps", fps); + WRITE("Latency", latency); + WRITE("Time", wtime); if (const auto window = ImGui::FindWindowByName("Watermark")) { j["Pos"] = window->Pos; } diff --git a/Osiris/Config.h b/Osiris/Config.h index 28387473..9cb7d69e 100644 --- a/Osiris/Config.h +++ b/Osiris/Config.h @@ -419,6 +419,11 @@ class Config { struct Watermark { bool enabled = false; + bool cheat = true; + bool user = true; + bool fps = true; + bool latency = true; + bool wtime = true; ImVec2 pos; }; Watermark watermark; diff --git a/Osiris/GUI.cpp b/Osiris/GUI.cpp index 7b491b6a..f37c2011 100644 --- a/Osiris/GUI.cpp +++ b/Osiris/GUI.cpp @@ -1869,6 +1869,20 @@ void GUI::renderMiscWindow() noexcept ImGui::PopID(); ImGui::Checkbox("Watermark", &config->misc.watermark.enabled); + ImGui::SameLine(); + + ImGui::PushID("Watermark"); + if (ImGui::Button("...")) + ImGui::OpenPopup(""); + + if (ImGui::BeginPopup("")) { + ImGui::Checkbox("Cheat", &config->misc.watermark.cheat); + ImGui::Checkbox("User", &config->misc.watermark.user); + ImGui::Checkbox("Fps", &config->misc.watermark.fps); + ImGui::Checkbox("Latency", &config->misc.watermark.latency); + ImGui::Checkbox("Time", &config->misc.watermark.wtime); + ImGui::EndPopup(); + } ImGuiCustom::colorPicker("Offscreen Enemies", config->misc.offscreenEnemies, &config->misc.offscreenEnemies.enabled); ImGui::SameLine(); ImGui::PushID("Offscreen Enemies"); diff --git a/Osiris/Hacks/Misc.cpp b/Osiris/Hacks/Misc.cpp index 396fde91..cedebf3c 100644 --- a/Osiris/Hacks/Misc.cpp +++ b/Osiris/Hacks/Misc.cpp @@ -1661,10 +1661,49 @@ void Misc::watermark() noexcept ImGui::SetNextWindowBgAlpha(0.3f); ImGui::Begin("Watermark", nullptr, windowFlags); + char* username = getenv("username"); + static auto frameRate = 1.0f; frameRate = 0.9f * frameRate + 0.1f * memory->globalVars->absoluteFrameTime; - ImGui::Text("Osiris | %d fps | %d ms", frameRate != 0.0f ? static_cast(1 / frameRate) : 0, GameData::getNetOutgoingLatency()); + static auto lastTime = 0.0f; + if (memory->globalVars->realtime - lastTime < 1.0f) + return; + + const auto time = std::time(nullptr); + const auto localTime = std::localtime(&time); + + //cheat + if (config->misc.watermark.cheat) + ImGui::Text("Osiris"); + ImGui::SameLine(); + if (config->misc.watermark.cheat && (config->misc.watermark.user || config->misc.watermark.fps || config->misc.watermark.latency || config->misc.watermark.wtime)) + ImGui::Text("|"); + ImGui::SameLine(); + //username + if (config->misc.watermark.user) + ImGui::Text(username); + ImGui::SameLine(); + if (config->misc.watermark.user && (config->misc.watermark.fps || config->misc.watermark.latency || config->misc.watermark.wtime)) + ImGui::Text("|"); + ImGui::SameLine(); + //fps + if (config->misc.watermark.fps) + ImGui::Text("%d fps", frameRate != 0.0f ? static_cast(1 / frameRate) : 0); + ImGui::SameLine(); + if (config->misc.watermark.fps && (config->misc.watermark.latency || config->misc.watermark.wtime)) + ImGui::Text("|"); + ImGui::SameLine(); + //latency + if (config->misc.watermark.latency) + ImGui::Text("%d ms", GameData::getNetOutgoingLatency()); + ImGui::SameLine(); + if (config->misc.watermark.latency && config->misc.watermark.wtime) + ImGui::Text("|"); + ImGui::SameLine(); + //time + if (config->misc.watermark.wtime) + ImGui::Text("%02d:%02d:%02d", localTime->tm_hour, localTime->tm_min, localTime->tm_sec); ImGui::End(); }