diff --git a/Source/UI/Buttons/UIBmpTextButton.h b/Source/UI/Buttons/UIBmpTextButton.h index 1678bde..a0bfdf0 100644 --- a/Source/UI/Buttons/UIBmpTextButton.h +++ b/Source/UI/Buttons/UIBmpTextButton.h @@ -3,14 +3,16 @@ #include "UI/Buttons/UIBitmapButton.h" +#include + struct BitmapButtonTextStyle { - int state; - int x; - int y; - int height; - unsigned char bold; - std::uint32_t color; - unsigned char shadow; + /* 0000 */ int state; + /* 0004 */ int x; + /* 0008 */ int y; + /* 000C */ int height; + /* 0010 */ unsigned char bold; + /* 0014 */ std::uint32_t color; + /* 0018 */ unsigned char shadow; }; class UIBmpTextButton : public UIBitmapButton { @@ -26,6 +28,13 @@ public: #if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(BitmapButtonTextStyle) == 28); +static_assert(offsetof(BitmapButtonTextStyle, state) == 0x0000); +static_assert(offsetof(BitmapButtonTextStyle, x) == 0x0004); +static_assert(offsetof(BitmapButtonTextStyle, y) == 0x0008); +static_assert(offsetof(BitmapButtonTextStyle, height) == 0x000C); +static_assert(offsetof(BitmapButtonTextStyle, bold) == 0x0010); +static_assert(offsetof(BitmapButtonTextStyle, color) == 0x0014); +static_assert(offsetof(BitmapButtonTextStyle, shadow) == 0x0018); static_assert(sizeof(UIBmpTextButton) == 332); #endif diff --git a/Source/UI/Chat/ChatNotifications.h b/Source/UI/Chat/ChatNotifications.h index af79c0a..bc88fe6 100644 --- a/Source/UI/Chat/ChatNotifications.h +++ b/Source/UI/Chat/ChatNotifications.h @@ -5,6 +5,7 @@ #include "UI/Text/TextWrapping.h" #include "UI/Window/UIWindow.h" +#include #include #include #include @@ -15,8 +16,8 @@ class UIWindow; struct ShortcutVisibility; struct QueuedChatNotification { - std::string text; - std::uint32_t color; + /* 0000 */ std::string text; + /* 0018 */ std::uint32_t color; }; struct ChatNotifications { @@ -66,4 +67,9 @@ inline void ChatNotifications::Refresh() { } } +#if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(QueuedChatNotification) == 0x1C); +static_assert(offsetof(QueuedChatNotification, color) == 0x0018); +#endif + #endif diff --git a/Source/UI/Cooldowns/CooldownDrawing.h b/Source/UI/Cooldowns/CooldownDrawing.h index 1874287..1a6d273 100644 --- a/Source/UI/Cooldowns/CooldownDrawing.h +++ b/Source/UI/Cooldowns/CooldownDrawing.h @@ -3,6 +3,7 @@ #include "UI/Cooldowns/CooldownState.h" +#include #include class RenderCommandPool; @@ -10,8 +11,8 @@ class CRenderSystemBase; struct RenderQueues; struct CooldownDrawing { - std::vector normal; - std::vector reverse; + /* 0004 */ std::vector normal; + /* 0010 */ std::vector reverse; void Draw( int centerX, int centerY, int radiusX, int radiusY, CooldownState& value, int limit, int offsetX, int offsetY, const CooldownClock& clock, @@ -24,4 +25,10 @@ private: void DrawReverse(CooldownState& value, const CooldownClock& clock, RenderCommandPool& pool, CRenderSystemBase& system); }; +#if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(CooldownDrawing) == 0x18); +static_assert(offsetof(CooldownDrawing, normal) == 0x00); +static_assert(offsetof(CooldownDrawing, reverse) == 0x0C); +#endif + #endif diff --git a/Source/UI/Cooldowns/CooldownState.h b/Source/UI/Cooldowns/CooldownState.h index 5f19774..255f742 100644 --- a/Source/UI/Cooldowns/CooldownState.h +++ b/Source/UI/Cooldowns/CooldownState.h @@ -3,13 +3,14 @@ #include "Render/Primitives/RenderPrimitive.h" +#include #include struct CooldownEdge { - float origin; - float current; - int radius; - unsigned char increasing; + /* 0000 */ float origin; + /* 0004 */ float current; + /* 0008 */ int radius; + /* 000C */ unsigned char increasing; }; struct CooldownClock { @@ -42,6 +43,9 @@ struct CooldownState { static_assert(sizeof(CooldownEdge) == 16); #if defined(_WIN32) && !defined(_WIN64) +static_assert(offsetof(CooldownEdge, current) == 0x04); +static_assert(offsetof(CooldownEdge, radius) == 0x08); +static_assert(offsetof(CooldownEdge, increasing) == 0x0C); static_assert(sizeof(CooldownState) == 824); #endif diff --git a/Source/UI/Edit/ItemTagRetirement.h b/Source/UI/Edit/ItemTagRetirement.h index 24f2a4e..e250834 100644 --- a/Source/UI/Edit/ItemTagRetirement.h +++ b/Source/UI/Edit/ItemTagRetirement.h @@ -9,8 +9,8 @@ class UIWindow; struct InputFocus; struct ItemTagRecord { - UIWindow* child; - std::array unknown_0004; + /* 0000 */ UIWindow* child; + /* 0004 */ std::array unknown_0004; }; class ItemTagRemoval { @@ -38,6 +38,8 @@ struct ItemTagRetirement { #if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(ItemTagRecord) == 456); +static_assert(offsetof(ItemTagRecord, child) == 0x0000); +static_assert(offsetof(ItemTagRecord, unknown_0004) == 0x0004); #endif #endif diff --git a/Source/UI/Layout/SnapRectangle.h b/Source/UI/Layout/SnapRectangle.h index fb275b8..9714f7f 100644 --- a/Source/UI/Layout/SnapRectangle.h +++ b/Source/UI/Layout/SnapRectangle.h @@ -1,24 +1,35 @@ #ifndef RAGNAROK_SOURCE_UI_LAYOUT_SNAPRECTANGLE_H #define RAGNAROK_SOURCE_UI_LAYOUT_SNAPRECTANGLE_H +#include #include struct SnapRectangle { struct Edge { - std::int32_t position; - std::int32_t begin; - std::int32_t end; + /* 0000 */ std::int32_t position; + /* 0004 */ std::int32_t begin; + /* 0008 */ std::int32_t end; }; - Edge left; - Edge right; - Edge top; - Edge bottom; + /* 0000 */ Edge left; + /* 000C */ Edge right; + /* 0018 */ Edge top; + /* 0024 */ Edge bottom; void Set(int x, int y, int width, int height); void ReverseEdges(); void Snap(const SnapRectangle& other, int& dx, int& dy) const; }; +#if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(SnapRectangle) == 48); +static_assert(sizeof(SnapRectangle::Edge) == 12); +static_assert(offsetof(SnapRectangle::Edge, position) == 0x0); +static_assert(offsetof(SnapRectangle::Edge, begin) == 0x4); +static_assert(offsetof(SnapRectangle::Edge, end) == 0x8); +static_assert(offsetof(SnapRectangle, left) == 0x0); +static_assert(offsetof(SnapRectangle, right) == 0xC); +static_assert(offsetof(SnapRectangle, top) == 0x18); +static_assert(offsetof(SnapRectangle, bottom) == 0x24); +#endif #endif diff --git a/Source/UI/Lists/UIListBoxEx.h b/Source/UI/Lists/UIListBoxEx.h index c17e3eb..00a719e 100644 --- a/Source/UI/Lists/UIListBoxEx.h +++ b/Source/UI/Lists/UIListBoxEx.h @@ -10,8 +10,8 @@ struct UIListBoxContext; class UIScrollBar; struct ExtendedListLine { - std::string text; - std::uint32_t color = 0; + /* 0000 */ std::string text; + /* 0018 */ std::uint32_t color = 0; }; class UIListBoxEx : public UIWindow { diff --git a/Source/UI/MiniPartyGrid.h b/Source/UI/MiniPartyGrid.h index 252ac4b..13677b5 100644 --- a/Source/UI/MiniPartyGrid.h +++ b/Source/UI/MiniPartyGrid.h @@ -6,15 +6,15 @@ #include struct MiniPartyGridPoint { - int x; - int y; + /* 0000 */ int x; + /* 0004 */ int y; }; struct MiniPartyGridRectangle { - int left; - int top; - int right; - int bottom; + /* 0000 */ int left; + /* 0004 */ int top; + /* 0008 */ int right; + /* 000C */ int bottom; }; struct MiniPartyGrid { @@ -38,6 +38,10 @@ extern int g_miniPartyCellWidth; extern int g_miniPartyCellHeight; #if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(MiniPartyGridPoint) == 0x08); +static_assert(offsetof(MiniPartyGridPoint, y) == 0x04); +static_assert(sizeof(MiniPartyGridRectangle) == 0x10); +static_assert(offsetof(MiniPartyGridRectangle, bottom) == 0x0C); static_assert(offsetof(MiniPartyGrid, exclusions) == 0x1C); static_assert(offsetof(MiniPartyGrid, availableCells) == 0x28); static_assert(sizeof(MiniPartyGrid) == 0x34); diff --git a/Source/UI/Party/UIAdvenPartyBoardWnd.h b/Source/UI/Party/UIAdvenPartyBoardWnd.h index 759bded..7a09f1a 100644 --- a/Source/UI/Party/UIAdvenPartyBoardWnd.h +++ b/Source/UI/Party/UIAdvenPartyBoardWnd.h @@ -5,6 +5,7 @@ #include "UI/Window/UIFrameWnd.h" #include "UI/Lists/UIListBoxEx.h" +#include #include class UIStaticText; @@ -18,10 +19,10 @@ struct UIComboBoxHeaderContext; struct PartyRowContext; struct ExtendedListLine; struct PartyBoardPlacement { - int x; - int y; - int width; - int height; + /* 0000 */ int x; + /* 0004 */ int y; + /* 0008 */ int width; + /* 000C */ int height; }; struct AgencyRequestContext; @@ -91,6 +92,9 @@ private: }; #if defined(_WIN32) && !defined(_WIN64) +static_assert(offsetof(PartyBoardPlacement, y) == 0x04); +static_assert(offsetof(PartyBoardPlacement, width) == 0x08); +static_assert(offsetof(PartyBoardPlacement, height) == 0x0C); static_assert(sizeof(UIAdvenPartyBoardWnd) == 352); #endif diff --git a/Source/UI/Party/UIRequestJoinPartyMgr.h b/Source/UI/Party/UIRequestJoinPartyMgr.h index ed81b62..914955a 100644 --- a/Source/UI/Party/UIRequestJoinPartyMgr.h +++ b/Source/UI/Party/UIRequestJoinPartyMgr.h @@ -1,17 +1,18 @@ #ifndef RAGNAROK_SOURCE_UI_PARTY_UIREQUESTJOINPARTYMGR_H #define RAGNAROK_SOURCE_UI_PARTY_UIREQUESTJOINPARTYMGR_H +#include #include #include class WindowManagerWindows; struct PartyJoinRequest { - char name[24]; - std::uint32_t characterId; - std::uint32_t accountId; - std::int16_t level; - std::int16_t job; + /* 0000 */ char name[24]; + /* 0018 */ std::uint32_t characterId; + /* 001C */ std::uint32_t accountId; + /* 0020 */ std::int16_t level; + /* 0022 */ std::int16_t job; }; static_assert(sizeof(PartyJoinRequest) == 36); @@ -35,6 +36,10 @@ private: extern UIRequestJoinPartyMgr* g_requestJoinPartyMgr; #if defined(_WIN32) && !defined(_WIN64) +static_assert(offsetof(PartyJoinRequest, characterId) == 0x18); +static_assert(offsetof(PartyJoinRequest, accountId) == 0x1C); +static_assert(offsetof(PartyJoinRequest, level) == 0x20); +static_assert(offsetof(PartyJoinRequest, job) == 0x22); static_assert(sizeof(UIRequestJoinPartyMgr) == 28); #endif diff --git a/Source/UI/Shop/PriceColor.h b/Source/UI/Shop/PriceColor.h index f9c239e..aeb8970 100644 --- a/Source/UI/Shop/PriceColor.h +++ b/Source/UI/Shop/PriceColor.h @@ -1,13 +1,19 @@ #ifndef RAGNAROK_SOURCE_UI_SHOP_PRICECOLOR_H #define RAGNAROK_SOURCE_UI_SHOP_PRICECOLOR_H +#include #include struct PriceColors { - std::uint32_t primary; - std::uint32_t secondary; + /* 0000 */ std::uint32_t primary; + /* 0004 */ std::uint32_t secondary; }; PriceColors PriceColor(std::int64_t amount); +#if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(PriceColors) == 0x08); +static_assert(offsetof(PriceColors, secondary) == 0x04); +#endif + #endif diff --git a/Source/UI/Shortcuts/ShortcutCooldowns.h b/Source/UI/Shortcuts/ShortcutCooldowns.h index 7274076..5acc823 100644 --- a/Source/UI/Shortcuts/ShortcutCooldowns.h +++ b/Source/UI/Shortcuts/ShortcutCooldowns.h @@ -3,25 +3,26 @@ #include "UI/Cooldowns/CooldownDrawing.h" +#include #include struct ShortcutCooldownIcon { - unsigned id; - int slot; - int x; - int y; + /* 0000 */ unsigned id; + /* 0004 */ int slot; + /* 0008 */ int x; + /* 000C */ int y; }; struct ShortcutCooldownRecord { - unsigned id; - std::uint32_t end; - std::uint32_t duration; - std::list main; - std::list alternate; + /* 0000 */ unsigned id; + /* 0004 */ std::uint32_t end; + /* 0008 */ std::uint32_t duration; + /* 000C */ std::list main; + /* 0014 */ std::list alternate; }; struct ShortcutCooldowns { - std::list records; + /* 0000 */ std::list records; void LoadSnapshot( const void* packet, const std::list& mainIcons, const std::list& alternateIcons, int replayMode, @@ -52,6 +53,17 @@ private: static_assert(sizeof(ShortcutCooldownIcon) == 16); #if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(ShortcutCooldownRecord) == 28); +static_assert(sizeof(ShortcutCooldowns) == 8); +static_assert(offsetof(ShortcutCooldownIcon, id) == 0x0000); +static_assert(offsetof(ShortcutCooldownIcon, slot) == 0x0004); +static_assert(offsetof(ShortcutCooldownIcon, x) == 0x0008); +static_assert(offsetof(ShortcutCooldownIcon, y) == 0x000C); +static_assert(offsetof(ShortcutCooldownRecord, id) == 0x0000); +static_assert(offsetof(ShortcutCooldownRecord, end) == 0x0004); +static_assert(offsetof(ShortcutCooldownRecord, duration) == 0x0008); +static_assert(offsetof(ShortcutCooldownRecord, main) == 0x000C); +static_assert(offsetof(ShortcutCooldownRecord, alternate) == 0x0014); +static_assert(offsetof(ShortcutCooldowns, records) == 0x0000); #endif #endif diff --git a/Source/UI/Shortcuts/ShortcutGrid.h b/Source/UI/Shortcuts/ShortcutGrid.h index c006e68..335b734 100644 --- a/Source/UI/Shortcuts/ShortcutGrid.h +++ b/Source/UI/Shortcuts/ShortcutGrid.h @@ -1,15 +1,22 @@ #ifndef RAGNAROK_SOURCE_UI_SHORTCUTS_SHORTCUTGRID_H #define RAGNAROK_SOURCE_UI_SHORTCUTS_SHORTCUTGRID_H +#include + struct ShortcutGrid { - int hovered; - int row; - int rows; + /* 0154 */ int hovered; + /* 0158 */ int row; + /* 015C */ int rows; ShortcutGrid(); int HitTest(int x, int y, bool itemSlotActive, unsigned char& currentRow); }; static_assert(sizeof(ShortcutGrid) == 12); +#if defined(_WIN32) && !defined(_WIN64) +static_assert(offsetof(ShortcutGrid, hovered) + 0x0154 == 0x0154); +static_assert(offsetof(ShortcutGrid, row) + 0x0154 == 0x0158); +static_assert(offsetof(ShortcutGrid, rows) + 0x0154 == 0x015C); +#endif #endif diff --git a/Source/UI/Text/TextMarkup.h b/Source/UI/Text/TextMarkup.h index de81395..e85bdb9 100644 --- a/Source/UI/Text/TextMarkup.h +++ b/Source/UI/Text/TextMarkup.h @@ -7,10 +7,10 @@ #include struct TextLink { - std::uint32_t position; - std::byte unknown_0004[8]; - std::string display; - std::string metadata; + /* 0000 */ std::uint32_t position; + /* 0004 */ std::byte unknown_0004[8]; + /* 000C */ std::string display; + /* 0024 */ std::string metadata; }; bool HasTextLinks(const std::string& text); @@ -23,6 +23,10 @@ void SplitTextLinkArguments(std::string text, std::vector& argument #if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(TextLink) == 60); +static_assert(offsetof(TextLink, position) == 0x0); +static_assert(offsetof(TextLink, unknown_0004) == 0x4); +static_assert(offsetof(TextLink, display) == 0xC); +static_assert(offsetof(TextLink, metadata) == 0x24); #endif #endif diff --git a/Source/UI/Text/UITransBalloonText.h b/Source/UI/Text/UITransBalloonText.h index 367f6fa..3e4940f 100644 --- a/Source/UI/Text/UITransBalloonText.h +++ b/Source/UI/Text/UITransBalloonText.h @@ -3,14 +3,16 @@ #include "UI/Text/UIBalloonText.h" +#include + struct BalloonRectangle { - int x; - int y; - int width; - int height; - std::uint32_t unknown_0010; - std::uint32_t color; - std::uint32_t unknown_0018; + /* 00A0 */ int x; + /* 00A4 */ int y; + /* 00A8 */ int width; + /* 00AC */ int height; + /* 00B0 */ std::uint32_t unknown_00B0; + /* 00B4 */ std::uint32_t color; + /* 00B8 */ std::uint32_t unknown_00B8; }; class UITransBalloonText : public UIBalloonText { @@ -38,6 +40,14 @@ private: }; #if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(BalloonRectangle) == 0x1C); +static_assert(offsetof(BalloonRectangle, x) + 0xA0 == 0xA0); +static_assert(offsetof(BalloonRectangle, y) + 0xA0 == 0xA4); +static_assert(offsetof(BalloonRectangle, width) + 0xA0 == 0xA8); +static_assert(offsetof(BalloonRectangle, height) + 0xA0 == 0xAC); +static_assert(offsetof(BalloonRectangle, unknown_00B0) + 0xA0 == 0xB0); +static_assert(offsetof(BalloonRectangle, color) + 0xA0 == 0xB4); +static_assert(offsetof(BalloonRectangle, unknown_00B8) + 0xA0 == 0xB8); static_assert(sizeof(UITransBalloonText) == 212); #endif diff --git a/Source/UI/Window/FrameTextCache.h b/Source/UI/Window/FrameTextCache.h index 5fd988c..dc9703e 100644 --- a/Source/UI/Window/FrameTextCache.h +++ b/Source/UI/Window/FrameTextCache.h @@ -1,6 +1,7 @@ #ifndef RAGNAROK_SOURCE_UI_WINDOW_FRAMETEXTCACHE_H #define RAGNAROK_SOURCE_UI_WINDOW_FRAMETEXTCACHE_H +#include #include #include #include @@ -8,9 +9,9 @@ #include struct FrameTextKey { - std::uint32_t word0; - std::uint32_t word1; - std::string text; + /* 0000 */ std::uint32_t word0; + /* 0004 */ std::uint32_t word1; + /* 0008 */ std::string text; bool operator==(const FrameTextKey& other) const; }; struct FrameTextHash { @@ -21,6 +22,9 @@ using FrameTextCache = std::unordered_mapunknown_0048; } - WindowGeometry geometry; + /* 0014 */ WindowGeometry geometry; protected: /* 0044 */ unsigned char unknown_0044; diff --git a/Source/UI/Window/WindowAncestry.h b/Source/UI/Window/WindowAncestry.h index 05e4127..e995082 100644 --- a/Source/UI/Window/WindowAncestry.h +++ b/Source/UI/Window/WindowAncestry.h @@ -2,7 +2,7 @@ #define RAGNAROK_SOURCE_UI_WINDOW_WINDOWANCESTRY_H struct WindowAncestry { - WindowAncestry* parent; + /* 0010 */ WindowAncestry* parent; WindowAncestry(); bool IsDescendantOf(const WindowAncestry* ancestor) const; diff --git a/Source/UI/Window/WindowRegistration.h b/Source/UI/Window/WindowRegistration.h index e211d29..f438c02 100644 --- a/Source/UI/Window/WindowRegistration.h +++ b/Source/UI/Window/WindowRegistration.h @@ -6,7 +6,7 @@ struct WindowAncestry; struct WindowRegistration { - std::list windows; + /* 018C */ std::list windows; void Add(WindowAncestry* window); void Remove(WindowAncestry* window);