diff --git a/src/overlay/Overlay.cpp b/src/overlay/Overlay.cpp index a72fdd64..e14ce914 100644 --- a/src/overlay/Overlay.cpp +++ b/src/overlay/Overlay.cpp @@ -20,6 +20,11 @@ void Overlay::PostInitialize() d3d12.DelayedSetTrapInputInImGui(true); ClipToCenter(RED4ext::CGameEngine::Get()->unkD0); } + else + { + const auto cOverlayBindCode = CET::Get().GetBindings().GetBindCodeForModBind(Bindings::GetOverlayToggleModBind()); + ImGui::InsertNotification({ImGuiToastType::Info, NOTIFY_DEFAULT_DISMISS, "CET Overlay Bind: %s", VKBindings::GetBindString(cOverlayBindCode).c_str()}); + } m_initialized = true; } @@ -195,6 +200,22 @@ void Overlay::Update() } } + // Notifications style setup + ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.f); // Disable round borders + ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.f); // Disable borders + + // Notifications color setup + ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.10f, 0.10f, 0.10f, 1.00f)); // Background color + + // Main rendering function + ImGui::RenderNotifications(); + + //——————————————————————————————— WARNING ——————————————————————————————— + // Argument MUST match the amount of ImGui::PushStyleVar() calls + ImGui::PopStyleVar(2); + // Argument MUST match the amount of ImGui::PushStyleColor() calls + ImGui::PopStyleColor(1); + if (!m_enabled) return; diff --git a/src/stdafx.h b/src/stdafx.h index 2add06f0..ba8624f6 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -70,6 +70,7 @@ #include "CETVersion.h" #include "common/Logging.h" #include "common/FontMaterialDesignIcons.h" +#include "common/ImGuiNotify.hpp" #include "Options.h" #include "Paths.h" #include "PersistentState.h" diff --git a/xmake.lua b/xmake.lua index 576aee4a..3893c549 100644 --- a/xmake.lua +++ b/xmake.lua @@ -69,7 +69,7 @@ target("cyber_engine_tweaks") set_kind("shared") set_filename("cyber_engine_tweaks.asi") add_files("src/**.cpp") - add_headerfiles("src/**.h", "build/CETVersion.h") + add_headerfiles("src/**.h", "src/**.hpp", "build/CETVersion.h") add_includedirs("src/", "build/") add_syslinks("User32", "Version", "d3d11", "dxgi") add_packages("spdlog", "nlohmann_json", "minhook", "hopscotch-map", "imgui", "mem", "sol2", "tiltedcore", "sqlite3", "openrestry-luajit", "xbyak", "stb")