Decompile fn_10941 (UINameBalloonText::AddNameLine)

Batch #9979 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review.

- fn_10941 UINameBalloonText::AddNameLine: logic confirmed by peer review

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-11-02 12:25:34 +00:00
commit 8ceadcba82
3 changed files with 20 additions and 1 deletions

View file

@ -3949,6 +3949,7 @@ void CGameMode::ReceiveSkillUpdate(
// OFFSET: 0x00CDB910
// OFFSET: 0x00CE18A0
// FUNCTION: fn_21332
void CGameMode::ProcessActorClick(int& handled, ActorPickInfo* pick, CGameActor* actor) {

View file

@ -442,6 +442,23 @@ void UINameBalloonText::SetName(const CActorNameCard& info, bool stripHash, unsi
this->Invalidate();
}
// OFFSET: 0x00866DE0
// FUNCTION: fn_10941
void UINameBalloonText::AddNameLine(const char* text) {
for (const std::string& line : this->m_lines) {
if (line == text) {
return;
}
}
this->m_lines.clear();
this->m_lines.push_back(std::string(text));
const std::string& last = this->m_lines.back();
this->unknown_00B8 =
std::max(this->TextWidth(this->m_textContext->fonts, this->m_textContext->locale, last.c_str(), last.size(), 0, g_nameBalloonFontHeight, g_serviceFlag06, 0) + 8, 32);
this->Resize(this->unknown_00B8, g_nameBalloonFontHeight + 8);
this->Invalidate();
}
// OFFSET: 0x00867740
// FUNCTION: fn_10942
void UIVerticalNameBalloonText::AddNameLine(const char* text) {

View file

@ -15,6 +15,7 @@ public:
void Paint() override;
virtual void SetIcon(const char* name, unsigned char framed);
virtual void SetName(const CActorNameCard& card, bool stripHash, unsigned char monsterType);
virtual void AddNameLine(const char* text);
/* 00A0 */ std::string iconName;
/* 00B8 */ int unknown_00B8;
@ -26,7 +27,7 @@ class UIVerticalNameBalloonText : public UINameBalloonText {
public:
UIVerticalNameBalloonText(UIWindowContext& windows, BalloonTextContext& text);
void Paint() override;
void AddNameLine(const char* text);
void AddNameLine(const char* text) override;
/* 00C0 */ int textHeight;
};