diff --git a/Source/UI/Chat/UISubChatMiniWnd.h b/Source/UI/Chat/UISubChatMiniWnd.h new file mode 100644 index 0000000..c408c2f --- /dev/null +++ b/Source/UI/Chat/UISubChatMiniWnd.h @@ -0,0 +1,16 @@ +#ifndef RAGNAROK_SOURCE_UI_CHAT_UISUBCHATMINIWND_H +#define RAGNAROK_SOURCE_UI_CHAT_UISUBCHATMINIWND_H + +#include "UI/Window/UIFrameWnd.h" + +class UISubChatMiniWnd : public UIFrameWnd { +public: + int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override; + +private: + /* 00B4 */ int unknown_00B4; + /* 00B8 */ int m_rowHeight; + /* 00BC */ int m_offsetY; +}; + +#endif diff --git a/Source/UI/Dialogs/UIMemorialDunWnd.h b/Source/UI/Dialogs/UIMemorialDunWnd.h new file mode 100644 index 0000000..1b71374 --- /dev/null +++ b/Source/UI/Dialogs/UIMemorialDunWnd.h @@ -0,0 +1,14 @@ +#ifndef RAGNAROK_SOURCE_UI_DIALOGS_UIMEMORIALDUNWND_H +#define RAGNAROK_SOURCE_UI_DIALOGS_UIMEMORIALDUNWND_H + +#include "UI/Window/UIFrameWnd.h" + +extern int g_memorialDunWndX; +extern int g_memorialDunWndY; + +class UIMemorialDunWnd : public UIFrameWnd { +public: + void Move(int x, int y) override; +}; + +#endif diff --git a/Source/UI/Shortcuts/UIShortCutWnd.cpp b/Source/UI/Shortcuts/UIShortCutWnd.cpp index d630c01..5117473 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.cpp +++ b/Source/UI/Shortcuts/UIShortCutWnd.cpp @@ -15,18 +15,29 @@ #include "UI/Shortcuts/ShortcutVisibility.h" #include "UI/Shortcuts/UIShortCutWnd.h" #include "UI/Chat/UINewChatWnd.h" +#include "UI/Chat/UISubChatMiniWnd.h" +#include "UI/Dialogs/UIMemorialDunWnd.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 "UI/Window/UIWindowCallBtnWnd.h" +#include "UI/Window/WindowManagerWindows.h" +#include "Render/Renderer.h" #include #include namespace {} +// GLOBAL: gl_24737 +int g_memorialDunWndX; + +// GLOBAL: gl_24738 +int g_memorialDunWndY; + // OFFSET: 0x009122B0 // FUNCTION: fn_12528 UIShortCutWnd::UIShortCutWnd(UIWindowContext& windows, UIFrameContext& frames, ShortcutWindowContext& shortcuts) @@ -429,3 +440,42 @@ void UINewChatWnd::Move(int x, int y) { window->SendMsg(this, 6, 197, this->geometry.x + x, this->geometry.y + y, 0); } } + +// OFFSET: 0x0091E960 +// FUNCTION: fn_12630 +void UIMemorialDunWnd::Move(int x, int y) { + const int left = x <= g_renderer->viewport.width - this->geometry.width ? x : 0; + const int top = y <= g_renderer->viewport.height - this->geometry.height ? y : 310; + this->UIFrameWnd::Move(left, top); + + if (g_memorialDunWndX != left) { + g_memorialDunWndX = left; + } + if (g_memorialDunWndY != top) { + g_memorialDunWndY = top; + } +} + +// OFFSET: 0x0093CA50 +// FUNCTION: fn_12762 +int UISubChatMiniWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { + if (message != 6) { + return this->UIFrameWnd::SendMsg(sender, message, a, b, c, d); + } + + if (a == 197) { + this->Move(b, c - this->m_offsetY); + } else if (a == 202) { + this->Slot25(this->m_rowHeight * b + 1, 0); + } + return 0; +} + +// OFFSET: 0x0093CAB0 +// FUNCTION: fn_12763 +int UIWindowCallBtnWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intptr_t, std::intptr_t, std::intptr_t) { + if (message == 6) { + this->m_frameContext->windows.EnsureWindow(a); + } + return 0; +} diff --git a/Source/UI/Window/UIWindowCallBtnWnd.h b/Source/UI/Window/UIWindowCallBtnWnd.h new file mode 100644 index 0000000..7e33661 --- /dev/null +++ b/Source/UI/Window/UIWindowCallBtnWnd.h @@ -0,0 +1,11 @@ +#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIWINDOWCALLBTNWND_H +#define RAGNAROK_SOURCE_UI_WINDOW_UIWINDOWCALLBTNWND_H + +#include "UI/Window/UIFrameWnd.h" + +class UIWindowCallBtnWnd : public UIFrameWnd { +public: + int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override; +}; + +#endif