mirror of https://github.com/zeldaret/botw.git
Merge 262670b605
into 5dda15014c
This commit is contained in:
commit
939a9af370
|
@ -56423,10 +56423,10 @@ Address,Quality,Size,Name
|
|||
0x0000007100975654,O,000872,_ZN5uking2ui16PauseMenuDataMgr17initPouchForQuestEv
|
||||
0x00000071009759bc,O,000408,_ZN5uking2ui16PauseMenuDataMgr20restorePouchForQuestEv
|
||||
0x0000007100975b54,O,001876,_ZN5uking2ui10getItemUseERKN4sead14SafeStringBaseIcEE
|
||||
0x00000071009762a8,U,000504,PauseMenuDataMgr::x_19
|
||||
0x00000071009762a8,O,000504,_ZN5uking2ui16PauseMenuDataMgr16equipFromTabSlotEii
|
||||
0x00000071009764a0,U,000568,PauseMenuDataMgr::x_20
|
||||
0x00000071009766d8,U,001516,PauseMenuDataMgr::holdOrTrashItem
|
||||
0x0000007100976cc4,U,001124,PauseMenuDataMgr::useMaybe
|
||||
0x0000007100976cc4,W,001124,_ZN5uking2ui16PauseMenuDataMgr8useMaybeEiii
|
||||
0x0000007100977128,U,000868,PauseMenuDataMgr::x_3
|
||||
0x000000710097748c,O,000628,_ZN5uking2ui16PauseMenuDataMgr9sortItemsENS0_13PouchCategoryEb
|
||||
0x0000007100977700,O,000248,_ZN5uking2ui22pouchItemSortPredicateEPKNS0_9PouchItemES3_
|
||||
|
@ -56441,11 +56441,11 @@ Address,Quality,Size,Name
|
|||
0x00000071009782f0,O,000664,_ZN5uking2uiL15doCompareShieldEPKNS0_9PouchItemES3_PN4ksys3act8InfoDataE
|
||||
0x0000007100978588,O,000480,_ZN5uking2ui16getCookItemOrderEPKNS0_9PouchItemEPN4ksys3act8InfoDataE
|
||||
0x0000007100978768,O,000304,_ZN5uking2ui30pouchItemSortPredicateForArrowEPKNS0_9PouchItemES3_
|
||||
0x0000007100978898,U,000440,PauseMenuDataMgr::x_22
|
||||
0x0000007100978a50,U,000488,PauseMenuDataMgr::x_23
|
||||
0x0000007100978c38,U,000488,PauseMenuDataMgr::x_24
|
||||
0x0000007100978898,O,000440,_ZNK5uking2ui16PauseMenuDataMgr18getNameFromTabSlotEii
|
||||
0x0000007100978a50,O,000488,_ZNK5uking2ui16PauseMenuDataMgr24isInInventoryFromTabSlotEii
|
||||
0x0000007100978c38,O,000488,_ZNK5uking2ui16PauseMenuDataMgr21isEquippedFromTabSlotEii
|
||||
0x0000007100978e20,U,000548,PauseMenuDataMgr::x_25
|
||||
0x0000007100979044,U,000480,PauseMenuDataMgr::__auto8
|
||||
0x0000007100979044,O,000480,_ZNK5uking2ui16PauseMenuDataMgr23getPouchItemFromTabSlotEii
|
||||
0x0000007100979224,m,000208,_ZNK5uking2ui16PauseMenuDataMgr19getEquippedItemNameENS0_13PouchItemTypeE
|
||||
0x00000071009792f4,O,000212,_ZNK5uking2ui16PauseMenuDataMgr15getEquippedItemENS0_13PouchItemTypeE
|
||||
0x00000071009793c8,O,000588,_ZNK5uking2ui16PauseMenuDataMgr12getItemValueERKN4sead14SafeStringBaseIcEE
|
||||
|
@ -56456,7 +56456,7 @@ Address,Quality,Size,Name
|
|||
0x000000710097a438,O,000196,_ZNK5uking2ui16PauseMenuDataMgr13countArmorDyeEv
|
||||
0x000000710097a4fc,O,000204,_ZNK5uking2ui16PauseMenuDataMgr21countAlreadyDyedArmorEv
|
||||
0x000000710097a5c8,U,000516,PauseMenuDataMgr::armorShopStuff
|
||||
0x000000710097a7cc,U,000376,PauseMenuDataMgr::x_31
|
||||
0x000000710097a7cc,O,000376,_ZNK5uking2ui16PauseMenuDataMgr17getWeaponsForDpadEPN4sead9SafeArrayIPNS0_9PouchItemELi20EEENS0_13PouchItemTypeE
|
||||
0x000000710097a944,O,000184,_ZN5uking2ui16PauseMenuDataMgr11equipWeaponEPNS0_9PouchItemE
|
||||
0x000000710097a9fc,O,000092,_ZN5uking2ui16PauseMenuDataMgr7unequipEPNS0_9PouchItemE
|
||||
0x000000710097aa58,O,000124,_ZNK5uking2ui16PauseMenuDataMgr23getNextGrabbedItemIndexEv
|
||||
|
@ -56471,12 +56471,12 @@ Address,Quality,Size,Name
|
|||
0x000000710097c094,O,000060,_ZNK5uking2ui16PauseMenuDataMgr16hasGoronSoulPlusEv
|
||||
0x000000710097c0d0,O,000060,_ZNK5uking2ui16PauseMenuDataMgr17hasGerudoSoulPlusEv
|
||||
0x000000710097c10c,O,000060,_ZNK5uking2ui16PauseMenuDataMgr15hasZoraSoulPlusEv
|
||||
0x000000710097c148,U,000140,PauseMenuDataMgr::x_36
|
||||
0x000000710097c148,O,000140,_ZN5uking2ui16PauseMenuDataMgr14getTabCategoryEi
|
||||
0x000000710097c1d4,U,001500,PauseMenuDataMgr::x_37
|
||||
0x000000710097c7b0,U,000700,PauseMenuDataMgr::x_38
|
||||
0x000000710097ca6c,O,000916,_ZNK5uking2ui16PauseMenuDataMgr28countItemsWithCategoryByTypeENS0_13PouchCategoryE
|
||||
0x000000710097ce00,O,001104,_ZNK5uking2ui16PauseMenuDataMgr14getItemByIndexENS0_13PouchCategoryEi
|
||||
0x000000710097d250,U,000244,PauseMenuDataMgr::shopStuff_0
|
||||
0x000000710097d250,O,000244,_ZN5uking2ui16PauseMenuDataMgr8sellItemEPNS0_9PouchItemEi
|
||||
0x000000710097d344,O,000232,_ZNK5uking2ui16PauseMenuDataMgr10hasItemDyeEv
|
||||
0x000000710097d42c,O,000204,_ZNK5uking2ui16PauseMenuDataMgr10hasItemDyeEi
|
||||
0x000000710097d4f8,O,000676,_ZN5uking2ui16PauseMenuDataMgr16grabbedItemStuffEPNS0_9PouchItemE
|
||||
|
@ -56493,7 +56493,7 @@ Address,Quality,Size,Name
|
|||
0x00000071009800f8,M,000612,_ZN5uking2ui9PouchItem15sortIngredientsEv
|
||||
0x000000710098035c,O,000220,_ZN5uking2ui16PauseMenuDataMgr27updateDivineBeastClearFlagsEi
|
||||
0x0000007100980438,O,000004,_ZN5uking2ui9PouchItemD0Ev
|
||||
0x000000710098043c,U,000648,sead::OffsetList_PouchItem::mergeSort
|
||||
0x000000710098043c,U,000648,_ZN4sead8ListImpl14mergeSortImpl_EPNS_8ListNodeES2_iiPPFiPKvS4_E
|
||||
0x00000071009806c4,U,000100,UiShopMgr::Disposer::dtor
|
||||
0x0000007100980728,U,000108,UiShopMgr::Disposer::dtorDelete
|
||||
0x0000007100980794,U,000380,UiShopMgr::createInstance
|
||||
|
|
Can't render this file because it is too large.
|
|
@ -1,8 +1,5 @@
|
|||
#include "Game/UI/uiPauseMenuDataMgr.h"
|
||||
#include <algorithm>
|
||||
#include <container/seadBuffer.h>
|
||||
#include <limits>
|
||||
#include <math/seadMathCalcCommon.h>
|
||||
#include <prim/seadScopedLock.h>
|
||||
#include "Game/Actor/actPlayerCreateMgr.h"
|
||||
#include "Game/Actor/actPlayerCreateUtils.h"
|
||||
|
@ -102,11 +99,8 @@ struct PouchStaticData {
|
|||
sead::SafeString Obj_DLC_HeroSoul_Gerudo = "Obj_DLC_HeroSoul_Gerudo";
|
||||
sead::SafeString Obj_WarpDLC = "Obj_WarpDLC";
|
||||
|
||||
sead::SafeString Armor_116_Upper = "Armor_116_Upper";
|
||||
sead::SafeString Armor_148_Upper = "Armor_148_Upper";
|
||||
sead::SafeString Armor_149_Upper = "Armor_149_Upper";
|
||||
sead::SafeString Armor_150_Upper = "Armor_150_Upper";
|
||||
sead::SafeString Armor_151_Upper = "Armor_151_Upper";
|
||||
sead::SafeString champion_tunics[5]{"Armor_116_Upper", "Armor_148_Upper", "Armor_149_Upper",
|
||||
"Armor_150_Upper", "Armor_151_Upper"};
|
||||
|
||||
sead::Buffer<CookTagInfo> cook_item_order{sCookItemOrder_.size(),
|
||||
sCookItemOrder_.getBufferPtr()};
|
||||
|
@ -299,11 +293,11 @@ void PauseMenuDataMgr::initForNewSave() {
|
|||
mIsPouchForQuest = false;
|
||||
for (auto& x : mGrabbedItems)
|
||||
x = {};
|
||||
_44504 = {};
|
||||
_44508 = {};
|
||||
_4450c = {};
|
||||
_44510 = {};
|
||||
_44514 = {};
|
||||
mNumSmallSwords = 0;
|
||||
mNumLargeSwords = 0;
|
||||
mNumSpears = 0;
|
||||
mNumShields = 0;
|
||||
mNumBows = 0;
|
||||
mRitoSoulItem = {};
|
||||
mGoronSoulItem = {};
|
||||
mZoraSoulItem = {};
|
||||
|
@ -3074,4 +3068,234 @@ void PauseMenuDataMgr::grabbedItemStuff(PouchItem* item) {
|
|||
}
|
||||
}
|
||||
|
||||
// NON_MATCHING: string issue + change name
|
||||
void PauseMenuDataMgr::useMaybe(int tab_index, int slot_index, int quantity) {
|
||||
const auto lock = sead::makeScopedLock(mCritSection);
|
||||
if (tab_index >= NumTabMax) {
|
||||
return;
|
||||
}
|
||||
int count = getNumberOfItemsInTab(tab_index);
|
||||
PouchItem* item = mTabs[tab_index];
|
||||
if (!item || slot_index >= count) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < slot_index; i++) {
|
||||
item = getItems().next(item);
|
||||
}
|
||||
if (item) {
|
||||
ksys::PlayReportMgr::instance()->reportDebug("PouchUse", item->getName());
|
||||
int new_value = item->getValue() - quantity;
|
||||
if (new_value <= 0) {
|
||||
sead::FixedSafeString<64> name = item->getName();
|
||||
bool found = false;
|
||||
for (int i = 0; i < mGrabbedItems.size(); ++i) {
|
||||
auto& item2 = mGrabbedItems[i].item;
|
||||
if (!item2) {
|
||||
continue;
|
||||
}
|
||||
if (item2->getName() == name) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
new_value = 0;
|
||||
item->mInInventory = found;
|
||||
item->mEquipped = false;
|
||||
}
|
||||
item->mValue = new_value;
|
||||
}
|
||||
updateInventoryInfo(getItems());
|
||||
saveToGameData(getItems());
|
||||
}
|
||||
|
||||
PouchCategory PauseMenuDataMgr::getTabCategory(int tab_index) {
|
||||
if (tab_index >= NumTabMax || tab_index > mNumTabs || tab_index < 0) {
|
||||
return PouchCategory::Invalid;
|
||||
}
|
||||
return getCategoryForType(mTabsType[tab_index]);
|
||||
}
|
||||
|
||||
void PauseMenuDataMgr::sellItem(PouchItem* target_item, int quantity) {
|
||||
if (!target_item) {
|
||||
return;
|
||||
}
|
||||
auto lock = sead::makeScopedLock(mCritSection);
|
||||
for (auto& item : getItems()) {
|
||||
if (&item != target_item)
|
||||
continue;
|
||||
if (ksys::act::InfoData::instance()->hasTag(item.getName().cstr(),
|
||||
ksys::act::tags::CanStack)) {
|
||||
int new_value = item.getCount() - quantity;
|
||||
if (new_value <= 0) {
|
||||
item.mValue = 0;
|
||||
item.mInInventory = false;
|
||||
} else {
|
||||
item.mValue = new_value;
|
||||
}
|
||||
} else {
|
||||
item.mInInventory = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int PauseMenuDataMgr::getWeaponsForDpad(
|
||||
sead::SafeArray<PouchItem*, NumItemsPerTabMax>* result_array, PouchItemType target_type) const {
|
||||
if (!result_array) {
|
||||
return 0;
|
||||
}
|
||||
for (int i = 0; i < NumItemsPerTabMax; i++) {
|
||||
(*result_array)[i] = nullptr;
|
||||
}
|
||||
const auto lock = sead::makeScopedLock(mCritSection);
|
||||
const auto& list = getItems();
|
||||
if (list.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
int i = 0;
|
||||
auto* item = list.nth(0);
|
||||
if (target_type != PouchItemType::Arrow) {
|
||||
for (; item && item->isWeapon() && i < NumItemsPerTabMax; item = list.next(item)) {
|
||||
if (item->getType() == target_type &&
|
||||
!(isMasterSwordItem(*item) && item->getValue() <= 0)) {
|
||||
(*result_array)[i] = item;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (; item && item->isWeapon() && i < NumItemsPerTabMax; item = list.next(item)) {
|
||||
if (item->getType() == PouchItemType::Arrow) {
|
||||
(*result_array)[i] = item;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
int PauseMenuDataMgr::getNumberOfItemsInTab(int tab_index) const {
|
||||
PouchItem* first = mTabs[tab_index];
|
||||
auto& items = getItems();
|
||||
if (!first)
|
||||
return 0;
|
||||
|
||||
if (items.isEmpty())
|
||||
return 0;
|
||||
int count = 0;
|
||||
|
||||
auto type = first->getType();
|
||||
if (type == PouchItemType::Bow) {
|
||||
type = PouchItemType::Arrow;
|
||||
} else if (isPouchItemArmor(type)) {
|
||||
type = PouchItemType::ArmorLower;
|
||||
}
|
||||
switch (type) {
|
||||
case PouchItemType::Sword:
|
||||
case PouchItemType::Shield:
|
||||
case PouchItemType::Material:
|
||||
case PouchItemType::Food:
|
||||
case PouchItemType::KeyItem: {
|
||||
for (auto* item = first; item && item->getType() == type;) {
|
||||
count++;
|
||||
item = items.next(item);
|
||||
if (count >= NumItemsPerTabMax)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PouchItemType::Arrow:
|
||||
case PouchItemType::ArmorLower: {
|
||||
for (auto* item = first; item && item->getType() <= type;) {
|
||||
count++;
|
||||
item = items.next(item);
|
||||
if (count >= NumItemsPerTabMax)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
PouchItem* PauseMenuDataMgr::getPouchItemFromTabSlot(int tab_index, int slot_index) const {
|
||||
if (tab_index >= NumTabMax) {
|
||||
return nullptr;
|
||||
}
|
||||
int count = getNumberOfItemsInTab(tab_index);
|
||||
PouchItem* item = mTabs[tab_index];
|
||||
if (slot_index >= count || !item) {
|
||||
return nullptr;
|
||||
}
|
||||
for (int i = 0; i < slot_index; i++) {
|
||||
item = nextItem(item);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
const sead::SafeString* PauseMenuDataMgr::getNameFromTabSlot(int tab_index, int slot_index) const {
|
||||
if (tab_index >= NumTabMax) {
|
||||
return nullptr;
|
||||
}
|
||||
int count = getNumberOfItemsInTab(tab_index);
|
||||
PouchItem* item = mTabs[tab_index];
|
||||
if (slot_index >= count || !item) {
|
||||
return nullptr;
|
||||
}
|
||||
for (int i = 0; i < slot_index; i++) {
|
||||
item = nextItem(item);
|
||||
}
|
||||
return item ? &(item->getName()) : nullptr;
|
||||
}
|
||||
|
||||
bool PauseMenuDataMgr::isInInventoryFromTabSlot(int tab_index, int slot_index) const {
|
||||
if (tab_index >= NumTabMax) {
|
||||
return false;
|
||||
}
|
||||
int count = getNumberOfItemsInTab(tab_index);
|
||||
PouchItem* item = mTabs[tab_index];
|
||||
if (!item || slot_index >= count) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < slot_index; i++) {
|
||||
item = nextItem(item);
|
||||
}
|
||||
return item ? item->isInInventory() : false;
|
||||
}
|
||||
|
||||
bool PauseMenuDataMgr::isEquippedFromTabSlot(int tab_index, int slot_index) const {
|
||||
if (tab_index >= NumTabMax) {
|
||||
return false;
|
||||
}
|
||||
int count = getNumberOfItemsInTab(tab_index);
|
||||
PouchItem* item = mTabs[tab_index];
|
||||
if (slot_index >= count || !item) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < slot_index; i++) {
|
||||
item = nextItem(item);
|
||||
}
|
||||
return item ? item->isEquipped() : false;
|
||||
}
|
||||
|
||||
const sead::SafeString* PauseMenuDataMgr::equipFromTabSlot(int tab_index, int slot_index) {
|
||||
const auto lock = sead::makeScopedLock(mCritSection);
|
||||
if (tab_index >= NumTabMax) {
|
||||
return &sead::SafeString::cEmptyString;
|
||||
}
|
||||
int count = getNumberOfItemsInTab(tab_index);
|
||||
PouchItem* item = mTabs[tab_index];
|
||||
if (slot_index >= count || !item) {
|
||||
return &sead::SafeString::cEmptyString;
|
||||
}
|
||||
for (int i = 0; i < slot_index; i++) {
|
||||
item = getItems().next(item);
|
||||
}
|
||||
if (item && item->isInInventory()) {
|
||||
autoEquip(item, getItems());
|
||||
}
|
||||
return &sead::SafeString::cEmptyString;
|
||||
}
|
||||
|
||||
} // namespace uking::ui
|
||||
|
|
|
@ -55,6 +55,7 @@ constexpr int ItemStackSizeMax = 999;
|
|||
// Maximum number of tabs (pages with 20 items) you can have.
|
||||
// Going beyond this limit will glitch the menu.
|
||||
constexpr int NumTabMax = 50;
|
||||
constexpr int NumItemsPerTabMax = 20;
|
||||
|
||||
constexpr int NumGrabbableItems = 5;
|
||||
|
||||
|
@ -240,6 +241,7 @@ public:
|
|||
if (isWeapon())
|
||||
mData.weapon.mModifierValue = value;
|
||||
}
|
||||
void setWeaponModifierInfo(const act::WeaponModifierInfo* info);
|
||||
|
||||
static auto getListNodeOffset() { return offsetof(PouchItem, mListNode); }
|
||||
|
||||
|
@ -393,6 +395,16 @@ public:
|
|||
bool useItemFromRecipeAndSave(void* unk, int multiplier, PouchItem* item);
|
||||
|
||||
void grabbedItemStuff(PouchItem* item);
|
||||
PouchCategory getTabCategory(int tab_index);
|
||||
const sead::SafeString* getNameFromTabSlot(int tab_index, int slot_index) const;
|
||||
PouchItem* getPouchItemFromTabSlot(int tab_index, int slot_index) const;
|
||||
bool isInInventoryFromTabSlot(int tab_index, int slot_index) const;
|
||||
bool isEquippedFromTabSlot(int tab_index, int slot_index) const;
|
||||
const sead::SafeString* equipFromTabSlot(int tab_index, int slot_index);
|
||||
void useMaybe(int tab_index, int slot_index, int quantity);
|
||||
void sellItem(PouchItem* target_item, int quantity);
|
||||
int getWeaponsForDpad(sead::SafeArray<PouchItem*, NumItemsPerTabMax>* result_array,
|
||||
PouchItemType target_type) const;
|
||||
|
||||
private:
|
||||
// TODO: rename
|
||||
|
@ -422,10 +434,9 @@ private:
|
|||
|
||||
PouchItem* pushNewItem() {
|
||||
auto* item = list2.popFront();
|
||||
if (!item) {
|
||||
return nullptr;
|
||||
if (item) {
|
||||
list1.pushBack(item);
|
||||
}
|
||||
list1.pushBack(item);
|
||||
return item;
|
||||
}
|
||||
|
||||
|
@ -507,6 +518,8 @@ private:
|
|||
/// @param num_cleared_beasts The number of divine beasts that have been done.
|
||||
void updateDivineBeastClearFlags(int num_cleared_beasts);
|
||||
|
||||
int getNumberOfItemsInTab(int tab_index) const;
|
||||
|
||||
mutable sead::CriticalSection mCritSection;
|
||||
Lists mItemLists;
|
||||
sead::SafeArray<PouchItem**, NumPouchCategories> mListHeads;
|
||||
|
@ -521,11 +534,11 @@ private:
|
|||
s32 _444f8 = -1;
|
||||
s32 _444fc{};
|
||||
s32 _44500 = -1;
|
||||
u32 _44504{};
|
||||
u32 _44508{};
|
||||
u32 _4450c{};
|
||||
u32 _44510{};
|
||||
u32 _44514{};
|
||||
u32 mNumSmallSwords{};
|
||||
u32 mNumLargeSwords{};
|
||||
u32 mNumSpears{};
|
||||
u32 mNumShields{};
|
||||
u32 mNumBows{};
|
||||
PouchItem* mRitoSoulItem{};
|
||||
PouchItem* mGoronSoulItem{};
|
||||
PouchItem* mZoraSoulItem{};
|
||||
|
|
Loading…
Reference in New Issue