diff --git a/Source/UI/Window/UIControl.cpp b/Source/UI/Window/UIControl.cpp index c0b3c17..72cabf8 100644 --- a/Source/UI/Window/UIControl.cpp +++ b/Source/UI/Window/UIControl.cpp @@ -1,5 +1,7 @@ #include "UI/Window/UIControl.h" +#include + // INLINED CUIControl::CUIControl(UIWindowContext& context) : UIWindow(context, 0), hitEnabled(1) { } @@ -101,6 +103,14 @@ void CUIControl::Slot35(int value) { } } +// OFFSET: 0x009EF5F0 +// FUNCTION: fn_14637 +bool CUIControl::IsPointInside(int x, int y) { + RECT rect = {this->geometry.x, this->geometry.y, this->geometry.x + this->geometry.width, this->geometry.y + this->geometry.height}; + POINT point = {x, y}; + return PtInRect(&rect, point) != FALSE; +} + // OFFSET: 0x009EF5E0 // FUNCTION: fn_14636 void CUIControl::Invalidate() { diff --git a/Source/UI/Window/UIControl.h b/Source/UI/Window/UIControl.h index a35fbd1..0b04e45 100644 --- a/Source/UI/Window/UIControl.h +++ b/Source/UI/Window/UIControl.h @@ -23,6 +23,8 @@ public: void Slot52(int value) override; virtual void Slot53(int value); + bool IsPointInside(int x, int y); + /* 007C */ unsigned char hitEnabled; };