Batch #14937 by ragnarok-clanker: no function's compiled code changes; checked with 251 compiled unit(s), including every includer of Source/Client/Mode/ModeMessage.h, Source/Contents/Actors/ActorEnums.h, Source/Network/Packets/PartyJoinPacket.h, Source/UI/Window/UIEnums.h, Source/UI/Window/WindowId.h.
73 lines
2 KiB
C++
73 lines
2 KiB
C++
#include "UI/Window/WindowId.h"
|
|
#include "UI/Window/UIEnums.h"
|
|
#include "Client/Session.h"
|
|
#include "Contents/UserData/CharacterLinkedUserDataMgr.h"
|
|
#include "UI/Window/UIWindowMgr.h"
|
|
#include "UI/Window/UIWindowMgr.inl"
|
|
#include "UI/Window/UIWindow.h"
|
|
|
|
#include <cstring>
|
|
#include <json/value.h>
|
|
|
|
// OFFSET: 0x005E65E0
|
|
// FUNCTION: fn_03929
|
|
void CCharacterLinkedUserDataMgr::LoadNormalItemSlots(Json::Value& data) {
|
|
NormalItemSlotWindow& saved = g_windowMgr.m_normalItemSlotWindow;
|
|
bool& itemSlotActive = g_session.ItemSlotActive();
|
|
|
|
Json::Value& values = data["NormalItemSlot"];
|
|
|
|
if (values.isNull()) {
|
|
return;
|
|
}
|
|
|
|
g_session.ClearNormalItemSlots();
|
|
|
|
for (auto entry = values.begin(); entry != values.end(); ++entry) {
|
|
Json::Value& value = *entry;
|
|
|
|
if (!value.isObject()) {
|
|
continue;
|
|
}
|
|
|
|
const int item = value.get("ItemID", 0).asInt();
|
|
const int index = value.get("SlotNum", 0).asInt();
|
|
g_session.m_normalItemSlots[index].itemId = static_cast<std::uint32_t>(item);
|
|
}
|
|
|
|
Json::Value& info = data["SlotInfo"];
|
|
|
|
if (info.empty()) {
|
|
saved.Reset();
|
|
} else {
|
|
const int x = info.get("SlotX", 0).asInt();
|
|
const int y = info.get("SlotY", 0).asInt();
|
|
const int width = info.get("SlotWidth", 0).asInt();
|
|
const int height = info.get("SlotHeight", 0).asInt();
|
|
const int show = info.get("SlotShow", 1).asInt();
|
|
|
|
saved.x = x;
|
|
saved.y = y;
|
|
saved.width = width;
|
|
saved.height = height;
|
|
saved.show = show;
|
|
}
|
|
|
|
Json::Value& active = data["ItemSlotActive"];
|
|
itemSlotActive = active.isNull() ? true : active.asBool();
|
|
|
|
UIWindow* window = g_windowMgr.LookupWindow(WID_SHORTCUTWND);
|
|
|
|
if (!window) {
|
|
return;
|
|
}
|
|
|
|
window->geometry.x = saved.x;
|
|
window->geometry.y = saved.y;
|
|
window->geometry.width = saved.width;
|
|
window->geometry.height = saved.height;
|
|
|
|
g_windowMgr.ShowShortcutWindow(saved.show);
|
|
window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast<std::intptr_t>(&saved), 0, 0, 0);
|
|
window->SendMsg(nullptr, UM_COMMAND, itemSlotActive ? 588 : 589, 0, 0, 0);
|
|
}
|