diff --git a/Source/Client/Session.cpp b/Source/Client/Session.cpp index 9c4ab8d7..f8c5b445 100644 --- a/Source/Client/Session.cpp +++ b/Source/Client/Session.cpp @@ -19,6 +19,8 @@ #include "Network/Connection/Connection.h" #include "Network/Packets/PacketId.h" #include "Network/TextEncoding.h" +#include "Contents/Jobs/JobInheritance.h" +#include "UI/Window/UIBasicInfoWnd.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Window/UIWindow.h" #include "UI/Window/WindowOrdering.h" @@ -2023,6 +2025,21 @@ int CSession::CountItems17F0() const { return count; } +// OFFSET: 0x00DF9490 +// FUNCTION: fn_23516 +void CSession::RefreshSkillTree() { + JobInheritance inheritance{*this->m_hotkeyScript}; + inheritance.InitializeSkillTree(this->m_skillBundle, this->m_job); + if (g_windowMgr.window_02C4) { + g_windowMgr.window_02C4->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + } + + if (g_windowMgr.unknown_01DC) { + UIBasicInfoWnd* info = reinterpret_cast(g_windowMgr.unknown_01DC); + info->SetHeight(info->geometry.height); + } +} + // OFFSET: 0x00DF9500 // FUNCTION: fn_23518 void CSession::InvalidateWindowFrames() { diff --git a/Source/Client/Session.h b/Source/Client/Session.h index 8b0f2a1e..47aa8e34 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -968,6 +968,8 @@ public: void RefreshMercenaryInfo(); bool IsBlankString(const char* text) const; void InvalidateWindowFrames(); + void RefreshSkillTree(); + void SetJob(int job); void EraseRecord0734(int id); void IgnoreText(std::string text); void SaveMiniPartyInfo(); diff --git a/Source/Client/SessionState.cpp b/Source/Client/SessionState.cpp index d9a1260d..379769d6 100644 --- a/Source/Client/SessionState.cpp +++ b/Source/Client/SessionState.cpp @@ -16,6 +16,7 @@ #include "Contents/World/World.h" #include "Script/LuaScript.h" #include "UI/Items/UIEquipWnd.h" +#include "UI/Window/UIBasicInfoWnd.h" #include "UI/Window/UIWindowMgr.h" #include "Utility/Text/FormatString.h" @@ -288,6 +289,25 @@ void CSession::UnequipItem61B8(const ITEM_INFO& item) { RefreshItemWindows(&g_windowMgr); } +// OFFSET: 0x00E49200 +// FUNCTION: fn_24231 +void CSession::SetJob(int job) { + const int previous = this->m_job; + this->m_job = job; + if (this->IsTreeGroupThree(previous) != this->IsTreeGroupThree(job)) { + if (g_windowMgr.unknown_01DC) { + reinterpret_cast(g_windowMgr.unknown_01DC)->RefreshLayout(); + } + + if (g_modeMgr.GetGameMode()) { + g_modeMgr.GetGameMode()->SendMsg(0x144, 0, 0, 0, 0); + } + } + + this->InvalidateWindowFrames(); + this->RefreshSkillTree(); +} + // OFFSET: 0x00E497F0 // FUNCTION: fn_24237 void CSession::SetUnknown7EC8(std::uint32_t value) {