diff --git a/Source/UI/Window/FrameFocus.cpp b/Source/UI/Window/FrameFocus.cpp index 954c8401..94f28750 100644 --- a/Source/UI/Window/FrameFocus.cpp +++ b/Source/UI/Window/FrameFocus.cpp @@ -1,8 +1,8 @@ #include "UI/Window/UIWindow.h" #include "UI/Window/UIWindowMgr.h" - +#include "UI/Lists/UIDropDownBox.h" #include - +#include "Client/Session.h" // STATIC: 0x014576A0 // GLOBAL: gl_24367 int g_dragWindowId = -1; @@ -71,3 +71,91 @@ void UIWindowMgr::ReleaseCapture() { UIWindow* UIWindowMgr::Capture() const { return this->inputWindow; } + +// OFFSET: 0x00A96A40 +// FUNCTION: fn_17191 +bool UIWindowMgr::IsDropDownChild(const UIWindow* window) { + if (!this->window_0A30 || !this->window_0A30->geometry.visible) { + return false; + } + + return static_cast(this->window_0A30)->HasChild(window); +} + +// OFFSET: 0x00A96E60 +// FUNCTION: fn_17194 +bool UIWindowMgr::IsHoverParentVisible() { + if (this->hoverWindow) { + UIWindow* parent = this->hoverWindow->parent; + if (parent && parent != this->window_01C8 && parent->geometry.visible) { + return true; + } + } + + return false; +} + +// OFFSET: 0x00A96E90 +// FUNCTION: fn_17195 +bool UIWindowMgr::IsFriend(const char* name) { + return g_session.IsFriendName(name) != 0; +} + +// OFFSET: 0x00A96EB0 +// FUNCTION: fn_17196 +bool UIWindowMgr::IsSharedWindowId(int id) { + switch (id) { + case 9: + case 13: + case 16: + case 17: + case 18: + case 20: + case 45: + case 112: + case 113: + case 114: + case 115: + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + case 123: + return true; + default: + return false; + } +} + +// OFFSET: 0x00A97070 +// FUNCTION: fn_17198 +bool UIWindowMgr::HasNavigationBlocker() { + return this->window_4F260 || this->window_4F264 || this->window_4F268 || this->window_4F26C; +} + +// OFFSET: 0x00A97410 +// FUNCTION: fn_17203 +bool UIWindowMgr::HasPendingDialog() { + return this->unknown_0284 || this->unknown_02CC || this->unknown_02D0 || this->unknown_02D4 || this->unknown_02D8 || this->unknown_02DC || + this->unknown_02E0 || this->unknown_02E4 || this->unknown_02E8 || this->unknown_02EC || this->unknown_03B4 || this->unknown_01F0 || + this->unknown_01F4; +} + +// OFFSET: 0x00A97490 +// FUNCTION: fn_17204 +void UIWindowMgr::CancelActiveDialog() { + UIWindow* window = this->window_03DC; + if (window || (window = this->unknown_03B0) != nullptr) { + window->SendMsg(nullptr, 20, 0, 0, 0, 0); + return; + } + + for (auto entry = this->rendered.begin(); entry != this->rendered.end(); ++entry) { + if ((*entry)->Slot02()) { + (*entry)->SendMsg(nullptr, 20, 0, 0, 0, 0); + } + } +} diff --git a/Source/UI/Window/UIWindowMgr.h b/Source/UI/Window/UIWindowMgr.h index d5130ce0..ded0e155 100644 --- a/Source/UI/Window/UIWindowMgr.h +++ b/Source/UI/Window/UIWindowMgr.h @@ -269,7 +269,7 @@ public: /* 03A4 */ UIWindow* window_03A4; /* 03A8 */ std::uint32_t unknown_03A8; /* 03AC */ UIWindow* window_03AC; - /* 03B0 */ std::uint32_t unknown_03B0; + /* 03B0 */ UIWindow* unknown_03B0; /* 03B4 */ std::uint32_t unknown_03B4; /* 03B8 */ std::uint32_t unknown_03B8; /* 03BC */ std::uint32_t unknown_03BC; @@ -466,6 +466,13 @@ public: int GetRenderedWindowIds(int* ids); void HideWindow01C8(); bool HasUnknown030C(); + bool IsDropDownChild(const UIWindow* window); + bool IsHoverParentVisible(); + bool IsFriend(const char* name); + bool IsSharedWindowId(int id); + bool HasNavigationBlocker(); + bool HasPendingDialog(); + void CancelActiveDialog(); }; extern UIWindowMgr g_windowMgr;