diff --git a/Source/UI/Chat/UINewChatWnd.h b/Source/UI/Chat/UINewChatWnd.h new file mode 100644 index 0000000..92996a7 --- /dev/null +++ b/Source/UI/Chat/UINewChatWnd.h @@ -0,0 +1,19 @@ +#ifndef RAGNAROK_SOURCE_UI_CHAT_UINEWCHATWND_H +#define RAGNAROK_SOURCE_UI_CHAT_UINEWCHATWND_H + +#include "UI/Window/UIFrameWnd.h" + +class UINewChatWnd : public UIFrameWnd { +public: + void Move(int x, int y) override; + +private: + /* 00BC */ int unknown_00BC; + /* 00C0 */ int unknown_00C0; + /* 00C4 */ int m_inputX; + /* 00C8 */ int m_inputY; + /* 00CC */ unsigned char unknown_00CC[0x50]; + /* 011C */ int m_inputOffsetY; +}; + +#endif diff --git a/Source/UI/Shortcuts/UIShortCutWnd.cpp b/Source/UI/Shortcuts/UIShortCutWnd.cpp index bb90e32..99ab98d 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.cpp +++ b/Source/UI/Shortcuts/UIShortCutWnd.cpp @@ -14,11 +14,13 @@ #include "UI/Shortcuts/ShortcutUse.h" #include "UI/Shortcuts/ShortcutVisibility.h" #include "UI/Shortcuts/UIShortCutWnd.h" +#include "UI/Chat/UINewChatWnd.h" #include "UI/Buttons/UIBitmapButton.h" #include "UI/Buttons/UIButton.h" #include "UI/Buttons/UICheckBox.h" #include "UI/Layout/WindowSnapping.h" #include "UI/Window/UIWindow.h" +#include "UI/Window/UIWindowMgr.h" #include #include @@ -413,3 +415,18 @@ int UIShortCutWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return this->UIFrameWnd::SendMsg(sender, message, a, b, c, d); } } + +// OFFSET: 0x0091E9C0 +// FUNCTION: fn_12631 +void UINewChatWnd::Move(int x, int y) { + this->UIFrameWnd::Move(x, y); + int screenX = 0; + int screenY = 0; + this->ToScreen(screenX, screenY); + this->m_inputX = screenX + 3; + this->m_inputY = this->m_inputOffsetY + screenY; + + if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_03F0)) { + window->SendMsg(this, 6, 197, this->geometry.x + x, this->geometry.y + y, 0); + } +}