diff --git a/Source/UI/Window/UIControl.cpp b/Source/UI/Window/UIControl.cpp index 51bfde80..0ac1a067 100644 --- a/Source/UI/Window/UIControl.cpp +++ b/Source/UI/Window/UIControl.cpp @@ -4,6 +4,8 @@ #include "UI/Lists/UIThumb.h" #include "UI/Edit/UIEditCtrl.h" #include "Client/Mode/ModeCursor.h" +#include "Client/Mode/ModeMgr.h" +#include "Client/Mode/ModeTooltip.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" #include "Resource/TextureNames.h" @@ -574,6 +576,28 @@ void CUIButton::Slot47() { this->SetState(2); } +// OFFSET: 0x009EEA00 +// FUNCTION: fn_14631 +void CUIButton::Slot28(int, int) { + if (this->unknown_00EC) { + this->unknown_00EC->Slot02(); + } + + if (this->tooltip.empty()) { + return; + } + + int screenX = 0; + int screenY = -20; + + for (const UIWindow* node = this; node; node = node->parent) { + screenX = (screenX + node->geometry.x); + screenY = (screenY + node->geometry.y); + } + + reinterpret_cast(g_modeMgr.gameMode)->Show(this->tooltip.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1); +} + // OFFSET: 0x009EEA70 // FUNCTION: fn_14632 void CUIButton::Slot48() { diff --git a/Source/UI/Window/UIControl.h b/Source/UI/Window/UIControl.h index 5272c555..a8c0e117 100644 --- a/Source/UI/Window/UIControl.h +++ b/Source/UI/Window/UIControl.h @@ -97,6 +97,7 @@ public: class CUIButton : public CUIControl { public: void Slot25(int x, int y) override; + void Slot28(int x, int y) override; void Slot26(int x, int y) override; void ResetCursor(int x, int y) override; void Slot31(int argument1, int argument2) override; @@ -107,9 +108,12 @@ public: /* 0080 */ int state; /* 0084 */ unsigned char disabled; - /* 0085 */ unsigned char unknown_0085[0x3F]; + /* 0085 */ unsigned char unknown_0085[0x03]; + /* 0088 */ std::string tooltip; + /* 00A0 */ unsigned char unknown_00A0[0x24]; /* 00C4 */ UIWindow* unknown_00C4; - /* 00C8 */ unsigned char unknown_00C8[0x28]; + /* 00C8 */ unsigned char unknown_00C8[0x24]; + /* 00EC */ UIWindow* unknown_00EC; }; class CUITextButton : public CUIButton {