mirror of https://github.com/zeldaret/botw.git
Add PauseMenuDataMgr::grabbedItemStuff() (#88)
This commit is contained in:
parent
17750b5225
commit
a564186002
|
@ -46778,7 +46778,7 @@ Address,Quality,Size,Name
|
|||
0x000000710073bd34,U,000032,masterSwordBroken
|
||||
0x000000710073bd54,U,000412,aiActionEventPickOutFromPorch
|
||||
0x000000710073bef0,U,001732,dropActorFromPorchCalculateMtx
|
||||
0x000000710073c5b4,U,000732,pauseMenuDataMgrDropItemStuff
|
||||
0x000000710073c5b4,U,000732,spawnDroppedInventoryItem
|
||||
0x000000710073c890,U,000292,
|
||||
0x000000710073c9b4,U,000600,createActorPickOutFromPorch
|
||||
0x000000710073cc0c,U,000336,requestCreateWeaponByRawLife
|
||||
|
@ -56332,7 +56332,7 @@ Address,Quality,Size,Name
|
|||
0x000000710096ba00,O,001060,_ZN5uking2ui16PauseMenuDataMgr14initForNewSaveEv
|
||||
0x000000710096be24,O,000492,_ZN5uking2ui16PauseMenuDataMgr16loadFromGameDataEv
|
||||
0x000000710096c010,O,002372,_ZN5uking2ui16PauseMenuDataMgr18doLoadFromGameDataEv
|
||||
0x000000710096c954,U,003544,PauseMenuDataMgr::updateInventoryCategories
|
||||
0x000000710096c954,U,003544,PauseMenuDataMgr::updateInventoryInfo
|
||||
0x000000710096d72c,O,001288,_ZNK5uking2ui16PauseMenuDataMgr13cannotGetItemERKN4sead14SafeStringBaseIcEEi
|
||||
0x000000710096dc34,O,002004,_ZN5uking2ui16PauseMenuDataMgr7getTypeERKN4sead14SafeStringBaseIcEEPN2al9ByamlIterE
|
||||
0x000000710096e408,O,001028,_ZNK5uking2ui16PauseMenuDataMgr19hasFreeSpaceForItemERKNS1_5ListsERKN4sead14SafeStringBaseIcEEi
|
||||
|
@ -56434,7 +56434,7 @@ Address,Quality,Size,Name
|
|||
0x000000710097d250,U,000244,PauseMenuDataMgr::shopStuff_0
|
||||
0x000000710097d344,O,000232,_ZNK5uking2ui16PauseMenuDataMgr10hasItemDyeEv
|
||||
0x000000710097d42c,O,000204,_ZNK5uking2ui16PauseMenuDataMgr10hasItemDyeEi
|
||||
0x000000710097d4f8,U,000676,PauseMenuDataMgr::grabbedItemStuff
|
||||
0x000000710097d4f8,O,000676,_ZN5uking2ui16PauseMenuDataMgr16grabbedItemStuffEPNS0_9PouchItemE
|
||||
0x000000710097d79c,U,000640,PauseMenuDataMgr::dyeGoodsStuff
|
||||
0x000000710097da1c,O,000076,_ZNK5uking2ui16PauseMenuDataMgr16getLastAddedItemEv
|
||||
0x000000710097da68,O,000188,_ZN5uking2ui16PauseMenuDataMgr23updateEquippedItemArrayEv
|
||||
|
|
Can't render this file because it is too large.
|
|
@ -5,6 +5,8 @@ add_subdirectory(DLC)
|
|||
add_subdirectory(UI)
|
||||
|
||||
target_sources(uking PRIVATE
|
||||
gameItemUtils.cpp
|
||||
gameItemUtils.h
|
||||
gameScene.cpp
|
||||
gameScene.h
|
||||
gameStageInfo.cpp
|
||||
|
|
|
@ -7,9 +7,11 @@
|
|||
#include "Game/Actor/actWeapon.h"
|
||||
#include "Game/DLC/aocManager.h"
|
||||
#include "Game/UI/uiUtils.h"
|
||||
#include "Game/gameItemUtils.h"
|
||||
#include "Game/gameScene.h"
|
||||
#include "KingSystem/ActorSystem/Profiles/actPlayerBase.h"
|
||||
#include "KingSystem/ActorSystem/actActorConstDataAccess.h"
|
||||
#include "KingSystem/ActorSystem/actActorHeapUtil.h"
|
||||
#include "KingSystem/ActorSystem/actActorUtil.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcLink.h"
|
||||
#include "KingSystem/ActorSystem/actInfoCommon.h"
|
||||
|
@ -2782,4 +2784,38 @@ bool PauseMenuDataMgr::useItemFromRecipeAndSave(void* unk, int multiplier, Pouch
|
|||
return true;
|
||||
}
|
||||
|
||||
void PauseMenuDataMgr::grabbedItemStuff(PouchItem* item) {
|
||||
auto lock = sead::makeScopedLock(mCritSection);
|
||||
|
||||
for (auto& cur : mItemLists.list1) {
|
||||
if (&cur == item && item->mType == PouchItemType::Material) {
|
||||
if (item->mValue > 1) {
|
||||
item->mValue -= 1;
|
||||
} else {
|
||||
item->mEquipped = false;
|
||||
item->mValue = 0;
|
||||
}
|
||||
|
||||
for (auto& info : mGrabbedItems) {
|
||||
if (info.item) {
|
||||
if (info.item == item) {
|
||||
info._9 = true;
|
||||
}
|
||||
} else {
|
||||
info.item = item;
|
||||
info._8 = true;
|
||||
info._9 = false;
|
||||
spawnDroppedInventoryItem(
|
||||
item->getName().cstr(),
|
||||
ksys::act::ActorHeapUtil::instance()->getBaseProcHeap(), -1,
|
||||
SleepAfterInit::No, nullptr, SpawnViaCarryBox::Yes, 0.8, -0.8);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
updateInventoryInfo(mItemLists.list1);
|
||||
saveToGameData(mItemLists.list1);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace uking::ui
|
||||
|
|
|
@ -370,6 +370,8 @@ public:
|
|||
// FIXME: types
|
||||
bool useItemFromRecipeAndSave(void* unk, int multiplier, PouchItem* item);
|
||||
|
||||
void grabbedItemStuff(PouchItem* item);
|
||||
|
||||
private:
|
||||
// TODO: rename
|
||||
struct GrabbedItemInfo {
|
||||
|
@ -449,6 +451,7 @@ private:
|
|||
|
||||
void doLoadFromGameData();
|
||||
|
||||
// 710096c954
|
||||
void updateInventoryInfo(const sead::OffsetList<PouchItem>& list);
|
||||
void updateListHeads();
|
||||
void saveToGameData(const sead::OffsetList<PouchItem>& list) const;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
#include "Game/gameItemUtils.h"
|
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
namespace sead {
|
||||
class Heap;
|
||||
} // namespace sead
|
||||
namespace uking::act {
|
||||
struct WeaponModifierInfo;
|
||||
} // namespace uking::act
|
||||
|
||||
namespace uking {
|
||||
|
||||
enum class SleepAfterInit : bool {
|
||||
Yes = true,
|
||||
No = false,
|
||||
};
|
||||
|
||||
enum class SpawnViaCarryBox : bool {
|
||||
Yes = true,
|
||||
No = false,
|
||||
};
|
||||
|
||||
// 710073c5b4
|
||||
void spawnDroppedInventoryItem(const char* name, sead::Heap* heap, int life,
|
||||
SleepAfterInit sleep_after_init,
|
||||
const uking::act::WeaponModifierInfo* weapon_modifiers,
|
||||
SpawnViaCarryBox spawn_via_carry_box, float rotate_y,
|
||||
float rotate_z);
|
||||
} // namespace uking
|
Loading…
Reference in New Issue