diff --git a/Source/Client/Mode/ModeDragState.cpp b/Source/Client/Mode/ModeDragState.cpp index 25756f24..39af968f 100644 --- a/Source/Client/Mode/ModeDragState.cpp +++ b/Source/Client/Mode/ModeDragState.cpp @@ -27,7 +27,7 @@ void ModeDragState::Clear() { // OFFSET: 0x00CFE140 // FUNCTION: fn_21429 void ModeDragState::BeginItem( - WindowManagerWindows& windows, ItemDescriptions& descriptions, int sourceValue, const ItemInfo& item, int quantityValue, int slotValue + WindowManagerWindows& windows, ItemDescriptions& descriptions, int sourceValue, const ITEM_INFO& item, int quantityValue, int slotValue ) { UIWindow* window = windows.EnsureWindow(15); if (window->geometry.visible != 0) { diff --git a/Source/Client/Mode/ModeDragState.h b/Source/Client/Mode/ModeDragState.h index 80e4c924..78fa5482 100644 --- a/Source/Client/Mode/ModeDragState.h +++ b/Source/Client/Mode/ModeDragState.h @@ -7,7 +7,7 @@ class WindowManagerWindows; class ResourceMgr; struct ItemDescriptions; -struct ItemInfo; +struct ITEM_INFO; struct ModeDragState { /* 0308 */ int source; @@ -35,7 +35,7 @@ struct ModeDragState { /* 03C0 */ std::int64_t unknown_03C0; void Clear(); - void BeginItem(WindowManagerWindows& windows, ItemDescriptions& descriptions, int source, const ItemInfo& item, int quantity, int slot); + void BeginItem(WindowManagerWindows& windows, ItemDescriptions& descriptions, int source, const ITEM_INFO& item, int quantity, int slot); void BeginSkill(WindowManagerWindows& windows, ResourceMgr& resources, int source, std::uint32_t id, const char* name, int level, int slot); }; diff --git a/Source/Client/Session.cpp b/Source/Client/Session.cpp index 957f7bfd..5bb3285d 100644 --- a/Source/Client/Session.cpp +++ b/Source/Client/Session.cpp @@ -39,7 +39,7 @@ int CSession::IsExchangeItemListFull() { // OFFSET: 0x00DFFCF0 // FUNCTION: fn_23633 void CSession::ClearItemSelection() { - for (ItemInfo& item : this->m_inventoryItems) { + for (ITEM_INFO& item : this->m_inventoryItems) { if (item.unknown_0074[1] == 1) { item.unknown_0074[1] = 0; } diff --git a/Source/Client/Session.h b/Source/Client/Session.h index fa04edc1..58ea212a 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -131,18 +131,18 @@ public: /* 16EC */ std::uint32_t unknown_16EC; /* 16F0 */ int m_zeny; /* 16F4 */ unsigned char unknown_16F4[0x1C]; - /* 1710 */ std::list m_inventoryItems; + /* 1710 */ std::list m_inventoryItems; /* 1718 */ unsigned char unknown_1718[0x18]; - /* 1730 */ std::list unknown_1730; - /* 1738 */ std::list unknown_1738; - /* 1740 */ std::list unknown_1740; + /* 1730 */ std::list unknown_1730; + /* 1738 */ std::list unknown_1738; + /* 1740 */ std::list unknown_1740; /* 1748 */ unsigned char unknown_1748[0xA8]; - /* 17F0 */ ItemInfo unknown_17F0[10]; + /* 17F0 */ ITEM_INFO unknown_17F0[10]; /* 21A0 */ unsigned char unknown_21A0[0x9B0]; - /* 2B50 */ ItemInfo unknown_2B50[10]; - /* 3500 */ ItemInfo unknown_3500[10]; - /* 3EB0 */ ItemInfo m_exchangeItems[10]; - /* 4860 */ ItemInfo m_itemSlots[10]; + /* 2B50 */ ITEM_INFO unknown_2B50[10]; + /* 3500 */ ITEM_INFO unknown_3500[10]; + /* 3EB0 */ ITEM_INFO m_exchangeItems[10]; + /* 4860 */ ITEM_INFO m_itemSlots[10]; /* 5210 */ unsigned char unknown_5210[0x44]; /* 5254 */ std::map m_npcLocationRadius; /* 525C */ unsigned char unknown_525C[0x38]; @@ -182,7 +182,7 @@ public: /* 5C00 */ unsigned char unknown_5C00[0x20]; /* 5C20 */ long long m_bankBalance; /* 5C28 */ unsigned char unknown_5C28[0x40]; - /* 5C68 */ ItemInfo unknown_5C68[5]; + /* 5C68 */ ITEM_INFO unknown_5C68[5]; /* 6140 */ std::uint16_t unknown_6140; /* 6144 */ std::map unknown_6144; /* 614C */ unsigned char unknown_614C[0x20]; @@ -206,7 +206,7 @@ public: /* 80C4 */ unsigned char unknown_80C4[4]; /* 80C8 */ int unknown_80C8; /* 80CC */ unsigned char unknown_80CC[0x50]; - /* 811C */ std::vector m_cardItems; + /* 811C */ std::vector m_cardItems; /* 8128 */ unsigned char unknown_8128[0x0C]; /* 8134 */ int unknown_8134; /* 8138 */ std::int64_t m_startTimeTicks; @@ -220,7 +220,7 @@ public: std::uint32_t AddPingSample(std::uint32_t sample); std::uint32_t SetServerTime(std::uint32_t serverTime); void SetHotkeyDescription(const char* description, int index); - void AddItemSlot(ItemInfo item); + void AddItemSlot(ITEM_INFO item); SessionShop* GetShop(int shopId); void SetShopFlag(int shopId, char flag); void SetShopItem(int shopId, unsigned int index, int itemId, int first, int second); @@ -261,8 +261,8 @@ public: bool UpdateHomunSkill(const CSkillInfo& value, unsigned char notify); bool UpdateMercSkill(const CSkillInfo& value, unsigned char notify); void AddUnknownId(int id); - void AddStackedItem(ItemInfo item); - void AddItemToFreeSlot(ItemInfo item); + void AddStackedItem(ITEM_INFO item); + void AddItemToFreeSlot(ITEM_INFO item); bool IsListedId(int id, int variant) const; void ClearItemQuantities(); void ResetItems3500(); @@ -275,7 +275,7 @@ public: std::int64_t FindUnknown078C(std::int64_t key) const; SessionRecord6144 FindRecord6144(int key) const; int GetBeginEffectId(int skillId) const; - ItemInfo GetItem2B50(int index) const; + ITEM_INFO GetItem2B50(int index) const; int CountItems5C68() const; void SplitDate(__time32_t time, std::uint16_t& year, std::uint16_t& month, std::uint16_t& day) const; int GetDefaultOptionValue(const char* name, int fallback) const; diff --git a/Source/Contents/ClientItemLists.cpp b/Source/Contents/ClientItemLists.cpp index 1a7c60a0..2ef1ad6e 100644 --- a/Source/Contents/ClientItemLists.cpp +++ b/Source/Contents/ClientItemLists.cpp @@ -20,38 +20,38 @@ namespace { struct ClientItemLists { /* 0000 */ unsigned char unknown_0000[0x1710]; - /* 1710 */ std::list inventory; - /* 1718 */ std::list items_1718; - /* 1720 */ std::list items_1720; - /* 1728 */ std::list items_1728; - /* 1730 */ std::list items_1730; - /* 1738 */ std::list items_1738; - /* 1740 */ std::list items_1740; - /* 1748 */ std::list items_1748; - /* 1750 */ std::list items_1750; - /* 1758 */ std::list items_1758; - /* 1760 */ std::list items_1760; - /* 1768 */ std::list items_1768; + /* 1710 */ std::list inventory; + /* 1718 */ std::list items_1718; + /* 1720 */ std::list items_1720; + /* 1728 */ std::list items_1728; + /* 1730 */ std::list items_1730; + /* 1738 */ std::list items_1738; + /* 1740 */ std::list items_1740; + /* 1748 */ std::list items_1748; + /* 1750 */ std::list items_1750; + /* 1758 */ std::list items_1758; + /* 1760 */ std::list items_1760; + /* 1768 */ std::list items_1768; /* 1770 */ unsigned char unknown_1770[0xA30]; - /* 21A0 */ ItemInfo equipped[10]; + /* 21A0 */ ITEM_INFO equipped[10]; - bool AddItem1710(const ItemInfo& item, unsigned char refresh); + bool AddItem1710(const ITEM_INFO& item, unsigned char refresh); void AddItem1718(const RawItemBasic& item, int quantity, std::uint16_t unknown_006C); void AddItem1718(const RawItemBasic& item, int mode); - bool AddItem1768(const ItemInfo& item, unsigned char alternate, unsigned char refresh); - bool AddItem1740(const ItemInfo& item); - bool AddItem1750(const ItemInfo& item, int type, unsigned char refresh); - void AddItem1758(const ItemInfo& item); - void AddItem1760(const ItemInfo& item); - void AddItem1748(const ItemInfo& item); - bool Equip(const ItemInfo& item); - void AppendItem1718(const ItemInfo& item); - void MergeItem1718ByName(const ItemInfo& item); - void MergeItem1720ByName(const ItemInfo& item); - void MergeItem1720(const ItemInfo& item); - void AddItem1730(const ItemInfo& item); - void MergeItem1718(const ItemInfo& item); - bool AddItem1738(const ItemInfo& item, unsigned char refresh); + bool AddItem1768(const ITEM_INFO& item, unsigned char alternate, unsigned char refresh); + bool AddItem1740(const ITEM_INFO& item); + bool AddItem1750(const ITEM_INFO& item, int type, unsigned char refresh); + void AddItem1758(const ITEM_INFO& item); + void AddItem1760(const ITEM_INFO& item); + void AddItem1748(const ITEM_INFO& item); + bool Equip(const ITEM_INFO& item); + void AppendItem1718(const ITEM_INFO& item); + void MergeItem1718ByName(const ITEM_INFO& item); + void MergeItem1720ByName(const ITEM_INFO& item); + void MergeItem1720(const ITEM_INFO& item); + void AddItem1730(const ITEM_INFO& item); + void MergeItem1718(const ITEM_INFO& item); + bool AddItem1738(const ITEM_INFO& item, unsigned char refresh); EquipSlots GetEquipSlots(int location); }; @@ -104,8 +104,8 @@ EquipSlots EquipSlotDecoder::Decode(int mask) const { // OFFSET: 0x00DD7030 // FUNCTION: fn_23282 -bool ClientItemLists::AddItem1710(const ItemInfo& item, unsigned char refresh) { - for (ItemInfo& value : this->inventory) { +bool ClientItemLists::AddItem1710(const ITEM_INFO& item, unsigned char refresh) { + for (ITEM_INFO& value : this->inventory) { if (value.unknown_0000[1] == item.unknown_0000[1]) { value.quantity += item.quantity; value.unknown_0074[1] = item.unknown_0074[1]; @@ -126,8 +126,8 @@ bool ClientItemLists::AddItem1710(const ItemInfo& item, unsigned char refresh) { // OFFSET: 0x00DD7210 // FUNCTION: fn_23284 -bool ClientItemLists::AddItem1768(const ItemInfo& item, unsigned char alternate, unsigned char refresh) { - for (ItemInfo& value : this->items_1768) { +bool ClientItemLists::AddItem1768(const ITEM_INFO& item, unsigned char alternate, unsigned char refresh) { + for (ITEM_INFO& value : this->items_1768) { if (value.unknown_0000[1] == item.unknown_0000[1]) { if (!alternate) { value.quantity += item.quantity; @@ -153,8 +153,8 @@ bool ClientItemLists::AddItem1768(const ItemInfo& item, unsigned char alternate, // OFFSET: 0x00DD72C0 // FUNCTION: fn_23285 -bool ClientItemLists::AddItem1740(const ItemInfo& item) { - for (ItemInfo& value : this->items_1740) { +bool ClientItemLists::AddItem1740(const ITEM_INFO& item) { + for (ITEM_INFO& value : this->items_1740) { if (value.unknown_0000[1] == item.unknown_0000[1]) { value.quantity += item.quantity; if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_02F4)) { @@ -173,8 +173,8 @@ bool ClientItemLists::AddItem1740(const ItemInfo& item) { // OFFSET: 0x00DD7350 // FUNCTION: fn_23286 -bool ClientItemLists::AddItem1750(const ItemInfo& item, int type, unsigned char refresh) { - for (ItemInfo& value : this->items_1750) { +bool ClientItemLists::AddItem1750(const ITEM_INFO& item, int type, unsigned char refresh) { + for (ITEM_INFO& value : this->items_1750) { if (value.unknown_0000[1] == item.unknown_0000[1]) { value.quantity += item.quantity; if (refresh == 1) { @@ -209,8 +209,8 @@ bool ClientItemLists::AddItem1750(const ItemInfo& item, int type, unsigned char // OFFSET: 0x00DD7420 // FUNCTION: fn_23287 -void ClientItemLists::AddItem1758(const ItemInfo& item) { - for (ItemInfo& value : this->items_1758) { +void ClientItemLists::AddItem1758(const ITEM_INFO& item) { + for (ITEM_INFO& value : this->items_1758) { if (value.unknown_0000[1] == item.unknown_0000[1]) { value.quantity += item.quantity; return; @@ -222,8 +222,8 @@ void ClientItemLists::AddItem1758(const ItemInfo& item) { // OFFSET: 0x00DD7470 // FUNCTION: fn_23288 -void ClientItemLists::AddItem1760(const ItemInfo& item) { - for (ItemInfo& value : this->items_1760) { +void ClientItemLists::AddItem1760(const ITEM_INFO& item) { + for (ITEM_INFO& value : this->items_1760) { if (value.unknown_0000[1] == item.unknown_0000[1]) { value.quantity += item.quantity; return; @@ -235,8 +235,8 @@ void ClientItemLists::AddItem1760(const ItemInfo& item) { // OFFSET: 0x00DD74C0 // FUNCTION: fn_23289 -void ClientItemLists::AddItem1748(const ItemInfo& item) { - for (ItemInfo& value : this->items_1748) { +void ClientItemLists::AddItem1748(const ITEM_INFO& item) { + for (ITEM_INFO& value : this->items_1748) { if (value.unknown_0000[1] == item.unknown_0000[1]) { value.quantity += item.quantity; return; @@ -248,14 +248,14 @@ void ClientItemLists::AddItem1748(const ItemInfo& item) { // OFFSET: 0x00DD7510 // FUNCTION: fn_23290 -bool ClientItemLists::Equip(const ItemInfo& item) { +bool ClientItemLists::Equip(const ITEM_INFO& item) { const EquipSlots slots = this->GetEquipSlots(item.unknown_0000[3]); const int order[3] = {slots.values[2], slots.values[1], slots.values[0]}; for (int index = 0; index < 3; ++index) { const int slot = order[index]; if (slot != -1) { - ItemInfo& equipped = this->equipped[slot]; + ITEM_INFO& equipped = this->equipped[slot]; equipped = item; equipped.quantity = 1; equipped.unknown_0068 = item.unknown_0068; @@ -270,7 +270,7 @@ bool ClientItemLists::Equip(const ItemInfo& item) { // OFFSET: 0x00DD75C0 // FUNCTION: fn_23291 void ClientItemLists::AddItem1718(const RawItemBasic& item, int quantity, std::uint16_t unknown_006C) { - ItemInfo value; + ITEM_INFO value; value.AssignBasic(item); value.quantity = quantity; value.unknown_006C = unknown_006C; @@ -282,14 +282,14 @@ void ClientItemLists::AddItem1718(const RawItemBasic& item, int quantity, std::u // OFFSET: 0x00DD76C0 // FUNCTION: fn_23292 -void ClientItemLists::AppendItem1718(const ItemInfo& item) { +void ClientItemLists::AppendItem1718(const ITEM_INFO& item) { this->items_1718.push_back(item); } // OFFSET: 0x00DD76D0 // FUNCTION: fn_23293 -void ClientItemLists::MergeItem1718ByName(const ItemInfo& item) { - for (ItemInfo& value : this->items_1718) { +void ClientItemLists::MergeItem1718ByName(const ITEM_INFO& item) { + for (ITEM_INFO& value : this->items_1718) { if (value.itemId == item.itemId) { value.quantity = value.quantity == -1 ? -1 : value.quantity + item.quantity; return; @@ -301,8 +301,8 @@ void ClientItemLists::MergeItem1718ByName(const ItemInfo& item) { // OFFSET: 0x00DD7770 // FUNCTION: fn_23294 -void ClientItemLists::MergeItem1720ByName(const ItemInfo& item) { - for (ItemInfo& value : this->items_1720) { +void ClientItemLists::MergeItem1720ByName(const ITEM_INFO& item) { + for (ITEM_INFO& value : this->items_1720) { if (value.itemId == item.itemId) { value.quantity += item.quantity; return; @@ -314,8 +314,8 @@ void ClientItemLists::MergeItem1720ByName(const ItemInfo& item) { // OFFSET: 0x00DD77F0 // FUNCTION: fn_23295 -void ClientItemLists::MergeItem1720(const ItemInfo& item) { - for (ItemInfo& value : this->items_1720) { +void ClientItemLists::MergeItem1720(const ITEM_INFO& item) { + for (ITEM_INFO& value : this->items_1720) { const bool same = item.unknown_0074[3] ? value.unknown_0000[1] == item.unknown_0000[1] : value.itemId == item.itemId; if (same) { value.quantity += item.quantity; @@ -328,10 +328,10 @@ void ClientItemLists::MergeItem1720(const ItemInfo& item) { // OFFSET: 0x00DD7890 // FUNCTION: fn_23296 -void ClientItemLists::AddItem1730(const ItemInfo& item) { - const ItemInfo owned = LookupClientItemByIdentity(this->inventory, item.unknown_0000[1]); +void ClientItemLists::AddItem1730(const ITEM_INFO& item) { + const ITEM_INFO owned = LookupClientItemByIdentity(this->inventory, item.unknown_0000[1]); if (owned.unknown_0000[1] > 0) { - for (ItemInfo& value : this->items_1730) { + for (ITEM_INFO& value : this->items_1730) { if (value.unknown_0000[1] == item.unknown_0000[1]) { const int quantity = value.quantity + item.quantity; if (owned.quantity >= quantity) { @@ -351,15 +351,15 @@ void ClientItemLists::AddItem1730(const ItemInfo& item) { // FUNCTION: fn_23297 void ClientItemLists::AddItem1718(const RawItemBasic& item, int mode) { if (mode != 0) { - const ItemInfo owned = LookupClientItemByIdentity(this->inventory, item.id); + const ITEM_INFO owned = LookupClientItemByIdentity(this->inventory, item.id); if (owned.unknown_0000[1] != 0) { - ItemInfo value(owned); + ITEM_INFO value(owned); value.AssignBasic(item); value.SetItemId(std::atoi(value.itemId.c_str())); this->items_1718.push_back(value); } } else { - ItemInfo value; + ITEM_INFO value; value.AssignBasic(item); value.unknown_0060 = 0; value.unknown_005D = 0; @@ -372,8 +372,8 @@ void ClientItemLists::AddItem1718(const RawItemBasic& item, int mode) { // OFFSET: 0x00DD7B30 // FUNCTION: fn_23298 -void ClientItemLists::MergeItem1718(const ItemInfo& item) { - for (ItemInfo& value : this->items_1718) { +void ClientItemLists::MergeItem1718(const ITEM_INFO& item) { + for (ITEM_INFO& value : this->items_1718) { if (value.unknown_0000[1] == item.unknown_0000[1]) { if (value.quantity != -1) { value.quantity += item.quantity; @@ -387,12 +387,12 @@ void ClientItemLists::MergeItem1718(const ItemInfo& item) { // OFFSET: 0x00DD7B80 // FUNCTION: fn_23299 -bool ClientItemLists::AddItem1738(const ItemInfo& item, unsigned char refresh) { +bool ClientItemLists::AddItem1738(const ITEM_INFO& item, unsigned char refresh) { if (g_replayAnimationScaling && !Replay::Instance().header.options.Get(ReplayRecordOption::Item)) { return true; } - for (ItemInfo& value : this->items_1738) { + for (ITEM_INFO& value : this->items_1738) { if (value.unknown_0000[1] == item.unknown_0000[1]) { value.quantity += item.quantity; if (refresh && g_windowMgr.window_0288) { diff --git a/Source/Contents/ClientState.cpp b/Source/Contents/ClientState.cpp index 5075b207..89bd8b8d 100644 --- a/Source/Contents/ClientState.cpp +++ b/Source/Contents/ClientState.cpp @@ -51,7 +51,7 @@ void CSession::SetPetAutoFeed(bool enabled) { // FUNCTION: fn_24225 void CSession::CollectCardItems() { this->m_cardItems.clear(); - for (const ItemInfo& item : this->m_inventoryItems) { + for (const ITEM_INFO& item : this->m_inventoryItems) { if (item.unknown_0000[0] == 6) { this->m_cardItems.push_back(item); } diff --git a/Source/Contents/ClientTiming.cpp b/Source/Contents/ClientTiming.cpp index a1e1d1b2..8edf5987 100644 --- a/Source/Contents/ClientTiming.cpp +++ b/Source/Contents/ClientTiming.cpp @@ -457,7 +457,7 @@ void CSession::SetHotkeyDescription(const char* description, int index) { // OFFSET: 0x00E00320 // FUNCTION: fn_23639 -void CSession::AddItemSlot(ItemInfo item) { +void CSession::AddItemSlot(ITEM_INFO item) { for (int slot = 0; slot < 10; ++slot) { if (this->m_itemSlots[slot].quantity == 0) { this->m_itemSlots[slot] = item; @@ -623,7 +623,7 @@ int CSession::SetUnknown8134(int value) { // OFFSET: 0x00E01670 // FUNCTION: fn_23647 void CSession::ClearUnknown1710(int id) { - for (ItemInfo& entry : this->m_inventoryItems) { + for (ITEM_INFO& entry : this->m_inventoryItems) { if (entry.unknown_0000[1] == static_cast(id)) { entry.unknown_0074[2] = 0; break; @@ -634,7 +634,7 @@ void CSession::ClearUnknown1710(int id) { // OFFSET: 0x00E016A0 // FUNCTION: fn_23648 void CSession::ClearUnknown1740(int id) { - for (ItemInfo& entry : this->unknown_1740) { + for (ITEM_INFO& entry : this->unknown_1740) { if (entry.unknown_0000[1] == static_cast(id)) { entry.unknown_0074[2] = 0; break; @@ -645,7 +645,7 @@ void CSession::ClearUnknown1740(int id) { // OFFSET: 0x00E016D0 // FUNCTION: fn_23649 void CSession::ClearUnknown1738(int id) { - for (ItemInfo& entry : this->unknown_1738) { + for (ITEM_INFO& entry : this->unknown_1738) { if (entry.unknown_0000[1] == static_cast(id)) { entry.unknown_0074[2] = 0; break; diff --git a/Source/Contents/Items/ItemDescription.cpp b/Source/Contents/Items/ItemDescription.cpp index eb311339..e46e5d4a 100644 --- a/Source/Contents/Items/ItemDescription.cpp +++ b/Source/Contents/Items/ItemDescription.cpp @@ -94,14 +94,14 @@ void ItemDescriptions::IconPath(char* output, const char* id, int identified) { // OFFSET: 0x006D5730 // FUNCTION: fn_06576 -const std::vector& ItemDescriptions::Description(const ItemInfo& item) { +const std::vector& ItemDescriptions::Description(const ITEM_INFO& item) { const ITEM_DESC& value = this->Find(std::atoi(item.itemId.c_str())); return item.identified == 1 ? value.identifiedDescription : value.unidentifiedDescription; } // OFFSET: 0x006D5810 // FUNCTION: fn_06578 -int ItemDescriptions::Name(const ItemInfo& item, char* output, int& capacity, unsigned char consume) { +int ItemDescriptions::Name(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) { const char* name = this->Find(std::atoi(item.itemId.c_str())).identifiedName; const int error = strncpy_s(output, capacity, name ? name : " ", _TRUNCATE); diff --git a/Source/Contents/Items/ItemDescription.h b/Source/Contents/Items/ItemDescription.h index 94df02c4..5de681f9 100644 --- a/Source/Contents/Items/ItemDescription.h +++ b/Source/Contents/Items/ItemDescription.h @@ -5,7 +5,7 @@ #include struct ItemCardName; -struct ItemInfo; +struct ITEM_INFO; class ITEM_DESC { public: @@ -30,8 +30,8 @@ struct ItemDescriptions { ITEM_DESC& Find(int id); ITEM_DESC& Ensure(int id); void IconPath(char* output, const char* id, int identified); - const std::vector& Description(const ItemInfo& item); - int Name(const ItemInfo& item, char* output, int& capacity, unsigned char consume); + const std::vector& Description(const ITEM_INFO& item); + int Name(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume); }; extern std::map g_itemDescriptions; diff --git a/Source/Contents/Items/ItemInfo.cpp b/Source/Contents/Items/ItemInfo.cpp index 501d3b89..12019e93 100644 --- a/Source/Contents/Items/ItemInfo.cpp +++ b/Source/Contents/Items/ItemInfo.cpp @@ -20,19 +20,19 @@ unsigned char g_digitCharacters[256] = { // OFFSET: 0x006D47E0 // FUNCTION: fn_06562 -ItemInfo::ItemInfo() { +ITEM_INFO::ITEM_INFO() { this->Reset(); } // OFFSET: 0x006D4750 // FUNCTION: fn_06561 -ItemInfo::ItemInfo(int) { +ITEM_INFO::ITEM_INFO(int) { this->Reset(); } // OFFSET: 0x005D8F90 // FUNCTION: fn_03753 -ItemInfo::ItemInfo(const ItemInfo& other) : itemId(other.itemId), unknown_0044(other.unknown_0044) { +ITEM_INFO::ITEM_INFO(const ITEM_INFO& other) : itemId(other.itemId), unknown_0044(other.unknown_0044) { std::memcpy(this->unknown_0000, other.unknown_0000, sizeof(this->unknown_0000)); this->quantity = other.quantity; std::memcpy(this->unknown_0014, other.unknown_0014, sizeof(this->unknown_0014)); @@ -59,7 +59,7 @@ ItemInfo::ItemInfo(const ItemInfo& other) : itemId(other.itemId), unknown_0044(o // OFFSET: 0x006D52B0 // FUNCTION: fn_06569 -ItemInfo& ItemInfo::operator=(const ItemInfo& other) { +ITEM_INFO& ITEM_INFO::operator=(const ITEM_INFO& other) { if (this == &other) { return *this; } @@ -92,7 +92,7 @@ ItemInfo& ItemInfo::operator=(const ItemInfo& other) { // OFFSET: 0x006D5550 // FUNCTION: fn_06573 -std::uint32_t ItemInfo::Assign(const RawItemData& item) { +std::uint32_t ITEM_INFO::Assign(const RawItemData& item) { this->unknown_0000[0] = item.unknown_0018; this->unknown_0000[1] = item.unknown_0004; this->quantity = item.quantity; @@ -129,7 +129,7 @@ std::uint32_t ItemInfo::Assign(const RawItemData& item) { // OFFSET: 0x006D8A90 // FUNCTION: fn_06606 -void ItemInfo::Reset() { +void ITEM_INFO::Reset() { std::memset(this->unknown_0000, 0, sizeof(this->unknown_0000)); this->quantity = 0; std::memset(this->unknown_0014, 0, sizeof(this->unknown_0014)); @@ -153,31 +153,31 @@ void ItemInfo::Reset() { // OFFSET: 0x00DDD4E0 // FUNCTION: fn_23386 -ItemInfo LookupClientItem(const std::list& values, int id, unsigned char requireIdentified) { - for (const ItemInfo& value : values) { +ITEM_INFO LookupClientItem(const std::list& values, int id, unsigned char requireIdentified) { + for (const ITEM_INFO& value : values) { if (std::atoi(value.itemId.c_str()) == id && (!requireIdentified || value.identified != 0)) { return value; } } - return ItemInfo(0); + return ITEM_INFO(0); } // OFFSET: 0x00DDD5A0 // FUNCTION: fn_23387 -ItemInfo LookupClientItemByIdentity(const std::list& values, std::uint32_t id) { - for (const ItemInfo& value : values) { +ITEM_INFO LookupClientItemByIdentity(const std::list& values, std::uint32_t id) { + for (const ITEM_INFO& value : values) { if (value.unknown_0000[1] == id) { return value; } } - return ItemInfo(0); + return ITEM_INFO(0); } // OFFSET: 0x006D5450 // FUNCTION: fn_06570 -ItemInfo& ItemInfo::AssignBasic(const RawItemBasic& item) { +ITEM_INFO& ITEM_INFO::AssignBasic(const RawItemBasic& item) { this->unknown_0000[1] = item.id; this->unknown_0014[0] = item.unknown_0004; this->unknown_0014[1] = item.unknown_0008; @@ -192,7 +192,7 @@ ItemInfo& ItemInfo::AssignBasic(const RawItemBasic& item) { // OFFSET: 0x006D54C0 // FUNCTION: fn_06571 -bool ItemInfo::operator<(const ItemInfo& other) const { +bool ITEM_INFO::operator<(const ITEM_INFO& other) const { return this->unknown_0044 < other.unknown_0044; } @@ -244,14 +244,14 @@ bool MatchItemName(std::string name, std::string query, unsigned char partial, s // OFFSET: 0x006D8FE0 // FUNCTION: fn_06609 -bool ItemInfo::SetName(const char* name) { +bool ITEM_INFO::SetName(const char* name) { this->unknown_0044 = name; return this->unknown_0044.empty(); } // OFFSET: 0x006D9010 // FUNCTION: fn_06610 -void ItemInfo::SetItemId(int value) { +void ITEM_INFO::SetItemId(int value) { char buffer[16]; _itoa(value, buffer, 10); this->itemId = buffer; @@ -260,8 +260,8 @@ void ItemInfo::SetItemId(int value) { // OFFSET: 0x00DFB9D0 // FUNCTION: fn_23584 bool CSession::HasRequiredItems() const { - for (const ItemInfo& required : this->unknown_1730) { - const ItemInfo owned = LookupClientItemByIdentity(this->m_inventoryItems, required.unknown_0000[1]); + for (const ITEM_INFO& required : this->unknown_1730) { + const ITEM_INFO owned = LookupClientItemByIdentity(this->m_inventoryItems, required.unknown_0000[1]); if (owned.unknown_0000[1] == 0 || owned.quantity < required.quantity) { return false; } @@ -289,7 +289,7 @@ bool CSession::IsSlotItemIdentity(std::uint32_t id) const { // OFFSET: 0x00DFBDE0 // FUNCTION: fn_23589 bool CSession::HasInventoryItem(std::uint32_t id) const { - for (const ItemInfo& value : this->m_inventoryItems) { + for (const ITEM_INFO& value : this->m_inventoryItems) { if (value.unknown_0000[1] == id) { return true; } @@ -301,7 +301,7 @@ bool CSession::HasInventoryItem(std::uint32_t id) const { // OFFSET: 0x00DFBE40 // FUNCTION: fn_23591 bool CSession::HasItemId(int itemId) const { - const ItemInfo owned = LookupClientItemByIdentity(this->m_inventoryItems, this->unknown_16EC); + const ITEM_INFO owned = LookupClientItemByIdentity(this->m_inventoryItems, this->unknown_16EC); if (owned.unknown_0000[1] != 0 && std::atoi(owned.itemId.c_str()) == itemId) { return true; } @@ -318,7 +318,7 @@ bool CSession::HasItemId(int itemId) const { // OFFSET: 0x00DFBF70 // FUNCTION: fn_23592 bool CSession::HasItemCount(int itemId, int count) const { - const ItemInfo owned = LookupClientItemByIdentity(this->m_inventoryItems, this->unknown_16EC); + const ITEM_INFO owned = LookupClientItemByIdentity(this->m_inventoryItems, this->unknown_16EC); if (owned.unknown_0000[1] != 0 && std::atoi(owned.itemId.c_str()) == itemId) { return true; } @@ -337,7 +337,7 @@ bool CSession::HasItemCount(int itemId, int count) const { // OFFSET: 0x006D88D0 // FUNCTION: fn_06600 -bool ItemInfo::HasSpecialCard() const { +bool ITEM_INFO::HasSpecialCard() const { std::uint32_t card; std::memcpy(&card, this->unknown_001C, sizeof(card)); return card == 254 || card == 255; @@ -345,14 +345,14 @@ bool ItemInfo::HasSpecialCard() const { // OFFSET: 0x006D89D0 // FUNCTION: fn_06603 -bool ItemInfo::IsApprenticeItem() const { +bool ITEM_INFO::IsApprenticeItem() const { const unsigned id = static_cast(std::atoi(this->itemId.c_str())); return id - 9001u <= 498u || id - 10000u <= 999u; } // OFFSET: 0x006D8920 // FUNCTION: fn_06601 -bool ItemInfo::IsForgeMaterial() const { +bool ITEM_INFO::IsForgeMaterial() const { return std::atoi(this->itemId.c_str()) == 1000 || this->IsElementalStone(); } @@ -370,7 +370,7 @@ bool IsNumericText(const char* text) { // OFFSET: 0x006D8A10 // FUNCTION: fn_06604 -bool ItemInfo::IsElementalStone() const { +bool ITEM_INFO::IsElementalStone() const { switch (std::atoi(this->itemId.c_str())) { case 994: case 995: @@ -384,12 +384,12 @@ bool ItemInfo::IsElementalStone() const { // OFFSET: 0x006D8A50 // FUNCTION: fn_06605 -bool ItemInfo::IsAboveItemId600() const { +bool ITEM_INFO::IsAboveItemId600() const { return std::atoi(this->itemId.c_str()) > 500 && std::atoi(this->itemId.c_str()) > 600; } // OFFSET: 0x005FCCF0 // FUNCTION: fn_04106 -int ItemInfo::GetItemId() const { +int ITEM_INFO::GetItemId() const { return std::atoi(this->itemId.c_str()); } diff --git a/Source/Contents/Items/ItemInfo.h b/Source/Contents/Items/ItemInfo.h index 843455e1..1ba2d7ab 100644 --- a/Source/Contents/Items/ItemInfo.h +++ b/Source/Contents/Items/ItemInfo.h @@ -54,15 +54,15 @@ static_assert(offsetof(RawItemBasic, unknown_0034) == 0x34); static_assert(offsetof(RawItemBasic, unknown_0038) == 0x38); #endif -struct alignas(8) ItemInfo { - ItemInfo(); - explicit ItemInfo(int unused); - ItemInfo(const ItemInfo& other); - ItemInfo& operator=(const ItemInfo& other); +struct alignas(8) ITEM_INFO { + ITEM_INFO(); + explicit ITEM_INFO(int unused); + ITEM_INFO(const ITEM_INFO& other); + ITEM_INFO& operator=(const ITEM_INFO& other); void Reset(); std::uint32_t Assign(const RawItemData& item); - ItemInfo& AssignBasic(const RawItemBasic& item); - bool operator<(const ItemInfo& other) const; + ITEM_INFO& AssignBasic(const RawItemBasic& item); + bool operator<(const ITEM_INFO& other) const; bool SetName(const char* name); void SetItemId(int value); int GetItemId() const; @@ -99,15 +99,15 @@ struct alignas(8) ItemInfo { /* 00D9 */ unsigned char unknown_00D9[24]; }; -ItemInfo LookupClientItem(const std::list& values, int id, unsigned char requireIdentified); -ItemInfo LookupClientItemByIdentity(const std::list& values, std::uint32_t id); +ITEM_INFO LookupClientItem(const std::list& values, int id, unsigned char requireIdentified); +ITEM_INFO LookupClientItemByIdentity(const std::list& values, std::uint32_t id); bool IsNumericText(const char* text); bool MatchItemName(std::string name, std::string query, unsigned char partial, std::list* result, int id); std::list SearchItemIds(std::string query, unsigned char cardsOnly, unsigned char partial); #if defined(_WIN32) && !defined(_WIN64) -static_assert(sizeof(ItemInfo) == 248); +static_assert(sizeof(ITEM_INFO) == 248); #endif #endif diff --git a/Source/Contents/Items/ItemLink.cpp b/Source/Contents/Items/ItemLink.cpp index 6ae14ee8..8cbad6f3 100644 --- a/Source/Contents/Items/ItemLink.cpp +++ b/Source/Contents/Items/ItemLink.cpp @@ -146,7 +146,7 @@ void DecodeItemLinkFields(const std::string& text, std::vector& fi // OFFSET: 0x008933E0 // FUNCTION: fn_11505 -bool ItemFromLinkFields(const std::vector& fields, ItemInfo& item, ItemDescriptions& descriptions) { +bool ItemFromLinkFields(const std::vector& fields, ITEM_INFO& item, ItemDescriptions& descriptions) { if (fields.empty()) { return false; } diff --git a/Source/Contents/Items/ItemLink.h b/Source/Contents/Items/ItemLink.h index 3a1df9a0..c94f6ddf 100644 --- a/Source/Contents/Items/ItemLink.h +++ b/Source/Contents/Items/ItemLink.h @@ -6,10 +6,10 @@ #include struct ItemDescriptions; -struct ItemInfo; +struct ITEM_INFO; void DecodeItemLinkFields(const std::string& text, std::vector& fields); -bool ItemFromLinkFields(const std::vector& fields, ItemInfo& item, ItemDescriptions& descriptions); +bool ItemFromLinkFields(const std::vector& fields, ITEM_INFO& item, ItemDescriptions& descriptions); int ItemLinkMessageId(const std::string& text); #endif diff --git a/Source/Contents/Items/ItemNaming.cpp b/Source/Contents/Items/ItemNaming.cpp index bd11121a..e4d229f6 100644 --- a/Source/Contents/Items/ItemNaming.cpp +++ b/Source/Contents/Items/ItemNaming.cpp @@ -18,7 +18,7 @@ std::map g_itemCardNames; namespace { // OFFSET: 0x006D8810 // FUNCTION: fn_06597 - bool Equipment(const ItemInfo& item) { + bool Equipment(const ITEM_INFO& item) { switch (item.unknown_0000[0]) { case 4: case 5: @@ -37,7 +37,7 @@ namespace { } // INLINED - void CardIds(const ItemInfo& item, int (&ids)[4]) { + void CardIds(const ITEM_INFO& item, int (&ids)[4]) { std::memcpy(ids, item.unknown_001C, sizeof(ids)); } @@ -55,7 +55,7 @@ const char* ItemNaming::Message(int id) const { // OFFSET: 0x006D77E0 // FUNCTION: fn_06595 -bool ItemNaming::HasCards(const ItemInfo& item) const { +bool ItemNaming::HasCards(const ITEM_INFO& item) const { int ids[4]; CardIds(item, ids); const bool first = this->cards.contains(ids[0]); @@ -70,7 +70,7 @@ bool ItemNaming::HasCards(const ItemInfo& item) const { // OFFSET: 0x006D5780 // FUNCTION: fn_06577 -int ItemNaming::Grade(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const { +int ItemNaming::Grade(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) const { const char grade[2] = {item.unknown_0088 >= 1 && item.unknown_0088 <= 4 ? "DCBA"[item.unknown_0088 - 1] : '\0', '\0'}; const int bytes = _snprintf_s(output, capacity, _TRUNCATE, "[%s] ", grade); if (bytes <= 0) { @@ -86,7 +86,7 @@ int ItemNaming::Grade(const ItemInfo& item, char* output, int& capacity, unsigne // OFFSET: 0x006D6C10 // FUNCTION: fn_06585 -int ItemNaming::Creator(const ItemInfo& item, char* output, int& capacity, unsigned char consume) { +int ItemNaming::Creator(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) { int ids[4]; CardIds(item, ids); std::string name = this->players.Lookup(static_cast(ids[2]) + (static_cast(ids[3]) << 16)); @@ -105,7 +105,7 @@ int ItemNaming::Creator(const ItemInfo& item, char* output, int& capacity, unsig // OFFSET: 0x006D6F50 // FUNCTION: fn_06588 -int ItemNaming::Prefixes(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const { +int ItemNaming::Prefixes(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) const { int ids[4]; CardIds(item, ids); int remaining = capacity; @@ -155,7 +155,7 @@ int ItemNaming::Prefixes(const ItemInfo& item, char* output, int& capacity, unsi // OFFSET: 0x006D6DB0 // FUNCTION: fn_06587 -int ItemNaming::Suffixes(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const { +int ItemNaming::Suffixes(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) const { int ids[4]; CardIds(item, ids); int remaining = capacity; @@ -205,7 +205,7 @@ int ItemNaming::Suffixes(const ItemInfo& item, char* output, int& capacity, unsi // OFFSET: 0x006D76E0 // FUNCTION: fn_06593 -int ItemNaming::Slots(const ItemInfo& item, char* output, int& capacity, unsigned char consume) { +int ItemNaming::Slots(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) { const int slots = this->descriptions.Find(std::atoi(item.itemId.c_str())).slots; if (slots == 0) { return 0; @@ -225,7 +225,7 @@ int ItemNaming::Slots(const ItemInfo& item, char* output, int& capacity, unsigne // OFFSET: 0x006D59A0 // FUNCTION: fn_06581 -std::string ItemNaming::DisplayName(const ItemInfo& item, unsigned char detailed) { +std::string ItemNaming::DisplayName(const ITEM_INFO& item, unsigned char detailed) { char text[128] = {}; int capacity = 128; std::string result; @@ -377,7 +377,7 @@ const std::vector& FindMetalProcessItems(int id) { // OFFSET: 0x006D70E0 // FUNCTION: fn_06590 -std::vector ItemInfo::Serialize() const { +std::vector ITEM_INFO::Serialize() const { std::vector result; const auto append = [&result](std::uint16_t id, const void* data, std::uint32_t bytes) { const auto record = BuildReplayTaggedRecord(id, data, bytes); @@ -411,7 +411,7 @@ std::vector ItemInfo::Serialize() const { // OFFSET: 0x006D7660 // FUNCTION: fn_06591 -const char* ItemResourcePath(const ItemInfo& item) { +const char* ItemResourcePath(const ITEM_INFO& item) { int id = std::atoi(item.itemId.c_str()); ITEM_DESC& desc = FindItemDescription(id); return item.identified == 1 ? desc.identifiedResource : desc.unidentifiedResource; @@ -419,14 +419,14 @@ const char* ItemResourcePath(const ItemInfo& item) { // OFFSET: 0x006D76B0 // FUNCTION: fn_06592 -int ItemSlotsCount(const ItemInfo& item) { +int ItemSlotsCount(const ITEM_INFO& item) { int id = std::atoi(item.itemId.c_str()); return FindItemDescription(id).slots; } // OFFSET: 0x006D7760 // FUNCTION: fn_06594 -int ItemUnidentifiedName(const ItemInfo& item, char* output, int& capacity, unsigned char consume) { +int ItemUnidentifiedName(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) { int id = std::atoi(item.itemId.c_str()); int written = Copy(output, capacity, FindItemDescription(id).unidentifiedName); if (written > 0 && consume) { @@ -447,17 +447,17 @@ ItemCardName& FindItemCardName(int id, std::map& values) { // OFFSET: 0x006D78C0 struct ItemNamingContext : public ItemNaming { - int Element(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const; - int Star(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const; - int Apprentice(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const; - std::uint32_t CardColor(const ItemInfo& item, int slot) const; + int Element(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) const; + int Star(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) const; + int Apprentice(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) const; + std::uint32_t CardColor(const ITEM_INFO& item, int slot) const; }; // OFFSET: 0x006D5650 // OFFSET: 0x006D6AA0 // FUNCTION: fn_06583 -int ItemNamingContext::Element(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const { +int ItemNamingContext::Element(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) const { const unsigned value = item.unknown_001C[4]; int message = 0; int id = std::atoi(item.itemId.c_str()); @@ -494,7 +494,7 @@ int ItemNamingContext::Element(const ItemInfo& item, char* output, int& capacity // OFFSET: 0x006D6B90 // FUNCTION: fn_06584 -int ItemNamingContext::Star(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const { +int ItemNamingContext::Star(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) const { int message = 0; switch (item.unknown_001C[5]) { case 5: @@ -522,7 +522,7 @@ int ItemNamingContext::Star(const ItemInfo& item, char* output, int& capacity, u // OFFSET: 0x006D6D50 // FUNCTION: fn_06586 -int ItemNamingContext::Apprentice(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const { +int ItemNamingContext::Apprentice(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) const { const char* text = this->Message(756); const int error = strncpy_s(output, capacity, text ? text : " ", _TRUNCATE); int written = (error == 0 || error == 80) && output ? static_cast(strnlen(output, capacity)) : 0; @@ -536,7 +536,7 @@ int ItemNamingContext::Apprentice(const ItemInfo& item, char* output, int& capac // OFFSET: 0x006D70A0 // FUNCTION: fn_06589 -int ItemInfo::Refine(char* output, int& capacity, unsigned char consume) const { +int ITEM_INFO::Refine(char* output, int& capacity, unsigned char consume) const { const int bytes = StringFormat(output, capacity, static_cast(-1), "+%d ", this->unknown_0060); if (bytes <= 0) { diff --git a/Source/Contents/Items/ItemNaming.h b/Source/Contents/Items/ItemNaming.h index 393a1893..56b85f99 100644 --- a/Source/Contents/Items/ItemNaming.h +++ b/Source/Contents/Items/ItemNaming.h @@ -8,7 +8,7 @@ #include class CPlayerNameDictionary; -struct ItemInfo; +struct ITEM_INFO; struct ItemCardName { /* 0000 */ const char* name; @@ -24,13 +24,13 @@ struct ItemNaming { const int& service; const WORD& language; - std::string DisplayName(const ItemInfo& item, unsigned char detailed); - bool HasCards(const ItemInfo& item) const; - int Grade(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const; - int Creator(const ItemInfo& item, char* output, int& capacity, unsigned char consume); - int Prefixes(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const; - int Suffixes(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const; - int Slots(const ItemInfo& item, char* output, int& capacity, unsigned char consume); + std::string DisplayName(const ITEM_INFO& item, unsigned char detailed); + bool HasCards(const ITEM_INFO& item) const; + int Grade(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) const; + int Creator(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume); + int Prefixes(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) const; + int Suffixes(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume) const; + int Slots(const ITEM_INFO& item, char* output, int& capacity, unsigned char consume); const char* Message(int id) const; }; diff --git a/Source/Contents/Messenger/ClientMessenger.cpp b/Source/Contents/Messenger/ClientMessenger.cpp index a834221d..79dd2d66 100644 --- a/Source/Contents/Messenger/ClientMessenger.cpp +++ b/Source/Contents/Messenger/ClientMessenger.cpp @@ -24,13 +24,13 @@ void __fastcall RefreshItemWindows(UIWindowMgr* mgr); struct SessionItemLists { /* 0000 */ unsigned char unknown_0000[0x1710]; - /* 1710 */ std::list inventory; - /* 1718 */ std::list items_1718; - /* 1720 */ std::list items_1720; - /* 1728 */ std::list items_1728; - /* 1730 */ std::list items_1730; + /* 1710 */ std::list inventory; + /* 1718 */ std::list items_1718; + /* 1720 */ std::list items_1720; + /* 1728 */ std::list items_1728; + /* 1730 */ std::list items_1730; /* 1738 */ unsigned char unknown_1738[0x48]; - /* 1780 */ std::list items_1780[11]; + /* 1780 */ std::list items_1780[11]; void ClearItems1780(); void KeepEquipment(); @@ -908,7 +908,7 @@ int SessionMessengerContext::GetList5Size() const { // OFFSET: 0x00DD8380 // FUNCTION: fn_23305 void SessionItemLists::ClearItems1780() { - for (std::list& items : this->items_1780) { + for (std::list& items : this->items_1780) { items.clear(); } } diff --git a/Source/Contents/Skills/ClientSkills.cpp b/Source/Contents/Skills/ClientSkills.cpp index e65c132c..d883f72c 100644 --- a/Source/Contents/Skills/ClientSkills.cpp +++ b/Source/Contents/Skills/ClientSkills.cpp @@ -328,7 +328,7 @@ void CSession::AddUnknownId(int id) { // OFFSET: 0x00E07930 // FUNCTION: fn_23747 -void CSession::AddStackedItem(ItemInfo item) { +void CSession::AddStackedItem(ITEM_INFO item) { int index; for (index = 0; index < 5; ++index) { if (this->unknown_5C68[index].quantity != 0 && this->unknown_5C68[index].unknown_0000[1] == item.unknown_0000[1]) { @@ -354,7 +354,7 @@ void CSession::AddStackedItem(ItemInfo item) { // OFFSET: 0x00E07A10 // FUNCTION: fn_23748 -void CSession::AddItemToFreeSlot(ItemInfo item) { +void CSession::AddItemToFreeSlot(ITEM_INFO item) { for (int index = 0; index < 5; ++index) { if (this->unknown_5C68[index].quantity == 0) { this->unknown_5C68[index] = item; @@ -543,16 +543,16 @@ const char* CSession::DecodePlayerName() const { // OFFSET: 0x00E08EE0 // FUNCTION: fn_23773 -ItemInfo CSession::GetItem2B50(int index) const { +ITEM_INFO CSession::GetItem2B50(int index) const { if (index == 15) { - return ItemInfo(0); + return ITEM_INFO(0); } if (index >= 0 && index < 10) { return this->unknown_2B50[index]; } - return ItemInfo(0); + return ITEM_INFO(0); } // OFFSET: 0x00E08F70 diff --git a/Source/Contents/Store/MCStoreInfoBackup.cpp b/Source/Contents/Store/MCStoreInfoBackup.cpp index 9b6efbf9..4c04e789 100644 --- a/Source/Contents/Store/MCStoreInfoBackup.cpp +++ b/Source/Contents/Store/MCStoreInfoBackup.cpp @@ -29,12 +29,12 @@ void CMCStoreInfoBackup::Clear() { // OFFSET: 0x00606BB0 // FUNCTION: fn_04234 -int CMCStoreInfoBackup::Restore(unsigned char wholeItem, int maximum, std::list& inventory, std::list& storeItems) { +int CMCStoreInfoBackup::Restore(unsigned char wholeItem, int maximum, std::list& inventory, std::list& storeItems) { auto saved = this->items.begin(); int examined = 0; while (saved != this->items.end() && examined < maximum) { - const auto found = std::find_if(inventory.begin(), inventory.end(), [&](const ItemInfo& item) { + const auto found = std::find_if(inventory.begin(), inventory.end(), [&](const ITEM_INFO& item) { if (item.itemId != saved->itemId || std::memcmp(item.unknown_001C, saved->unknown_001C, sizeof(item.unknown_001C)) != 0 || item.identified != saved->identified || item.unknown_0060 != saved->unknown_0060 || item.unknown_0088 != saved->unknown_0088 || item.unknown_0098 != saved->unknown_0098) { @@ -53,7 +53,7 @@ int CMCStoreInfoBackup::Restore(unsigned char wholeItem, int maximum, std::list< if (found == inventory.end()) { saved = this->items.erase(saved); } else { - ItemInfo item(*found); + ITEM_INFO item(*found); if (wholeItem == 0) { item.quantity = std::min(item.quantity, saved->quantity); @@ -61,7 +61,7 @@ int CMCStoreInfoBackup::Restore(unsigned char wholeItem, int maximum, std::list< if (item.unknown_0000[0] != 0) { const auto offered = - std::find_if(storeItems.begin(), storeItems.end(), [&](const ItemInfo& value) { return value.unknown_0000[1] == item.unknown_0000[1]; }); + std::find_if(storeItems.begin(), storeItems.end(), [&](const ITEM_INFO& value) { return value.unknown_0000[1] == item.unknown_0000[1]; }); if (offered == storeItems.end()) { storeItems.push_back(item); @@ -191,7 +191,7 @@ void CMCStoreInfoBackup::Load( // OFFSET: 0x00606EB0 // FUNCTION: fn_04236 void CMCStoreInfoBackup::Save( - int type, std::uint32_t accountId, std::uint32_t characterId, const char* accountName, const char* token16, const std::list& storeItems, + int type, std::uint32_t accountId, std::uint32_t characterId, const char* accountName, const char* token16, const std::list& storeItems, CAsyncWorkMgr& workManager, StoreBackupContext& context ) { this->type = type; diff --git a/Source/Contents/Store/MCStoreInfoBackup.h b/Source/Contents/Store/MCStoreInfoBackup.h index d192a825..29babc9e 100644 --- a/Source/Contents/Store/MCStoreInfoBackup.h +++ b/Source/Contents/Store/MCStoreInfoBackup.h @@ -30,7 +30,7 @@ public: CMCStoreInfoBackup(); virtual ~CMCStoreInfoBackup(); void Clear(); - int Restore(unsigned char wholeItem, int maximum, std::list& inventory, std::list& storeItems); + int Restore(unsigned char wholeItem, int maximum, std::list& inventory, std::list& storeItems); std::string LoadUrl() const; std::string SaveUrl() const; void Reset(LuaScript& settings, LuaScript& tables, const char* host, const char* port, const char* overrideKey); @@ -43,7 +43,7 @@ public: StoreBackupContext& context ); void Save( - int type, std::uint32_t accountId, std::uint32_t characterId, const char* accountName, const char* token16, const std::list& storeItems, + int type, std::uint32_t accountId, std::uint32_t characterId, const char* accountName, const char* token16, const std::list& storeItems, CAsyncWorkMgr& workManager, StoreBackupContext& context ); @@ -54,7 +54,7 @@ public: /* 0024 */ std::string loadUrl; /* 003C */ std::string title; /* 0054 */ int type; - /* 0058 */ std::vector items; + /* 0058 */ std::vector items; }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/Contents/Store/StoreBackupData.cpp b/Source/Contents/Store/StoreBackupData.cpp index 2781ff67..3a58d514 100644 --- a/Source/Contents/Store/StoreBackupData.cpp +++ b/Source/Contents/Store/StoreBackupData.cpp @@ -20,7 +20,7 @@ void StoreBackupData::Import(Json::Value& data) { continue; } - ItemInfo item; + ITEM_INFO item; item.itemId = std::to_string(value.get("ID", 0).asInt()); item.quantity = value.get("Count", 0).asInt(); item.identified = value.get("Identified", 0).asBool(); @@ -42,7 +42,7 @@ void StoreBackupData::Import(Json::Value& data) { const auto id = static_cast((*option).get("OptIndex", 0).asInt()); const auto amount = static_cast((*option).get("Value", 0).asInt()); const auto parameter = static_cast((*option).get("Parm1", 0).asInt()); - auto* record = reinterpret_cast(&item) + offsetof(ItemInfo, unknown_009C) + index * 5; + auto* record = reinterpret_cast(&item) + offsetof(ITEM_INFO, unknown_009C) + index * 5; std::memcpy(record, &id, sizeof(id)); std::memcpy(record + 2, &amount, sizeof(amount)); @@ -56,11 +56,11 @@ void StoreBackupData::Import(Json::Value& data) { // OFFSET: 0x00607240 // FUNCTION: fn_04238 -void StoreBackupData::Export(Json::Value& data, const std::list& storeItems) const { +void StoreBackupData::Export(Json::Value& data, const std::list& storeItems) const { data["Title"] = ToUtf8(this->title, g_textCodePage); Json::Value values; - for (const ItemInfo& item : storeItems) { + for (const ITEM_INFO& item : storeItems) { Json::Value value; value["ID"] = std::atoi(item.itemId.c_str()); value["Count"] = item.quantity; @@ -80,7 +80,7 @@ void StoreBackupData::Export(Json::Value& data, const std::list& store Json::Value options; for (int index = 0; index < count; ++index) { - const auto* record = reinterpret_cast(&item) + offsetof(ItemInfo, unknown_009C) + index * 5; + const auto* record = reinterpret_cast(&item) + offsetof(ITEM_INFO, unknown_009C) + index * 5; std::int16_t id, amount; std::memcpy(&id, record, sizeof(id)); std::memcpy(&amount, record + 2, sizeof(amount)); diff --git a/Source/Contents/Store/StoreBackupData.h b/Source/Contents/Store/StoreBackupData.h index a8836919..c408dacc 100644 --- a/Source/Contents/Store/StoreBackupData.h +++ b/Source/Contents/Store/StoreBackupData.h @@ -12,10 +12,10 @@ namespace Json { struct StoreBackupData { std::string& title; - std::vector& items; + std::vector& items; void Import(Json::Value& data); - void Export(Json::Value& data, const std::list& storeItems) const; + void Export(Json::Value& data, const std::list& storeItems) const; }; #endif diff --git a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h index 36863dbb..8df0d337 100644 --- a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h +++ b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h @@ -15,9 +15,9 @@ struct UIAcceptanceContext { const int& screenWidth; const int& screenHeight; const int& service; - std::list& firstShopItems; - std::list& secondShopItems; - std::list& thirdShopItems; + std::list& firstShopItems; + std::list& secondShopItems; + std::list& thirdShopItems; int& replayShopState; std::string& replayExchangeName; }; diff --git a/Source/UI/Items/UIItemIdentifyWnd.h b/Source/UI/Items/UIItemIdentifyWnd.h index 2b8d770c..6c5dc16c 100644 --- a/Source/UI/Items/UIItemIdentifyWnd.h +++ b/Source/UI/Items/UIItemIdentifyWnd.h @@ -12,7 +12,7 @@ public: /* 00C0 */ int m_columns; /* 00C4 */ int m_rows; /* 00C8 */ int m_scrollable; - /* 00CC */ std::list m_items; + /* 00CC */ std::list m_items; void Slot25(int x, int y) override; void Slot26(int x, int y) override; diff --git a/Source/UI/Shop/ItemDrawing.cpp b/Source/UI/Shop/ItemDrawing.cpp index b13711a2..73f7c715 100644 --- a/Source/UI/Shop/ItemDrawing.cpp +++ b/Source/UI/Shop/ItemDrawing.cpp @@ -10,7 +10,7 @@ // OFFSET: 0x008A8EE0 // FUNCTION: fn_11717 -void DrawItemIcon(UIWindow& window, ResourceMgr& resources, ItemDescriptions& descriptions, int x, int y, const ItemInfo& item, unsigned char identified) { +void DrawItemIcon(UIWindow& window, ResourceMgr& resources, ItemDescriptions& descriptions, int x, int y, const ITEM_INFO& item, unsigned char identified) { char path[128]; descriptions.IconPath(path, item.itemId.c_str(), item.identified != 0 || identified != 0); CBitmapRes* bitmap = static_cast(resources.Load(path)); @@ -42,7 +42,7 @@ void DrawItemSlotBackground(UIWindow& window, int x, int y) { // OFFSET: 0x008A9040 // FUNCTION: fn_11720 void DrawItemWithQuantity( - UIWindow& window, ResourceMgr& resources, ItemDescriptions& descriptions, FontCache& fonts, const TextLocale& locale, int x, int y, const ItemInfo& item, + UIWindow& window, ResourceMgr& resources, ItemDescriptions& descriptions, FontCache& fonts, const TextLocale& locale, int x, int y, const ITEM_INFO& item, unsigned char identified, unsigned char plain ) { DrawItemIcon(window, resources, descriptions, x, y, item, identified); diff --git a/Source/UI/Shop/ItemDrawing.h b/Source/UI/Shop/ItemDrawing.h index 055b447a..128d8d21 100644 --- a/Source/UI/Shop/ItemDrawing.h +++ b/Source/UI/Shop/ItemDrawing.h @@ -1,18 +1,18 @@ #ifndef RAGNAROK_SOURCE_UI_SHOP_ITEMDRAWING_H #define RAGNAROK_SOURCE_UI_SHOP_ITEMDRAWING_H -struct ItemInfo; +struct ITEM_INFO; struct ItemDescriptions; class UIWindow; class ResourceMgr; class FontCache; struct TextLocale; -void DrawItemIcon(UIWindow& window, ResourceMgr& resources, ItemDescriptions& descriptions, int x, int y, const ItemInfo& item, unsigned char identified); +void DrawItemIcon(UIWindow& window, ResourceMgr& resources, ItemDescriptions& descriptions, int x, int y, const ITEM_INFO& item, unsigned char identified); void DrawItemIconById(UIWindow& window, ItemDescriptions& descriptions, int x, int y, const char* id, unsigned char identified); void DrawItemSlotBackground(UIWindow& window, int x, int y); void DrawItemWithQuantity( - UIWindow& window, ResourceMgr& resources, ItemDescriptions& descriptions, FontCache& fonts, const TextLocale& locale, int x, int y, const ItemInfo& item, + UIWindow& window, ResourceMgr& resources, ItemDescriptions& descriptions, FontCache& fonts, const TextLocale& locale, int x, int y, const ITEM_INFO& item, unsigned char identified, unsigned char plain ); diff --git a/Source/UI/Shop/MerchantShopRefresh.cpp b/Source/UI/Shop/MerchantShopRefresh.cpp index 2a4efeb3..afabbbb9 100644 --- a/Source/UI/Shop/MerchantShopRefresh.cpp +++ b/Source/UI/Shop/MerchantShopRefresh.cpp @@ -33,9 +33,9 @@ void MerchantShopRefresh::Refresh() { edit.Background(background, background, background); } - for (const ItemInfo& item : this->offered) { + for (const ITEM_INFO& item : this->offered) { const auto found = - std::find_if(this->inventory.begin(), this->inventory.end(), [&](const ItemInfo& value) { return value.unknown_0000[1] == item.unknown_0000[1]; }); + std::find_if(this->inventory.begin(), this->inventory.end(), [&](const ITEM_INFO& value) { return value.unknown_0000[1] == item.unknown_0000[1]; }); if (found == this->inventory.end()) { this->inventory.push_back(item); @@ -47,10 +47,10 @@ void MerchantShopRefresh::Refresh() { this->offered.clear(); this->backup.Restore(this->mode != 0, this->maximum, this->inventory, this->offered); - const std::vector displayed(this->backup.items); + const std::vector displayed(this->backup.items); int index = 0; - for (const ItemInfo& item : displayed) { + for (const ITEM_INFO& item : displayed) { if (index >= this->maximum) { break; } diff --git a/Source/UI/Shop/MerchantShopRefresh.h b/Source/UI/Shop/MerchantShopRefresh.h index bd56325c..b1149e2d 100644 --- a/Source/UI/Shop/MerchantShopRefresh.h +++ b/Source/UI/Shop/MerchantShopRefresh.h @@ -12,8 +12,8 @@ class UIEditCtrl; struct MerchantShopRefresh { CMCStoreInfoBackup& backup; - std::list& inventory; - std::list& offered; + std::list& inventory; + std::list& offered; UIEditCtrl& titleEdit; std::span priceEdits; std::span countEdits; diff --git a/Source/UI/Shortcuts/ShortcutCooldowns.cpp b/Source/UI/Shortcuts/ShortcutCooldowns.cpp index b1a02aa2..6c3282c6 100644 --- a/Source/UI/Shortcuts/ShortcutCooldowns.cpp +++ b/Source/UI/Shortcuts/ShortcutCooldowns.cpp @@ -320,7 +320,7 @@ void UIQuickSlotWnd::Paint() { this->DrawTextAt(painting.fonts, painting.locale, x + 14, 20, text, 0, 0, 11, 0, 0, 0); } } else { - ItemInfo item = LookupClientItem(painting.inventory, static_cast(entry.id), 1); + ITEM_INFO item = LookupClientItem(painting.inventory, static_cast(entry.id), 1); if (item.unknown_0000[1] == 0) { continue; } diff --git a/Source/UI/Shortcuts/ShortcutDetails.cpp b/Source/UI/Shortcuts/ShortcutDetails.cpp index e59fc8fa..caaf9aea 100644 --- a/Source/UI/Shortcuts/ShortcutDetails.cpp +++ b/Source/UI/Shortcuts/ShortcutDetails.cpp @@ -77,7 +77,7 @@ void ShortcutDetails::Open(UIWindow& window, ShortcutGrid& grid, int x, int y, c } if (limit <= index || slot->unknown_0000 == 0) { - ItemInfo item = LookupClientItem(this->inventory, static_cast(slot->itemId), 1); + ITEM_INFO item = LookupClientItem(this->inventory, static_cast(slot->itemId), 1); if (item.unknown_0000[1] != 0) { UIWindow* detail = this->windows.EnsureWindow(12); diff --git a/Source/UI/Shortcuts/ShortcutDetails.h b/Source/UI/Shortcuts/ShortcutDetails.h index 1a91f494..b87a4999 100644 --- a/Source/UI/Shortcuts/ShortcutDetails.h +++ b/Source/UI/Shortcuts/ShortcutDetails.h @@ -15,7 +15,7 @@ struct ShortcutDetails { SkillDetailClose& skillClose; const std::uint32_t& describedSkill; ClientSkills& skills; - const std::list& inventory; + const std::list& inventory; const bool& itemSlotActive; unsigned char& currentRow; const unsigned& screenWidth; diff --git a/Source/UI/Shortcuts/ShortcutDrop.cpp b/Source/UI/Shortcuts/ShortcutDrop.cpp index 23c11dda..d0709ddd 100644 --- a/Source/UI/Shortcuts/ShortcutDrop.cpp +++ b/Source/UI/Shortcuts/ShortcutDrop.cpp @@ -114,7 +114,7 @@ void ShortcutDrop::Drop(UIWindow& window, ShortcutGrid& grid, int x, int y, cons return; } - ItemInfo item = LookupClientItemByIdentity(this->inventory, value.id); + ITEM_INFO item = LookupClientItemByIdentity(this->inventory, value.id); if (item.unknown_0000[1] == 0 || item.identified == 0) { this->mode->SendModeMessage(18, 0, 0, 0, 0); return; diff --git a/Source/UI/Shortcuts/ShortcutDrop.h b/Source/UI/Shortcuts/ShortcutDrop.h index a3cc04d3..72d9e6f0 100644 --- a/Source/UI/Shortcuts/ShortcutDrop.h +++ b/Source/UI/Shortcuts/ShortcutDrop.h @@ -12,7 +12,7 @@ struct ShortcutDrop { ShortcutBindings& bindings; LuaScript& script; ModeEvents*& mode; - const std::list& inventory; + const std::list& inventory; const bool& itemSlotActive; unsigned char& currentRow; diff --git a/Source/UI/Shortcuts/ShortcutPainting.cpp b/Source/UI/Shortcuts/ShortcutPainting.cpp index 2504350f..a2d1507f 100644 --- a/Source/UI/Shortcuts/ShortcutPainting.cpp +++ b/Source/UI/Shortcuts/ShortcutPainting.cpp @@ -118,7 +118,7 @@ void ShortcutPainting::Paint(UIWindow& window, const ShortcutGrid& grid, const N Count(window, x + 27, (y + 17), level); } else { - ItemInfo item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); + ITEM_INFO item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); if (item.unknown_0000[1] == 0) { continue; } @@ -146,7 +146,7 @@ void ShortcutPainting::Paint(UIWindow& window, const ShortcutGrid& grid, const N continue; } - ItemInfo item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); + ITEM_INFO item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); if (item.unknown_0000[1] == 0) { continue; } diff --git a/Source/UI/Shortcuts/ShortcutPainting.h b/Source/UI/Shortcuts/ShortcutPainting.h index 059e1961..cda308d3 100644 --- a/Source/UI/Shortcuts/ShortcutPainting.h +++ b/Source/UI/Shortcuts/ShortcutPainting.h @@ -18,7 +18,7 @@ struct ShortcutPainting { FontCache& fonts; const TextLocale& locale; ClientSkills& skills; - const std::list& inventory; + const std::list& inventory; ItemDescriptions& descriptions; std::list& icons; ShortcutCooldowns& cooldowns; diff --git a/Source/UI/Shortcuts/ShortcutPress.cpp b/Source/UI/Shortcuts/ShortcutPress.cpp index e2ecf143..8098f68f 100644 --- a/Source/UI/Shortcuts/ShortcutPress.cpp +++ b/Source/UI/Shortcuts/ShortcutPress.cpp @@ -34,7 +34,7 @@ void ShortcutPress::Press(UIFrameWnd& window, ShortcutGrid& grid, int x, int y, this->drag->BeginSkill(this->windows, this->resources, 7, skill.id, skill.name, slot.unknown_0005, index); } } else { - ItemInfo item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); + ITEM_INFO item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); if (item.unknown_0000[1] != 0) { this->drag->BeginItem(this->windows, this->descriptions, 7, item, item.quantity, -1); } @@ -45,7 +45,7 @@ void ShortcutPress::Press(UIFrameWnd& window, ShortcutGrid& grid, int x, int y, return; } - ItemInfo item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); + ITEM_INFO item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); if (item.unknown_0000[1] != 0 && this->drag) { this->drag->BeginItem(this->windows, this->descriptions, 7, item, item.quantity, -1); } diff --git a/Source/UI/Shortcuts/ShortcutPress.h b/Source/UI/Shortcuts/ShortcutPress.h index 46fc6a6e..3aefa650 100644 --- a/Source/UI/Shortcuts/ShortcutPress.h +++ b/Source/UI/Shortcuts/ShortcutPress.h @@ -14,7 +14,7 @@ struct ModeDragState; struct ShortcutPress { ClientSkills& skills; - const std::list& inventory; + const std::list& inventory; ItemDescriptions& descriptions; ResourceMgr& resources; WindowManagerWindows& windows; diff --git a/Source/UI/Shortcuts/ShortcutTooltip.cpp b/Source/UI/Shortcuts/ShortcutTooltip.cpp index 5c03f9e3..5f176f0d 100644 --- a/Source/UI/Shortcuts/ShortcutTooltip.cpp +++ b/Source/UI/Shortcuts/ShortcutTooltip.cpp @@ -46,7 +46,7 @@ void ShortcutTooltip::Hover(UIWindow& window, ShortcutGrid& grid, int x, int y, return; } - ItemInfo item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); + ITEM_INFO item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); if (item.unknown_0000[1] == 0) { return; } @@ -97,7 +97,7 @@ void ShortcutTooltip::Hover(UIWindow& window, ShortcutGrid& grid, int x, int y, text = SkillTooltip(shortcut.c_str(), skill.DisplayName(this->script), level, sp, ap, SkillUsesPercentSp(static_cast(skill.id))); } } else { - ItemInfo item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); + ITEM_INFO item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); if (item.unknown_0000[1] == 0) { text = shortcut; } else { diff --git a/Source/UI/Shortcuts/ShortcutTooltip.h b/Source/UI/Shortcuts/ShortcutTooltip.h index 41d5c369..3c9866ae 100644 --- a/Source/UI/Shortcuts/ShortcutTooltip.h +++ b/Source/UI/Shortcuts/ShortcutTooltip.h @@ -13,7 +13,7 @@ class ButtonServices; struct ShortcutTooltip { ClientSkills& skills; - const std::list& inventory; + const std::list& inventory; ItemNaming& naming; LuaScript& script; ButtonServices* services; diff --git a/Source/UI/Shortcuts/ShortcutUse.h b/Source/UI/Shortcuts/ShortcutUse.h index 09a09b16..759395df 100644 --- a/Source/UI/Shortcuts/ShortcutUse.h +++ b/Source/UI/Shortcuts/ShortcutUse.h @@ -11,7 +11,7 @@ class ButtonServices; struct ShortcutUse { ClientSkills& skills; - const std::list& inventory; + const std::list& inventory; ItemNaming& naming; ModeEvents*& mode; ButtonServices& dialogs; diff --git a/Source/UI/Shortcuts/UIQuickSlotWnd.h b/Source/UI/Shortcuts/UIQuickSlotWnd.h index 1f348736..2a68a6a2 100644 --- a/Source/UI/Shortcuts/UIQuickSlotWnd.h +++ b/Source/UI/Shortcuts/UIQuickSlotWnd.h @@ -10,14 +10,14 @@ class FontCache; struct TextLocale; struct ClientSkills; -struct ItemInfo; +struct ITEM_INFO; struct ItemDescriptions; struct QuickSlotPainting { FontCache& fonts; const TextLocale& locale; ClientSkills& skills; - const std::list& inventory; + const std::list& inventory; ItemDescriptions& descriptions; std::list& icons; ShortcutCooldowns& cooldowns; diff --git a/Source/UI/Shortcuts/UIShortCutWnd.cpp b/Source/UI/Shortcuts/UIShortCutWnd.cpp index 28fcf52b..14a5090c 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.cpp +++ b/Source/UI/Shortcuts/UIShortCutWnd.cpp @@ -305,7 +305,7 @@ inline void ShortcutUse::Use(const NormalItemSlot& slot) { return; } - ItemInfo item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); + ITEM_INFO item = LookupClientItem(this->inventory, static_cast(slot.itemId), 1); if (item.unknown_0000[1] == 0) { return; } diff --git a/Source/UI/Text/ItemLinkDisplay.cpp b/Source/UI/Text/ItemLinkDisplay.cpp index 3d1dedc3..47254981 100644 --- a/Source/UI/Text/ItemLinkDisplay.cpp +++ b/Source/UI/Text/ItemLinkDisplay.cpp @@ -28,7 +28,7 @@ bool ItemLinkDisplay::Name(const std::string& encoded, std::string& output) { std::vector fields; DecodeItemLinkFields(encoded, fields); - ItemInfo item; + ITEM_INFO item; if (ItemFromLinkFields(fields, item, this->items.descriptions)) { output = this->items.DisplayName(item, 0); diff --git a/Source/UI/Text/TextWrapping.cpp b/Source/UI/Text/TextWrapping.cpp index c3a44181..9c2501ca 100644 --- a/Source/UI/Text/TextWrapping.cpp +++ b/Source/UI/Text/TextWrapping.cpp @@ -133,7 +133,7 @@ void WrapRichText( begin = current; if (id != 0) { - ItemInfo item; + ITEM_INFO item; char itemId[16]; std::sprintf(itemId, "%d", id); item.itemId = itemId; diff --git a/Source/UI/Text/UITextViewerMessages.cpp b/Source/UI/Text/UITextViewerMessages.cpp index 6889da48..5aed1b6e 100644 --- a/Source/UI/Text/UITextViewerMessages.cpp +++ b/Source/UI/Text/UITextViewerMessages.cpp @@ -81,7 +81,7 @@ void UITextViewer::Activate(UITextButton* button, int id) { } const int idValue = !arguments.at(1).empty() ? number(1) : 0; - ItemInfo item; + ITEM_INFO item; item.identified = 1; item.unknown_0000[0] = static_cast(idValue); item.unknown_0070 = 0; diff --git a/Source/UI/UIBasicCtrl.h b/Source/UI/UIBasicCtrl.h index c411e4c4..c5a1a2fc 100644 --- a/Source/UI/UIBasicCtrl.h +++ b/Source/UI/UIBasicCtrl.h @@ -17,7 +17,7 @@ public: protected: /* 007C */ unsigned char unknown_007C[0xC]; /* 0088 */ std::string m_tooltip; - /* 00A0 */ ItemInfo m_item; + /* 00A0 */ ITEM_INFO m_item; ItemNaming* m_naming; UIButtonContext* m_controls; }; diff --git a/Source/UI/UIChangeMaterialWnd.cpp b/Source/UI/UIChangeMaterialWnd.cpp index 2909655d..f0f0313d 100644 --- a/Source/UI/UIChangeMaterialWnd.cpp +++ b/Source/UI/UIChangeMaterialWnd.cpp @@ -2,7 +2,7 @@ // OFFSET: 0x005E1120 // FUNCTION: fn_03872 -ItemInfo* UIChangeMaterialWnd::GetItemAt(int x, int y) { +ITEM_INFO* UIChangeMaterialWnd::GetItemAt(int x, int y) { if (this->m_resultX <= x && x <= this->m_resultX + 24 && this->m_resultY <= y && y <= this->m_resultY + 24) { return &this->m_resultItem; } diff --git a/Source/UI/UIChangeMaterialWnd.h b/Source/UI/UIChangeMaterialWnd.h index adbe3eef..4850ac98 100644 --- a/Source/UI/UIChangeMaterialWnd.h +++ b/Source/UI/UIChangeMaterialWnd.h @@ -15,15 +15,15 @@ struct MaterialSlotPos { class UIChangeMaterialWnd : public UIFrameWnd { public: bool Slot02() override; - ItemInfo* GetItemAt(int x, int y); + ITEM_INFO* GetItemAt(int x, int y); /* 00BC */ std::uint32_t unknown_00BC; /* 00C0 */ std::uint32_t unknown_00C0; /* 00C4 */ int m_resultX; /* 00C8 */ int m_resultY; - /* 00D0 */ ItemInfo m_resultItem; + /* 00D0 */ ITEM_INFO m_resultItem; /* 01C8 */ MaterialSlotPos m_materialPos[6]; - /* 01F8 */ std::vector m_materials; + /* 01F8 */ std::vector m_materials; }; class UIChangeMaterialWnd_List : public UIFrameWnd { diff --git a/Source/UI/UILapineUpgradeBoxWnd.h b/Source/UI/UILapineUpgradeBoxWnd.h index e149b671..aad5d790 100644 --- a/Source/UI/UILapineUpgradeBoxWnd.h +++ b/Source/UI/UILapineUpgradeBoxWnd.h @@ -21,7 +21,7 @@ public: void Slot32(int x, int y) override; void Slot35(int argument) override; - /* 00B8 */ ItemInfo item; + /* 00B8 */ ITEM_INFO item; /* 01B0 */ unsigned char selected; /* 01B4 */ std::string tooltip; /* 01CC */ int quantity; @@ -47,7 +47,7 @@ public: /* 00C0 */ UILapineUpgradeBox_IngredientListWnd* ingredientList; /* 00C4 */ int ingredientId; /* 00C8 */ std::string title; - /* 00E0 */ ItemInfo item; + /* 00E0 */ ITEM_INFO item; /* 01DC */ std::string description; /* 01F4 */ std::string notice; /* 020C */ std::uint32_t noticeTick; diff --git a/Source/UI/UIStaticItem.h b/Source/UI/UIStaticItem.h index d8b713fb..63ec2084 100644 --- a/Source/UI/UIStaticItem.h +++ b/Source/UI/UIStaticItem.h @@ -12,7 +12,7 @@ public: void Slot28(int x, int y) override; protected: - /* 0080 */ ItemInfo m_item; + /* 0080 */ ITEM_INFO m_item; ItemDescriptions* m_descriptions; UIButtonContext* m_controls; };