mirror of https://github.com/zeldaret/botw.git
new function in pmdm
This commit is contained in:
parent
f810b758f2
commit
b728be65cf
|
@ -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,_ZN5uking2ui16PauseMenuDataMgr18getNameFromTabSlotEii
|
||||
0x0000007100978a50,O,000488,_ZN5uking2ui16PauseMenuDataMgr24isInInventoryFromTabSlotEii
|
||||
0x0000007100978c38,O,000488,_ZN5uking2ui16PauseMenuDataMgr21isEquippedFromTabSlotEii
|
||||
0x0000007100978e20,U,000548,PauseMenuDataMgr::x_25
|
||||
0x0000007100979044,U,000480,PauseMenuDataMgr::__auto8
|
||||
0x0000007100979044,O,000480,_ZN5uking2ui16PauseMenuDataMgr23getPouchItemFromTabSlotEii
|
||||
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,_ZN5uking2ui16PauseMenuDataMgr17getWeaponsForDpadEPN4sead9SafeArrayIPNS0_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
|
||||
|
|
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/actCreatePlayerEquipActorMgr.h"
|
||||
#include "Game/Actor/actWeapon.h"
|
||||
|
@ -16,6 +13,7 @@
|
|||
#include "KingSystem/ActorSystem/actActorHeapUtil.h"
|
||||
#include "KingSystem/ActorSystem/actActorUtil.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcLink.h"
|
||||
#include "KingSystem/ActorSystem/actGlobalParameter.h"
|
||||
#include "KingSystem/ActorSystem/actInfoCommon.h"
|
||||
#include "KingSystem/ActorSystem/actInfoData.h"
|
||||
#include "KingSystem/ActorSystem/actPlayerInfo.h"
|
||||
|
@ -24,6 +22,7 @@
|
|||
#include "KingSystem/GameData/gdtSpecialFlagNames.h"
|
||||
#include "KingSystem/GameData/gdtSpecialFlags.h"
|
||||
#include "KingSystem/GameData/gdtTriggerParam.h"
|
||||
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectGlobal.h"
|
||||
#include "KingSystem/System/PlayReportMgr.h"
|
||||
#include "KingSystem/Utils/Byaml/Byaml.h"
|
||||
#include "KingSystem/Utils/HeapUtil.h"
|
||||
|
@ -101,11 +100,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()};
|
||||
|
@ -298,11 +294,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 = {};
|
||||
|
@ -1256,8 +1252,8 @@ const sead::SafeString& PauseMenuDataMgr::autoEquip(PouchItem* item,
|
|||
switch (type) {
|
||||
case PouchItemType::Sword:
|
||||
case PouchItemType::Bow:
|
||||
case PouchItemType::Shield:
|
||||
case PouchItemType::Arrow:
|
||||
case PouchItemType::Shield:
|
||||
for (auto& other : list) {
|
||||
if (other.getType() > PouchItemType::Shield)
|
||||
break;
|
||||
|
@ -3073,4 +3069,236 @@ 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());
|
||||
return;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
int PauseMenuDataMgr::getWeaponsForDpad(sead::SafeArray<PouchItem*, 20>* result_array,
|
||||
PouchItemType target_type) {
|
||||
if (!result_array) {
|
||||
return 0;
|
||||
}
|
||||
for (int i = 0; i < 20; 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 < 20; 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 < 20; item = list.next(item)) {
|
||||
if (item->getType() == PouchItemType::Arrow) {
|
||||
(*result_array)[i] = item;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
int PauseMenuDataMgr::getNumberOfItemsInTab(int tab_index) {
|
||||
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 >= SizeTabMax)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PouchItemType::Arrow:
|
||||
case PouchItemType::ArmorLower: {
|
||||
for (auto* item = first; item && item->getType() <= type;) {
|
||||
count++;
|
||||
item = items.next(item);
|
||||
if (count >= SizeTabMax)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
PouchItem* PauseMenuDataMgr::getPouchItemFromTabSlot(int tab_index, int slot_index) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <heap/seadDisposer.h>
|
||||
#include <math/seadVector.h>
|
||||
#include <prim/seadSafeString.h>
|
||||
#include <prim/seadScopedLock.h>
|
||||
#include <prim/seadTypedBitFlag.h>
|
||||
#include <thread/seadCriticalSection.h>
|
||||
#include "Game/Cooking/cookManager.h"
|
||||
|
@ -55,6 +56,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 SizeTabMax = 20;
|
||||
|
||||
constexpr int NumGrabbableItems = 5;
|
||||
|
||||
|
@ -240,6 +242,7 @@ public:
|
|||
if (isWeapon())
|
||||
mData.weapon.mModifierValue = value;
|
||||
}
|
||||
void setWeaponModifierInfo(const act::WeaponModifierInfo* info);
|
||||
|
||||
static auto getListNodeOffset() { return offsetof(PouchItem, mListNode); }
|
||||
|
||||
|
@ -393,6 +396,12 @@ 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);
|
||||
PouchItem* getPouchItemFromTabSlot(int tab_index, int slot_index);
|
||||
bool isInInventoryFromTabSlot(int tab_index, int slot_index);
|
||||
bool isEquippedFromTabSlot(int tab_index, int slot_index);
|
||||
const sead::SafeString* equipFromTabSlot(int tab_index, int slot_index);
|
||||
|
||||
private:
|
||||
// TODO: rename
|
||||
|
@ -422,10 +431,9 @@ private:
|
|||
|
||||
PouchItem* pushNewItem() {
|
||||
auto* item = list2.popFront();
|
||||
if (!item) {
|
||||
return nullptr;
|
||||
if (item) {
|
||||
list1.pushBack(item);
|
||||
}
|
||||
list1.pushBack(item);
|
||||
return item;
|
||||
}
|
||||
|
||||
|
@ -507,6 +515,11 @@ private:
|
|||
/// @param num_cleared_beasts The number of divine beasts that have been done.
|
||||
void updateDivineBeastClearFlags(int num_cleared_beasts);
|
||||
|
||||
void useMaybe(int tab_index, int slot_index, int quantity);
|
||||
void sellItem(PouchItem* target_item, int quantity);
|
||||
int getWeaponsForDpad(sead::SafeArray<PouchItem*, 20>* result_array, PouchItemType target_type);
|
||||
int getNumberOfItemsInTab(int tab_index);
|
||||
|
||||
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