Maintenance: Add mandatory field offset markers /* XXXX */ and assertions to UI headers

Batch #1065 by ragnarok-clanker: no function's compiled code changes; checked with 92 compiled unit(s), including every includer of Source/UI/Buttons/UIBmpTextButton.h, Source/UI/Chat/ChatNotifications.h, Source/UI/Cooldowns/CooldownDrawing.h, Source/UI/Cooldowns/CooldownState.h, Source/UI/Edit/ItemTagRetirement.h, Source/UI/Layout/SnapRectangle.h, Source/UI/Lists/UIListBoxEx.h, Source/UI/MiniPartyGrid.h, Source/UI/Party/UIAdvenPartyBoardWnd.h, Source/UI/Party/UIRequestJoinPartyMgr.h, Source/UI/Shop/PriceColor.h, Source/UI/Shortcuts/ShortcutCooldowns.h, Source/UI/Shortcuts/ShortcutGrid.h, Source/UI/Text/TextMarkup.h, Source/UI/Text/UITransBalloonText.h, Source/UI/Window/FrameTextCache.h, Source/UI/Window/UIWindow.h, Source/UI/Window/WindowAncestry.h, Source/UI/Window/WindowRegistration.h.
This commit is contained in:
ragnarok-clanker 2026-10-27 13:55:58 +00:00
commit 2800d0fdc0
19 changed files with 168 additions and 73 deletions

View file

@ -3,14 +3,16 @@
#include "UI/Buttons/UIBitmapButton.h"
#include <cstddef>
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

View file

@ -5,6 +5,7 @@
#include "UI/Text/TextWrapping.h"
#include "UI/Window/UIWindow.h"
#include <cstddef>
#include <cstring>
#include <vector>
#include <cstdint>
@ -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

View file

@ -3,6 +3,7 @@
#include "UI/Cooldowns/CooldownState.h"
#include <cstddef>
#include <vector>
class RenderCommandPool;
@ -10,8 +11,8 @@ class CRenderSystemBase;
struct RenderQueues;
struct CooldownDrawing {
std::vector<RenderCommand*> normal;
std::vector<RenderCommand*> reverse;
/* 0004 */ std::vector<RenderCommand*> normal;
/* 0010 */ std::vector<RenderCommand*> 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

View file

@ -3,13 +3,14 @@
#include "Render/Primitives/RenderPrimitive.h"
#include <cstddef>
#include <map>
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

View file

@ -9,8 +9,8 @@ class UIWindow;
struct InputFocus;
struct ItemTagRecord {
UIWindow* child;
std::array<std::byte, 452> unknown_0004;
/* 0000 */ UIWindow* child;
/* 0004 */ std::array<std::byte, 452> 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

View file

@ -1,24 +1,35 @@
#ifndef RAGNAROK_SOURCE_UI_LAYOUT_SNAPRECTANGLE_H
#define RAGNAROK_SOURCE_UI_LAYOUT_SNAPRECTANGLE_H
#include <cstddef>
#include <cstdint>
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

View file

@ -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 {

View file

@ -6,15 +6,15 @@
#include <vector>
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);

View file

@ -5,6 +5,7 @@
#include "UI/Window/UIFrameWnd.h"
#include "UI/Lists/UIListBoxEx.h"
#include <cstddef>
#include <vector>
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

View file

@ -1,17 +1,18 @@
#ifndef RAGNAROK_SOURCE_UI_PARTY_UIREQUESTJOINPARTYMGR_H
#define RAGNAROK_SOURCE_UI_PARTY_UIREQUESTJOINPARTYMGR_H
#include <cstddef>
#include <cstdint>
#include <list>
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

View file

@ -1,13 +1,19 @@
#ifndef RAGNAROK_SOURCE_UI_SHOP_PRICECOLOR_H
#define RAGNAROK_SOURCE_UI_SHOP_PRICECOLOR_H
#include <cstddef>
#include <cstdint>
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

View file

@ -3,25 +3,26 @@
#include "UI/Cooldowns/CooldownDrawing.h"
#include <cstddef>
#include <list>
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<CooldownState> main;
std::list<CooldownState> alternate;
/* 0000 */ unsigned id;
/* 0004 */ std::uint32_t end;
/* 0008 */ std::uint32_t duration;
/* 000C */ std::list<CooldownState> main;
/* 0014 */ std::list<CooldownState> alternate;
};
struct ShortcutCooldowns {
std::list<ShortcutCooldownRecord> records;
/* 0000 */ std::list<ShortcutCooldownRecord> records;
void LoadSnapshot(
const void* packet, const std::list<ShortcutCooldownIcon>& mainIcons, const std::list<ShortcutCooldownIcon>& 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

View file

@ -1,15 +1,22 @@
#ifndef RAGNAROK_SOURCE_UI_SHORTCUTS_SHORTCUTGRID_H
#define RAGNAROK_SOURCE_UI_SHORTCUTS_SHORTCUTGRID_H
#include <cstddef>
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

View file

@ -7,10 +7,10 @@
#include <vector>
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<std::string>& 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

View file

@ -3,14 +3,16 @@
#include "UI/Text/UIBalloonText.h"
#include <cstddef>
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

View file

@ -1,6 +1,7 @@
#ifndef RAGNAROK_SOURCE_UI_WINDOW_FRAMETEXTCACHE_H
#define RAGNAROK_SOURCE_UI_WINDOW_FRAMETEXTCACHE_H
#include <cstddef>
#include <cstdint>
#include <string>
#include <unordered_map>
@ -8,9 +9,9 @@
#include <vector>
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_map<FrameTextKey, FrameTextLines, FrameTex
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(FrameTextKey) == 32);
static_assert(offsetof(FrameTextKey, word0) == 0x0000);
static_assert(offsetof(FrameTextKey, word1) == 0x0004);
static_assert(offsetof(FrameTextKey, text) == 0x0008);
static_assert(sizeof(FrameTextCache) == 32);
#endif

View file

@ -133,7 +133,7 @@ public:
return this->unknown_0048;
}
WindowGeometry geometry;
/* 0014 */ WindowGeometry geometry;
protected:
/* 0044 */ unsigned char unknown_0044;

View file

@ -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;

View file

@ -6,7 +6,7 @@
struct WindowAncestry;
struct WindowRegistration {
std::list<WindowAncestry*> windows;
/* 018C */ std::list<WindowAncestry*> windows;
void Add(WindowAncestry* window);
void Remove(WindowAncestry* window);