diff --git a/Source/UI/Buttons/UIItemTagButton.h b/Source/UI/Buttons/UIItemTagButton.h index 3c4d23d4..c18be3d8 100644 --- a/Source/UI/Buttons/UIItemTagButton.h +++ b/Source/UI/Buttons/UIItemTagButton.h @@ -7,8 +7,10 @@ class UIItemTagButton : public UITextButton { friend class UIItemTagCtrl; + friend class UIWindow; public: + UIItemTagButton(); UIItemTagButton(UIWindowContext& windows, UIButtonContext& buttons); void Paint() override; diff --git a/Source/UI/Navigation/UINavigationV4Wnd.h b/Source/UI/Navigation/UINavigationV4Wnd.h index e3faac1b..df2d30be 100644 --- a/Source/UI/Navigation/UINavigationV4Wnd.h +++ b/Source/UI/Navigation/UINavigationV4Wnd.h @@ -6,6 +6,7 @@ #include #include +class CBitmapRes; class CNavi_Object; class CTexture; class UIListBox_NaviSearch; @@ -44,6 +45,7 @@ public: void FillRouteGroups(); void SetRoadIcon(int slot); void InsertNavigationLink(std::string name, int x, int y); + void DrawTargetSprite(int x, int y, int width, int height, const CBitmapRes* background); /* 00B4 */ UIWindow* unknown_00B4; /* 00B8 */ UIWindow* unknown_00B8; diff --git a/Source/UI/Window/UINavigationWnd.h b/Source/UI/Window/UINavigationWnd.h index 93420756..d2907e50 100644 --- a/Source/UI/Window/UINavigationWnd.h +++ b/Source/UI/Window/UINavigationWnd.h @@ -6,6 +6,8 @@ #include #include +class CActRes; +class CSprRes; class UIBitmapButton; class UIButton; class UICheckBox; @@ -30,6 +32,8 @@ extern bool g_navigationMinimized; extern int g_navigationMode; extern UIWindow* g_navigationWindow; extern bool g_navigationHidden; +extern CActRes* g_navigationActions; +extern CSprRes* g_navigationSprites; class UINavigationWnd : public UIFrameWnd { public: diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index 8412346a..13c784cf 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -5,6 +5,8 @@ #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/MessageTable.h" #include "Contents/NavigationManager.h" +#include "Contents/SpriteRidingOffset.h" +#include "Client/Session.h" #include "Client/Mode/ModeCursor.h" #include "Client/Mode/ModeEvents.h" #include "Network/TextEncoding.h" @@ -17,6 +19,7 @@ #include "Render/Textures/Texture.h" #include "Resource/Bitmap/BitmapImage.h" #include "Resource/Bitmap/BitmapResource.h" +#include "Resource/PaletteResource.h" #include "Resource/ResourceMgr.h" #include "Resource/TextureNames.h" #include "Resource/Sprites/ActionResource.h" @@ -24,6 +27,7 @@ #include "UI/Buttons/UIBasicButton.h" #include "UI/Buttons/UIBitmapButton.h" #include "UI/Buttons/UIButton.h" +#include "UI/Buttons/UIItemTagButton.h" #include "UI/Chat/ChatSuggestions.h" #include "UI/Edit/UIEditCtrl.h" #include "UI/Lists/UIListBoxNaviSearch.h" @@ -62,6 +66,20 @@ #include #include +namespace { + struct NavigationTargetLook { + /* 0000 */ int job; + /* 0004 */ int sex; + /* 0008 */ int bodyPalette; + /* 000C */ int head; + /* 0010 */ int headPalette; + /* 0014 */ int accessory0; + /* 0018 */ int accessory1; + /* 001C */ int accessory2; + /* 0020 */ int robe; + }; +} + // INLINED inline WindowGeometry::WindowGeometry() : width(0), height(0), x(0), y(0), surface(nullptr), visible(1), id(600), unknown_0030(0), unknown_0034(0), targetAlpha(255), alphaStart(timeGetTime()), @@ -2917,3 +2935,32 @@ int UIPrivateAirplaneWnd::SendMsg( return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } + +// OFFSET: 0x00A7DA40 + +// OFFSET: 0x00A7B4D0 +// FUNCTION: fn_16930 +UIItemTagButton* UIWindow::CreateItemTagButton(const std::string& title, const std::string& label, int tagId, UIWindow* parent, std::uint32_t color) { + const std::string text = "<" + label + ">"; + UIItemTagButton* button = new (std::nothrow) UIItemTagButton(); + if (button) { + button->Configure(text.c_str(), color, 0, 12, 0, 0); + if (title != label) { + button->SetTooltip(title.c_str()); + } + + button->m_hoverColor = color; + button->SetId(0x1D0); + button->m_value = 0x205; + button->Move(0, 0); + button->unknown_01F8 = tagId; + if (parent) { + parent->AddChild(button); + } + } + + return button; +} + +// OFFSET: 0x005C34B0 + diff --git a/Source/UI/Window/UIWindow.h b/Source/UI/Window/UIWindow.h index 3716f410..b5f77e98 100644 --- a/Source/UI/Window/UIWindow.h +++ b/Source/UI/Window/UIWindow.h @@ -35,6 +35,7 @@ class TextureCache; class UITextViewer; struct WindowReplayRecorder; struct ITEM_INFO; +class UIItemTagButton; struct UIWindowContext { RenderPrimitivePool& primitives; @@ -197,6 +198,8 @@ public: std::string FitDisplayText(int width, const char* text, int family, int height, unsigned char bold); std::string FitVerticalDisplayText(int height, const char* text, int family, int fontHeight, unsigned char bold); std::list WrapFormattedText(std::string text, std::list* lines, int maxWidth, int family, int height, unsigned char bold); + UIItemTagButton* CreateItemTagButton(const std::string& title, const std::string& label, int tagId, UIWindow* parent, std::uint32_t color); + std::list WrapText(std::string text, std::list* lines, int maxWidth, int family, int height, unsigned char bold); const char* TruncateText(const char* text, int maxBytes); const char* ClipTextToWidth(const char* text, int maxWidth, int family, int height, unsigned char bold); int RecordEditTexts(WindowReplayRecorder& recorder);