diff --git a/KillproofUI.cpp b/KillproofUI.cpp index 618fd55..9cb62d2 100644 --- a/KillproofUI.cpp +++ b/KillproofUI.cpp @@ -19,9 +19,14 @@ void KillproofUI::openInBrowser(const char* username) { ShellExecuteA(nullptr, nullptr, buf, nullptr, nullptr, SW_SHOW); } -void KillproofUI::draw(const char* title, bool* p_open, ImGuiWindowFlags flags) { +void KillproofUI::draw(bool* p_open, ImGuiWindowFlags flags) { // ImGui::SetNextWindowSizeConstraints(ImVec2(150, 50), ImVec2(windowWidth, windowsHeight)); - ImGui::Begin(title, p_open, flags); + std::string title = Lang::translate(LangKey::KpWindowName); + title.append("##Killproof.me"); + + flags |= ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav; + + ImGui::Begin(title.c_str(), p_open, flags); // lock the mutexes, before we access sensible data std::scoped_lock lock(trackedPlayersMutex, cachedPlayersMutex); diff --git a/KillproofUI.h b/KillproofUI.h index 32e8cbe..e33e51d 100644 --- a/KillproofUI.h +++ b/KillproofUI.h @@ -9,7 +9,7 @@ class KillproofUI public: std::atomic_bool needSort = false; - void draw(const char* title, bool* p_open, ImGuiWindowFlags flags); + void draw(bool* p_open, ImGuiWindowFlags flags); void AlignedTextColumn(const char* text, ...) const; void TableHeader(const char* label, bool show_text); diff --git a/dllmain.cpp b/dllmain.cpp index f59ccbd..c680dea 100644 --- a/dllmain.cpp +++ b/dllmain.cpp @@ -297,8 +297,7 @@ void ShowKillproof(bool* p_open) { std::string title = Lang::translate(LangKey::KpWindowName); title.append("##Killproof.me"); - killproofUi.draw(title.c_str(), p_open, - ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize | (!canMoveWindows() ? ImGuiWindowFlags_NoMove : 0)); + killproofUi.draw(p_open, (!canMoveWindows() ? ImGuiWindowFlags_NoMove : 0)); } }