diff --git a/Source/UI/Window/UIBank_NewWnd.h b/Source/UI/Window/UIBank_NewWnd.h index e652fe2..758bdf3 100644 --- a/Source/UI/Window/UIBank_NewWnd.h +++ b/Source/UI/Window/UIBank_NewWnd.h @@ -12,10 +12,13 @@ public: long long TransactionAmount(unsigned char deposit); void Paint() override; bool IsNumeric(std::string text); + void AnimateLoading(); protected: /* 00B4 */ UIEditCtrl* m_amountEdit; /* 00B8 */ std::string m_status; + /* 00D0 */ int unknown_00D0; + /* 00D4 */ UIWindow* m_loading[4]; UIButtonContext* m_controls; }; diff --git a/Source/UI/Window/UIChatRoomWnd.h b/Source/UI/Window/UIChatRoomWnd.h index 17aea1f..5745984 100644 --- a/Source/UI/Window/UIChatRoomWnd.h +++ b/Source/UI/Window/UIChatRoomWnd.h @@ -2,13 +2,18 @@ #define RAGNAROK_SOURCE_UI_WINDOW_UICHATROOMWND_H #include "UI/Window/UIFrameWnd.h" +#include "Contents/UserData/NormalItemSlots.h" struct UIButtonContext; class UIChatRoomWnd : public UIFrameWnd { public: + void Slot11() override; void Paint() override; + /* 00B4 */ unsigned char unknown_00B4[0x6C]; + /* 0120 */ ChatRoomWndInfo* saved; + protected: UIButtonContext* m_controls; }; diff --git a/Source/UI/Window/UIHomunInfoWnd.h b/Source/UI/Window/UIHomunInfoWnd.h new file mode 100644 index 0000000..f0d354e --- /dev/null +++ b/Source/UI/Window/UIHomunInfoWnd.h @@ -0,0 +1,15 @@ +#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIHOMUNINFOWND_H +#define RAGNAROK_SOURCE_UI_WINDOW_UIHOMUNINFOWND_H + +#include "UI/Window/UIFrameWnd.h" +#include "Contents/UserData/NormalItemSlots.h" + +class UIHomunInfoWnd : public UIFrameWnd { +public: + void Slot11() override; + + /* 00B4 */ unsigned char unknown_00B4[0x18]; + /* 00CC */ HomunInfoWndInfo* saved; +}; + +#endif diff --git a/Source/UI/Window/UILoginOTPWnd.h b/Source/UI/Window/UILoginOTPWnd.h new file mode 100644 index 0000000..46f16b3 --- /dev/null +++ b/Source/UI/Window/UILoginOTPWnd.h @@ -0,0 +1,16 @@ +#ifndef RAGNAROK_SOURCE_UI_WINDOW_UILOGINOTPWND_H +#define RAGNAROK_SOURCE_UI_WINDOW_UILOGINOTPWND_H + +#include "UI/Window/UIFrameWnd.h" + +struct UIButtonContext; + +class UILoginOTPWnd : public UIFrameWnd { +public: + void Paint() override; + +protected: + UIButtonContext* m_controls; +}; + +#endif diff --git a/Source/UI/Window/UILoginWnd.h b/Source/UI/Window/UILoginWnd.h index 168eebe..e8b6280 100644 --- a/Source/UI/Window/UILoginWnd.h +++ b/Source/UI/Window/UILoginWnd.h @@ -3,9 +3,17 @@ #include "UI/Window/UIFrameWnd.h" +class UIEditCtrl; + class UILoginWnd : public UIFrameWnd { public: + void Slot11() override; void Paint() override; + void SaveLogin(); + + /* 00B4 */ UIEditCtrl* idEdit; + /* 00B8 */ unsigned char unknown_00B8[0x10]; + /* 00C8 */ int saveId; }; #endif diff --git a/Source/UI/Window/UIMerInfoWnd.h b/Source/UI/Window/UIMerInfoWnd.h index 3230ddc..e285e89 100644 --- a/Source/UI/Window/UIMerInfoWnd.h +++ b/Source/UI/Window/UIMerInfoWnd.h @@ -2,13 +2,18 @@ #define RAGNAROK_SOURCE_UI_WINDOW_UIMERINFOWND_H #include "UI/Window/UIFrameWnd.h" +#include "Contents/UserData/NormalItemSlots.h" struct UIButtonContext; class UIMerInfoWnd : public UIFrameWnd { public: + void Slot11() override; void Paint() override; + /* 00B4 */ unsigned char unknown_00B4[0x10]; + /* 00C4 */ MerInfoWndInfo* saved; + protected: UIButtonContext* m_controls; }; diff --git a/Source/UI/Window/UIMessageBox.cpp b/Source/UI/Window/UIMessageBox.cpp index e25d72d..2603284 100644 --- a/Source/UI/Window/UIMessageBox.cpp +++ b/Source/UI/Window/UIMessageBox.cpp @@ -21,6 +21,18 @@ #include "UI/Window/WindowBorder.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Window/UIMerInfoWnd.h" +#include "UI/Window/UIMessageBoxAutoreturn.h" +#include "UI/Window/UIMonsterInfoWnd.h" +#include "UI/Window/UITalkboxTrapInputWnd.h" +#include "UI/Window/UIHomunInfoWnd.h" +#include "UI/Window/UIPetInfoWnd.h" +#include "UI/Window/UIReplayRECControlWnd.h" +#include "Client/Mode/ActiveGameMode.h" +#include "Client/Registry.h" +#include "Utility/Cipher/XorBytes.h" +#include "UI/Window/UILoginOTPWnd.h" +#include "UI/Window/InputFocus.h" +#include "UI/Buttons/UIButton.h" #include "Render/Text/TextContext.h" #include @@ -33,6 +45,35 @@ namespace { constexpr char prefix[] = "유저인터페이스\\"; + template + class EncryptedName { + public: + explicit EncryptedName(const std::uint8_t (&source)[Length]) : m_encrypted(true) { + for (std::uint64_t index = 0; index < Length; ++index) { + this->m_text[index] = source[index]; + } + } + + ~EncryptedName() { + for (std::uint64_t index = 0; index < Length; ++index) { + this->m_text[index] = 0; + } + } + + const char* Text() { + if (this->m_encrypted) { + utility::XorBytes(this->m_text, Length, Key); + this->m_encrypted = false; + } + + return reinterpret_cast(this->m_text); + } + + private: + std::uint8_t m_text[Length]; + bool m_encrypted; + }; + // INLINED std::uint32_t Palette(ResourceMgr& resources, int x, int y) { const auto* resource = static_cast(resources.Load((std::string(prefix) + "colorchip.bmp").c_str())); @@ -516,3 +557,35 @@ int UIMessageBox::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i return UIFrameWnd::SendMsg(sender, message, a, b, c, d); } } + +// OFFSET: 0x008BFB70 + +// OFFSET: 0x008BFBA0 + +// OFFSET: 0x008C1DB0 + +// OFFSET: 0x008C1ED0 + +// OFFSET: 0x008C35A0 + +// OFFSET: 0x008C35E0 + +// OFFSET: 0x008C3630 + +// OFFSET: 0x008C3670 + +// OFFSET: 0x008C36B0 + +// OFFSET: 0x008A6DC0 + +// OFFSET: 0x008B84B0 + +// OFFSET: 0x008C3620 +// FUNCTION: fn_11826 +void UILoginWnd::Slot11() { + this->SaveLogin(); +} + +// OFFSET: 0x008C39E0 + +// OFFSET: 0x008C1F00 diff --git a/Source/UI/Window/UIMessageBoxAutoreturn.h b/Source/UI/Window/UIMessageBoxAutoreturn.h new file mode 100644 index 0000000..665b644 --- /dev/null +++ b/Source/UI/Window/UIMessageBoxAutoreturn.h @@ -0,0 +1,11 @@ +#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIMESSAGEBOXAUTORETURN_H +#define RAGNAROK_SOURCE_UI_WINDOW_UIMESSAGEBOXAUTORETURN_H + +#include "UI/Window/UIFrameWnd.h" + +class UIMessageBoxAutoreturn : 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 diff --git a/Source/UI/Window/UIMonsterInfoWnd.h b/Source/UI/Window/UIMonsterInfoWnd.h new file mode 100644 index 0000000..c4a6b1a --- /dev/null +++ b/Source/UI/Window/UIMonsterInfoWnd.h @@ -0,0 +1,28 @@ +#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIMONSTERINFOWND_H +#define RAGNAROK_SOURCE_UI_WINDOW_UIMONSTERINFOWND_H + +#include "UI/Window/UIFrameWnd.h" + +struct MonsterInfo { + /* 0000 */ int unknown_0000; + /* 0004 */ int unknown_0004; + /* 0008 */ int unknown_0008; + /* 000C */ int unknown_000C; + /* 0010 */ int unknown_0010; + /* 0014 */ int unknown_0014; + /* 0018 */ int unknown_0018; + /* 001C */ unsigned char unknown_001C; +}; + +class UIMonsterInfoWnd : 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; + + /* 00B4 */ MonsterInfo info; +}; + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(MonsterInfo) == 32); +#endif + +#endif diff --git a/Source/UI/Window/UIPetInfoWnd.h b/Source/UI/Window/UIPetInfoWnd.h new file mode 100644 index 0000000..5fe14d9 --- /dev/null +++ b/Source/UI/Window/UIPetInfoWnd.h @@ -0,0 +1,15 @@ +#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIPETINFOWND_H +#define RAGNAROK_SOURCE_UI_WINDOW_UIPETINFOWND_H + +#include "UI/Window/UIFrameWnd.h" +#include "Contents/UserData/NormalItemSlots.h" + +class UIPetInfoWnd : public UIFrameWnd { +public: + void Slot11() override; + + /* 00B4 */ unsigned char unknown_00B4[0x4]; + /* 00B8 */ PetInfoWndInfo* saved; +}; + +#endif diff --git a/Source/UI/Window/UIReplayRECControlWnd.h b/Source/UI/Window/UIReplayRECControlWnd.h new file mode 100644 index 0000000..93eef13 --- /dev/null +++ b/Source/UI/Window/UIReplayRECControlWnd.h @@ -0,0 +1,43 @@ +#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIREPLAYRECCONTROLWND_H +#define RAGNAROK_SOURCE_UI_WINDOW_UIREPLAYRECCONTROLWND_H + +#include "Contents/UserData/NormalItemSlots.h" +#include "UI/Window/UIFrameWnd.h" + +#include + +class UIButton; +struct InputFocus; + +class UIReplayRECControlWnd : public UIFrameWnd { +public: + void Slot11() override; + void ApplyMode(); + + /* 00B4 */ int mode; + /* 00B8 */ int unknown_00B8; + /* 00BC */ UIWindow* window_00BC; + /* 00C0 */ UIWindow* window_00C0; + /* 00C4 */ UIWindow* window_00C4; + /* 00C8 */ UIButton* button_00C8; + /* 00CC */ UIWindow* window_00CC; + /* 00D0 */ UIButton* button_00D0; + /* 00D4 */ UIWindow* tabs[5]; + /* 00E8 */ UIWindow* window_00E8; + /* 00EC */ UIWindow* window_00EC; + /* 00F0 */ std::uint32_t recordStart; + /* 00F4 */ UIWindow* options[10]; + /* 011C */ int unknown_011C; + /* 0120 */ int unknown_0120; + /* 0124 */ int unknown_0124; + /* 0128 */ UIWindow* window_0128; + /* 012C */ UIWindow* window_012C; + /* 0130 */ int unknown_0130; + /* 0134 */ UIWindow* window_0134; + /* 0138 */ ReplayRECControlWndInfo* saved; + +protected: + InputFocus* m_focus; +}; + +#endif diff --git a/Source/UI/Window/UITalkboxTrapInputWnd.h b/Source/UI/Window/UITalkboxTrapInputWnd.h new file mode 100644 index 0000000..8985ada --- /dev/null +++ b/Source/UI/Window/UITalkboxTrapInputWnd.h @@ -0,0 +1,28 @@ +#ifndef RAGNAROK_SOURCE_UI_WINDOW_UITALKBOXTRAPINPUTWND_H +#define RAGNAROK_SOURCE_UI_WINDOW_UITALKBOXTRAPINPUTWND_H + +#include "UI/Window/UIFrameWnd.h" + +class UIEditCtrl; + +struct TalkboxTrapTarget { + /* 0000 */ int unknown_0000; + /* 0004 */ int unknown_0004; + /* 0008 */ int unknown_0008; + /* 000C */ int unknown_000C; +}; + +struct TalkboxTrapRequest { + /* 0000 */ TalkboxTrapTarget target; + /* 0010 */ const char* text; +}; + +class UITalkboxTrapInputWnd : 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; + + /* 00B4 */ TalkboxTrapTarget target; + /* 00C4 */ UIEditCtrl* edit; +}; + +#endif diff --git a/Source/UI/Window/UIWindowMgr.h b/Source/UI/Window/UIWindowMgr.h index fc3901a..5f39e58 100644 --- a/Source/UI/Window/UIWindowMgr.h +++ b/Source/UI/Window/UIWindowMgr.h @@ -424,6 +424,7 @@ public: UIWindow* LookupWindow(int id); void GetMiniPartyUsableArea(RECT* area); void Schedule(UIWindow* window); + void SetUnknown04DC(const char* text); void Destroy(UIWindow* window); void ForgetWindowReferences(UIWindow* removed); void DismissTransient();