From 60f125b5fc975abab907589be82c1d74328342c0 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 00:21:21 +0000 Subject: [PATCH] Decompile 21 functions in Source/UI/Buttons/UIBmpTextButton2.h, Source/UI/Buttons/UITextureButton.h, ... Batch #3711 by youko: 0 byte-identical, 21 confirmed by peer review. - fn_10797 UIBitmapTab::Paint: logic confirmed by peer review - fn_10798 UIBmpTextButton2::Paint: logic confirmed by peer review - fn_10802 UIChatRoomTitle::Paint: logic confirmed by peer review - fn_10804 UIColorButton::Paint: logic confirmed by peer review - fn_10805 UIColorTransBalloonText::Paint: logic confirmed by peer review - fn_10806 UIEditCtrl3::Paint: logic confirmed by peer review - fn_10808 UIEditCtrl_OldList::Paint: logic confirmed by peer review - fn_10809 UIEmblemWnd::Paint: logic confirmed by peer review - fn_10815 UIResizer::Paint: logic confirmed by peer review - fn_10819 UIStaticText3::Paint: logic confirmed by peer review - fn_10821 UITab::Paint: logic confirmed by peer review - fn_10825 UIWordDisplayWnd::Paint: logic confirmed by peer review - fn_10832 UIMerchantShopTitle::Slot26: logic confirmed by peer review - fn_10838 UIBitmapTab::Slot25: logic confirmed by peer review - fn_10840 UIChatEditCtrl::Slot25: logic confirmed by peer review - fn_10843 UIMerchantShopTitle::Slot25: logic confirmed by peer review - fn_10851 UITab::Slot25: logic confirmed by peer review - fn_10856 UITextureButton::Slot31: logic confirmed by peer review - fn_10883 UIEmblemWnd::Slot19: logic confirmed by peer review - fn_10884 UINameBalloonText::Slot19: logic confirmed by peer review - fn_10885 UIWordDisplayWnd::Slot19: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, eAthena, Yommy Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Buttons/UIBmpTextButton2.cpp | 31 ++++++++++++++++ Source/UI/Buttons/UIColorButton.cpp | 39 ++++++++++++++++++++ Source/UI/Buttons/UITextureButton.cpp | 44 +++++++++++++++++++++++ Source/UI/Chat/UIChatRoomTitle.cpp | 33 +++++++++++++++++ Source/UI/Edit/UIEditVariants.cpp | 34 ++++++++++++++++++ Source/UI/Shop/UIMerchantShopTitle.cpp | 26 ++++++++++++++ Source/UI/Text/UIBalloonText.cpp | 16 +++++++++ Source/UI/Text/UIStaticText.cpp | 33 +++++++++++++++++ Source/UI/Text/UITransBalloonText.cpp | 6 ++++ Source/UI/Window/UIBitmapTab.cpp | 33 +++++++++++++++++ Source/UI/Window/UIEmblemWnd.cpp | 50 ++++++++++++++++++++++++++ Source/UI/Window/UIResizer.cpp | 11 ++++++ Source/UI/Window/UITab.cpp | 40 +++++++++++++++++++++ Source/UI/Window/UIWordDisplayWnd.cpp | 29 +++++++++++++++ 14 files changed, 425 insertions(+) diff --git a/Source/UI/Buttons/UIBmpTextButton2.cpp b/Source/UI/Buttons/UIBmpTextButton2.cpp index 422b9749..75d5d278 100644 --- a/Source/UI/Buttons/UIBmpTextButton2.cpp +++ b/Source/UI/Buttons/UIBmpTextButton2.cpp @@ -4,3 +4,34 @@ #include "UI/Buttons/UIBmpTextButton2.h" // OFFSET: 0x0085BCF0 +// FUNCTION: fn_10798 +void UIBmpTextButton2::Paint() { + CBitmapRes* bitmap; + + if (this->m_disabled != 0) { + this->geometry.unknown_0030 = 3; + } else { + switch (this->geometry.unknown_0030) { + case 0: + bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->m_names[0].c_str()))); + break; + case 1: + bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->m_names[1].c_str()))); + break; + case 2: + bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->m_names[2].c_str()))); + break; + } + } + + if (this->m_disabled != 0 && !this->m_names[3].empty()) { + bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->m_names[3].c_str()))); + } + + this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, false); + if (this->m_invalidateParent != 0 && this->parent) { + this->parent->Invalidate(); + } + + this->DrawLabels(); +} diff --git a/Source/UI/Buttons/UIColorButton.cpp b/Source/UI/Buttons/UIColorButton.cpp index 8d9437d8..470c37a7 100644 --- a/Source/UI/Buttons/UIColorButton.cpp +++ b/Source/UI/Buttons/UIColorButton.cpp @@ -3,3 +3,42 @@ #include "UI/Buttons/UIColorButton.h" // OFFSET: 0x0085C9A0 +// FUNCTION: fn_10804 +void UIColorButton::Paint() { + UIButtonContext& controls = *this->m_buttonContext; + const int textWidth = this->TextWidth(controls.fonts, controls.locale, this->label.c_str(), 0, 0, 12, 0, 0); + unsigned red, green, blue; + SkinPaletteChannels(ResourceMgr::Instance(), 22, 2, red, green, blue); + this->ClearSurface(static_cast(red) | (static_cast(green) << 8) | (static_cast(blue) << 16)); + + std::uint32_t color; + switch (this->geometry.unknown_0030) { + case 0: + color = static_cast(this->normalRed) | (static_cast(this->normalGreen) << 8) | (static_cast(this->normalBlue) << 16); + break; + case 1: + color = static_cast(this->activeRed) | (static_cast(this->activeGreen) << 8) | (static_cast(this->activeBlue) << 16); + break; + case 2: + color = static_cast(this->activeRed) | (static_cast(this->activeGreen) << 8) | (static_cast(this->activeBlue) << 16); + this->FillRegion(1, 1, this->geometry.width - 2, this->geometry.height - 2, color); + this->DrawTextAt( + controls.fonts, controls.locale, (this->geometry.width - textWidth) / 2 + 2, (this->geometry.height - 12) / 2 + 2, this->label.c_str(), 0, 0, 12, + 0xFFFFFF, 0, 0 + ); + this->DrawTextAt( + controls.fonts, controls.locale, (this->geometry.width - textWidth) / 2 + 1, (this->geometry.height - 12) / 2 + 1, this->label.c_str(), 0, 0, 12, 0, + 0, 0 + ); + return; + default: + return; + } + + this->FillRegion(1, 1, this->geometry.width - 2, this->geometry.height - 2, color); + this->DrawTextAt( + controls.fonts, controls.locale, (this->geometry.width - textWidth) / 2 + 1, (this->geometry.height - 12) / 2 + 1, this->label.c_str(), 0, 0, 12, 0xFFFFFF, + 0, 0 + ); + this->DrawTextAt(controls.fonts, controls.locale, (this->geometry.width - textWidth) / 2, (this->geometry.height - 12) / 2, this->label.c_str(), 0, 0, 12, 0, 0, 0); +} diff --git a/Source/UI/Buttons/UITextureButton.cpp b/Source/UI/Buttons/UITextureButton.cpp index b345a0bd..ecae9f30 100644 --- a/Source/UI/Buttons/UITextureButton.cpp +++ b/Source/UI/Buttons/UITextureButton.cpp @@ -10,3 +10,47 @@ void UITextureButton::Paint() { // OFFSET: 0x0085F060 // OFFSET: 0x03DE9CE2 +// FUNCTION: fn_10856 +void UITextureButton::Slot31(int x, int y) { + if (this->m_disabled == 1) { + return; + } + + if (g_windowMgr.Capture() != this) { + return; + } + + if (x < 0 || x >= this->geometry.width || y < 0 || y >= this->geometry.height) { + this->geometry.unknown_0030 = 0; + } else { + if (this->unknown_011C == 1) { + this->unknown_011D = this->unknown_011D == 0; + } + + this->geometry.unknown_0030 = 1; + UIWindow* parent = this->parent; + if (parent) { + if (WindowPolicy(this->m_buttonContext->policy, this->m_buttonContext->restricted, 3, parent->geometry.id) > 0) { + int id = this->geometry.id; + if (id == 185 && this->m_context->mode && *this->m_buttonContext->activeModeType == 2) { + const char* text = this->m_buttonContext->services.MessageText(17); + if (this->m_buttonContext->services.Confirm(text, 2, 1, 0, "Message", 280, 120) == 187) { + this->m_context->mode->SendModeMessage(2, 0, 0, 0, 0); + } + } else { + if (id == 184 || id == 321) { + this->m_buttonContext->services.Submit(parent); + id = this->geometry.id; + } + + this->parent->SendMsg(this, 6, id, this->m_argument, 0, 0); + } + } + } else { + this->m_context->mode->SendModeMessage(0, this->geometry.id, this->m_argument, 0, 0); + } + } + + this->Invalidate(); + g_windowMgr.ReleaseCapture(); +} diff --git a/Source/UI/Chat/UIChatRoomTitle.cpp b/Source/UI/Chat/UIChatRoomTitle.cpp index e2aac9d0..26e69ab4 100644 --- a/Source/UI/Chat/UIChatRoomTitle.cpp +++ b/Source/UI/Chat/UIChatRoomTitle.cpp @@ -5,6 +5,39 @@ #include "UI/Chat/UIChatRoomTitle.h" // OFFSET: 0x0085C690 +// FUNCTION: fn_10802 +void UIChatRoomTitle::Paint() { + this->ClearSurface(0xFFFF00FF); + + CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\sysbox_lu.bmp"))); + this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, false); + bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\sysbox_ru.bmp"))); + this->DrawBitmap(this->geometry.width - bitmap->image.width, 0, &bitmap->image, false); + + int segments = (this->geometry.width - 24) / 12 + ((this->geometry.width - 24) % 12 != 0); + for (int index = 0; index < segments; ++index) { + bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\sysbox_mu.bmp"))); + this->DrawBitmap((index + 1) * 12, 0, bitmap ? &bitmap->image : nullptr, false); + } + + bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\sysbox_ld.bmp"))); + this->DrawBitmap(0, this->geometry.height - bitmap->image.height - 6, &bitmap->image, false); + bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\sysbox_rd.bmp"))); + this->DrawBitmap(this->geometry.width - bitmap->image.width, this->geometry.height - bitmap->image.height - 6, &bitmap->image, false); + + segments = (this->geometry.width - 24) / 12 + ((this->geometry.width - 24) % 12 != 0); + for (int index = 0; index < segments; ++index) { + bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\sysbox_md.bmp"))); + this->DrawBitmap((index + 1) * 12, this->geometry.height - bitmap->image.height - 6, &bitmap->image, false); + } + + bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\sysbox_arr_l.bmp"))); + this->DrawBitmap(this->geometry.width / 2 - bitmap->image.width / 2, this->geometry.height - bitmap->image.height, &bitmap->image, false); + + const char* icon = this->roomType != 0 ? "유저인터페이스\\chat_open.bmp" : "유저인터페이스\\chat_close.bmp"; + bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(icon))); + this->DrawBitmap(3, 3, bitmap ? &bitmap->image : nullptr, true); +} // OFFSET: 0x0085F980 // FUNCTION: fn_10876 diff --git a/Source/UI/Edit/UIEditVariants.cpp b/Source/UI/Edit/UIEditVariants.cpp index fde0237f..5fe5bdd0 100644 --- a/Source/UI/Edit/UIEditVariants.cpp +++ b/Source/UI/Edit/UIEditVariants.cpp @@ -135,6 +135,22 @@ int UIEditCtrl5::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } // OFFSET: 0x0085CBF0 +// FUNCTION: fn_10806 +void UIEditCtrl3::Paint() { + const bool selected = g_skinInfo.Selected(); + const SkinPaletteCell cell = {1, 2}; + const std::uint32_t color = SkinPaletteColor(ResourceMgr::Instance(), cell, selected); + this->red = color & 0xFF; + this->blue = (color >> 16) & 0xFF; + this->green = (color & 0xFFFF) >> 8; + + this->Invalidate(); + this->ClearSurface(static_cast(this->red) | (static_cast(this->green) << 8) | (static_cast(this->blue) << 16)); + this->PaintText(); + if (this->parent) { + this->parent->Invalidate(); + } +} // OFFSET: 0x0085FF60 // FUNCTION: fn_10892 @@ -161,8 +177,26 @@ void UIBitmapEditCtrl::Paint() { } // OFFSET: 0x0085EB50 +// FUNCTION: fn_10840 +void UIChatEditCtrl::Slot25(int x, int y) { + if (this->disabled == 0) { + this->m_edit->focus.Set(this); + } + + this->parent->Slot25(x + this->geometry.x, y + this->geometry.y); +} // OFFSET: 0x0085CDE0 +// FUNCTION: fn_10808 +void UIEditCtrl_OldList::Paint() { + this->ClearSurface(0xFFFF00FF); + if (!this->bitmapName.empty()) { + CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->bitmapName.c_str()))); + this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, false); + } + + this->PaintText(); +} // OFFSET: 0x0085FFC0 // FUNCTION: fn_10894 diff --git a/Source/UI/Shop/UIMerchantShopTitle.cpp b/Source/UI/Shop/UIMerchantShopTitle.cpp index b1dbf778..d3df8d1b 100644 --- a/Source/UI/Shop/UIMerchantShopTitle.cpp +++ b/Source/UI/Shop/UIMerchantShopTitle.cpp @@ -5,8 +5,34 @@ #include "UI/Window/UIWindowMgr.h" // OFFSET: 0x0085EC40 +// FUNCTION: fn_10843 +void UIMerchantShopTitle::Slot25(int, int) { + if (!g_serviceOptions.Get(167)) { + return; + } + + CMode* mode = g_modeMgr.GetGameMode(); + if (this->buyingShop != 0) { + if (g_windowMgr.unknown_0308 == 0) { + mode->SendMsg(272, this->ownerAid, 0, 0, 0); + } + } else if (g_windowMgr.unknown_0418 == 0) { + mode->SendMsg(84, this->ownerAid, 0, 0, 0); + } +} // OFFSET: 0x0085E920 +// FUNCTION: fn_10832 +void UIMerchantShopTitle::Slot26(int, int) { + CMode* mode = g_modeMgr.GetGameMode(); + if (this->buyingShop != 0) { + if (g_windowMgr.unknown_0308 == 0) { + mode->SendMsg(272, this->ownerAid, 0, 0, 0); + } + } else if (g_windowMgr.unknown_0418 == 0) { + mode->SendMsg(84, this->ownerAid, 0, 0, 0); + } +} // OFFSET: 0x0085F9E0 // FUNCTION: fn_10878 diff --git a/Source/UI/Text/UIBalloonText.cpp b/Source/UI/Text/UIBalloonText.cpp index 56b8d42e..3c713865 100644 --- a/Source/UI/Text/UIBalloonText.cpp +++ b/Source/UI/Text/UIBalloonText.cpp @@ -129,3 +129,19 @@ void UIBalloonText::Paint() { } // OFFSET: 0x0085FC90 +// FUNCTION: fn_10884 +void UINameBalloonText::Slot19() { + CEmblemRes* emblem = dynamic_cast(ResourceMgr::Instance().Load(this->iconName.c_str())); + if (emblem) { + if (emblem->gif.frameChanged == 1) { + this->Invalidate(); + } + + return; + } + + CGifRes* gif = dynamic_cast(ResourceMgr::Instance().Load(this->iconName.c_str())); + if (gif && gif->frameChanged == 1) { + this->Invalidate(); + } +} diff --git a/Source/UI/Text/UIStaticText.cpp b/Source/UI/Text/UIStaticText.cpp index ecd7083b..a6f01882 100644 --- a/Source/UI/Text/UIStaticText.cpp +++ b/Source/UI/Text/UIStaticText.cpp @@ -115,3 +115,36 @@ void UIStaticText::Slot35(int value) { } // OFFSET: 0x0085DCA0 +// FUNCTION: fn_10819 +void UIStaticText3::Paint() { + UIButtonContext& controls = *this->m_controls; + this->ClearSurface(this->background); + + if (this->shadow != 0) { + this->DrawTextAt( + controls.fonts, controls.locale, this->textX + 2, 2, this->text.c_str(), 0, this->fontFamily, this->fontHeight, 0xFFFFFF, this->bold, this->italic + ); + } + + if (this->outline != 0) { + this->DrawTextAt( + controls.fonts, controls.locale, this->textX, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic + ); + this->DrawTextAt( + controls.fonts, controls.locale, this->textX + 1, 0, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, + this->italic + ); + this->DrawTextAt( + controls.fonts, controls.locale, this->textX + 2, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, + this->italic + ); + this->DrawTextAt( + controls.fonts, controls.locale, this->textX + 1, 2, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, + this->italic + ); + } + + const std::uint32_t color = + static_cast(this->red) | (static_cast(this->green) << 8) | (static_cast(this->blue) << 16); + this->DrawTextAt(controls.fonts, controls.locale, this->textX + 1, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, color, this->bold, this->italic); +} diff --git a/Source/UI/Text/UITransBalloonText.cpp b/Source/UI/Text/UITransBalloonText.cpp index f2e2dc42..98e83c04 100644 --- a/Source/UI/Text/UITransBalloonText.cpp +++ b/Source/UI/Text/UITransBalloonText.cpp @@ -152,3 +152,9 @@ void UITransBalloonText::Paint() { } // OFFSET: 0x0085CBA0 +// FUNCTION: fn_10805 +void UIColorTransBalloonText::Paint() { + this->ClearSurface(0xFFFF00FF); + std::uint32_t color = 0xFFFFFF; + DrawColoredText(*this, this->m_textContext->codePage, 6, 4, this->m_lines[0].c_str(), 0, color, 0, 12, false); +} diff --git a/Source/UI/Window/UIBitmapTab.cpp b/Source/UI/Window/UIBitmapTab.cpp index 52ccff3b..5bc89159 100644 --- a/Source/UI/Window/UIBitmapTab.cpp +++ b/Source/UI/Window/UIBitmapTab.cpp @@ -5,5 +5,38 @@ #include "Utility/Text/FormatString.h" // OFFSET: 0x0085BBC0 +// FUNCTION: fn_10797 +void UIBitmapTab::Paint() { + int y = 0; + + for (unsigned index = 0; index < this->tabs.size(); ++index) { + const std::string name = FormatOwnedString(this->tabs[index].name.c_str(), 'a' + (this->geometry.unknown_0030 == index)); + CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(name.c_str()))); + if (bitmap) { + this->DrawBitmap(0, y, &bitmap->image, false); + y += bitmap->image.height; + } + } +} // OFFSET: 0x0085EA90 +// FUNCTION: fn_10838 +void UIBitmapTab::Slot25(int, int y) { + if (!this->parent) { + return; + } + + int bottom = 0; + for (unsigned index = 0; index < this->tabs.size(); ++index) { + bottom += this->tabs[index].height; + if (bottom > y) { + if (this->geometry.unknown_0030 != index) { + this->geometry.unknown_0030 = index; + this->Invalidate(); + this->parent->SendMsg(this, 22, this->geometry.unknown_0030, 0, 0, 0); + } + + return; + } + } +} diff --git a/Source/UI/Window/UIEmblemWnd.cpp b/Source/UI/Window/UIEmblemWnd.cpp index f14ef9e4..bec4835a 100644 --- a/Source/UI/Window/UIEmblemWnd.cpp +++ b/Source/UI/Window/UIEmblemWnd.cpp @@ -12,5 +12,55 @@ #include // OFFSET: 0x0085CE40 +// FUNCTION: fn_10809 +void UIEmblemWnd::Paint() { + this->ClearSurface(0xFFFF00FF); + + const bool framed = g_serviceOptions.Get(243) != 0; + if (framed && g_session.GetSceneUnknown004C() && !g_session.WorldUnknown0050()) { + CBitmapRes* frame = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\emblem_frame.bmp"))); + if (frame) { + this->DrawBitmap(0, 0, &frame->image, true); + } + } + + const std::string name = g_guildMgr->GetEmblemFilename(this->guildId); + CEmblemRes* emblem = static_cast(ResourceMgr::Instance().Load(name)); + if (emblem && g_session.GetSceneUnknown004C() && !g_session.WorldUnknown0050()) { + this->DrawBitmap(framed ? 2 : 0, framed ? 2 : 0, &emblem->gif.image, true); + } +} // OFFSET: 0x0085FAF0 +// FUNCTION: fn_10883 +void UIEmblemWnd::Slot19() { + if (g_serviceOptions.Get(243)) { + if (this->geometry.width == 24) { + this->Resize(28, 28); + } + } else if (this->geometry.width == 28) { + this->Resize(24, 24); + } + + CRenderObject* actor = g_session.FindGameActor(this->aid); + if (actor) { + const int screenX = actor->render.screenX; + const int screenY = actor->render.screenY; + if (this->screenX != screenX || this->screenX != screenY) { + this->screenY = screenY; + this->screenX = screenX; + const float scale = actor->render.unknown_005C; + const int x = static_cast(screenX - static_cast(g_renderer->viewport.width * 10 / 640) * scale); + const int y = static_cast(screenY - static_cast(g_renderer->viewport.height * 100 / 480) * scale); + this->Move(x, y); + } + } else { + this->Move(-100, -100); + } + + const std::string name = g_guildMgr->GetEmblemFilename(this->guildId); + CEmblemRes* emblem = static_cast(ResourceMgr::Instance().Load(name)); + if (emblem && emblem->gif.frameChanged == 1) { + this->Invalidate(); + } +} diff --git a/Source/UI/Window/UIResizer.cpp b/Source/UI/Window/UIResizer.cpp index f2b88bb3..85969da8 100644 --- a/Source/UI/Window/UIResizer.cpp +++ b/Source/UI/Window/UIResizer.cpp @@ -6,6 +6,17 @@ #include "UI/Window/UIWindowMgr.h" // OFFSET: 0x0085D650 +// FUNCTION: fn_10815 +void UIResizer::Paint() { + if (!this->bitmapName.empty()) { + CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->bitmapName.c_str()))); + this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, false); + return; + } + + this->ClearSurface(this->backgroundColor); + this->FillRegion(0, 0, this->geometry.width, 2, this->lineColor); +} // OFFSET: 0x0085F470 // FUNCTION: fn_10862 diff --git a/Source/UI/Window/UITab.cpp b/Source/UI/Window/UITab.cpp index 41d7b3ba..29493a1b 100644 --- a/Source/UI/Window/UITab.cpp +++ b/Source/UI/Window/UITab.cpp @@ -6,5 +6,45 @@ #include // OFFSET: 0x0085DFC0 +// FUNCTION: fn_10821 +void UITab::Paint() { + char name[128]; + + if (this->style == 0) { + std::sprintf(name, "유저인터페이스\\basic_interface\\tab_itm_%02d.bmp", this->geometry.unknown_0030 + 1); + } else if (this->style == 1) { + std::sprintf(name, "유저인터페이스\\basic_interface\\tab_cmd_%02d.bmp", this->geometry.unknown_0030 + 1); + } else if (this->style == 2) { + std::sprintf(name, "유저인터페이스\\basic_interface\\tab_que_%02d.bmp", this->geometry.unknown_0030 + 1); + } else if (this->style == 3) { + std::sprintf(name, "유저인터페이스\\basic_interface\\tab_item_%02d.bmp", this->geometry.unknown_0030 + 1); + } else { + return; + } + + CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(name))); + this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, false); +} // OFFSET: 0x0085EE70 +// FUNCTION: fn_10851 +void UITab::Slot25(int, int y) { + if (!this->parent) { + return; + } + + int index = y / (this->geometry.height / this->tabCount); + if (index < 0) { + index = 0; + } + + if (index > this->tabCount - 1) { + index = this->tabCount - 1; + } + + if (this->geometry.unknown_0030 != static_cast(index)) { + this->geometry.unknown_0030 = index; + this->Invalidate(); + this->parent->SendMsg(this, 22, this->geometry.unknown_0030, 0, 0, 0); + } +} diff --git a/Source/UI/Window/UIWordDisplayWnd.cpp b/Source/UI/Window/UIWordDisplayWnd.cpp index 8e7e6a2a..97844948 100644 --- a/Source/UI/Window/UIWordDisplayWnd.cpp +++ b/Source/UI/Window/UIWordDisplayWnd.cpp @@ -10,5 +10,34 @@ #include "UI/Window/UIWordDisplayWnd.h" // OFFSET: 0x0085E370 +// FUNCTION: fn_10825 +void UIWordDisplayWnd::Paint() { + CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\전장적표시.bmp"))); + this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, true); +} // OFFSET: 0x0085FD30 +// FUNCTION: fn_10885 +void UIWordDisplayWnd::Slot19() { + CRenderObject* actor = g_session.FindGameActor(this->aid); + if (this->aid == g_session.m_aid) { + actor = static_cast(g_modeMgr.GetGameMode())->scene->player; + } + + if (!actor) { + return; + } + + const int screenX = actor->render.screenX; + const int screenY = actor->render.screenY; + if (this->screenX == screenX && this->screenX == screenY) { + return; + } + + this->screenY = screenY; + this->screenX = screenX; + const float scale = actor->render.unknown_005C; + const int y = static_cast(screenY - static_cast(g_renderer->viewport.height * 100 / 480) * scale); + const int x = static_cast(screenX - static_cast(g_renderer->viewport.width * 5 / 640) * scale); + this->Move(x, y); +}