Decompile fn_12094 (UIFrameWnd::DrawItemName)

Batch #8460 by SapitoSucio: 0 byte-identical, 1 confirmed by peer review.

- fn_12094 UIFrameWnd::DrawItemName: logic confirmed by peer review

Peer-reviewed-by: gordaoprogramas, System4z, dori
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-10-31 18:03:45 +00:00
commit dd97787c4d
3 changed files with 49 additions and 0 deletions

View file

@ -1,4 +1,6 @@
#include "Client/Session.h"
#include "Contents/Items/ItemInfo.h"
#include "Contents/Items/ItemNaming.h"
#include "Render/Primitives/AlphaRectangle.h"
#include "Render/Renderer.h"
#include "Render/TextureQuad.h"
@ -10,6 +12,10 @@
#include "UI/Skill/UISkillDescribeWnd.h"
#include "Utility/Text/FormatString.h"
#include <cstddef>
#include <cstdint>
#include <vector>
// OFFSET: 0x008D0D80
// FUNCTION: fn_12090
void UISkillDescribeWnd::Slot43() {
@ -95,3 +101,43 @@ void UIEquipWnd::DrawDamageSkinPage() {
++slot;
}
}
namespace {
struct ItemNameTextInfo {
int x;
int y;
int height;
int family;
};
using BuildItemNameFn = int(__thiscall*)(UIFrameWnd*, const ITEM_INFO*, int*, std::vector<char*>*, char**, std::size_t*, char**, char, char);
using DrawItemNameTextFn = void(__thiscall*)(
UIFrameWnd*, const ItemNameTextInfo*, const char*, const char*, std::uint32_t, std::uint32_t, int, const std::vector<char*>*
);
}
// OFFSET: 0x008D17C0
// FUNCTION: fn_12094
int UIFrameWnd::DrawItemName(int x, int y, int width, const ITEM_INFO* item, int, int family, int height) {
int highlightColor = 0;
std::vector<char*> breaks;
char buffer[256] = {};
char* cursor = buffer;
std::size_t remaining = sizeof(buffer);
char* highlight = nullptr;
reinterpret_cast<BuildItemNameFn>(0x008DA690)(
this, item, &highlightColor, &breaks, &cursor, &remaining, &highlight, 1, 0
);
std::uint32_t color = ItemCardColor(item);
if (color == 0x00ADFF2F) {
color = 0x00669900;
}
color = (color >> 16 & 0xFF) | (color & 0x0000FF00) | ((color & 0xFF) << 16);
const ItemNameTextInfo info = {x, y, height, family};
reinterpret_cast<DrawItemNameTextFn>(0x0090A2E0)(
this, &info, buffer, highlight, color, static_cast<std::uint32_t>(highlightColor), width, &breaks
);
return x;
}