Skip to content

Commit

Permalink
Add some methods related to asset view and discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
emd4600 committed Oct 19, 2024
1 parent 2f0e7e9 commit 8498464
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
5 changes: 5 additions & 0 deletions Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
#include <Spore\Simulator\SubSystem\CinematicManager.h>
#include <Spore\Simulator\SubSystem\BundleManager.h>
#include <Spore\Simulator\SubSystem\GamePlantManager.h>
#include <Spore\Simulator\SubSystem\UIAssetDiscoveryManager.h>
#include <Spore\Simulator\NounClassFactories.h>

namespace Addresses(Simulator)
Expand Down Expand Up @@ -1171,6 +1172,10 @@ namespace Simulator
namespace Addresses(cGamePlantManager) {
DefineAddress(Get, SelectAddress(0xB3D310, 0xB3D4B0));
}

namespace Addresses(cUIAssetDiscoveryManager) {
DefineAddress(Get, SelectAddress(0xB3D450, 0xB3D5F0));
}
}

#ifdef SDK_TO_GHIDRA
Expand Down
6 changes: 6 additions & 0 deletions Spore ModAPI/SourceCode/DLL/AddressesUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <Spore\UI\LayerManager.h>
#include <Spore\UI\SpaceGameUI.h>
#include <Spore\UI\HintManager.h>
#include <Spore\UI\cSPAssetView.h>
#include <Spore\UI\ScrollFrameVertical.h>
#include <Spore\UI\cSPUITextZoom.h>
#include <Spore\UI\GameSettings.h>
Expand All @@ -16,6 +17,11 @@ namespace UI
DefineAddress(Get, SelectAddress(0x67CC20, 0x67CA90));
}

namespace Addresses(cSPAssetView) {
DefineAddress(_ctor, SelectAddress(0x657DA0, 0x657F30));
DefineAddress(sub_6590A0, SelectAddress(0x6590A0, 0x659230));
}

namespace Addresses(SpaceGameUI)
{
DefineAddress(Load, SelectAddress(0x10743F0, 0x1073730));
Expand Down
5 changes: 5 additions & 0 deletions Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <Spore\Simulator\cIdentityColorable.h>
#include <Spore\Simulator\SubSystem\GamePersistenceManager.h>
#include <Spore\Simulator\SubSystem\BundleManager.h>
#include <Spore\Simulator\SubSystem\UIAssetDiscoveryManager.h>
#include <Spore\Simulator\SubSystem\CinematicManager.h>
#include <Spore\Simulator\SubSystem\GamePlantManager.h>
#include <Spore\Simulator\cDefaultToolProjectile.h>
Expand Down Expand Up @@ -224,6 +225,10 @@ namespace Simulator
/// GamePlantManager ///

auto_STATIC_METHOD_(cGamePlantManager, cGamePlantManager*, Get);

/// UIAssetDiscoveryManager ///

auto_STATIC_METHOD_(cUIAssetDiscoveryManager, cUIAssetDiscoveryManager*, Get);
}

#endif
5 changes: 3 additions & 2 deletions Spore ModAPI/SourceCode/UI/UI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ namespace UI


cSPAssetView::cSPAssetView() {
//CALL(GetAddress(cSPAssetView, _ctor), void, Args(cSPAssetView*), Args(this));
CALL(Address(0x657DA0), void, Args(cSPAssetView*), Args(this));
CALL(GetAddress(cSPAssetView, _ctor), void, Args(cSPAssetView*), Args(this));
}
// Leave empty implementations for everything, as these methods are never called
// We sue Spore's vftable by calling the original constructor
Expand Down Expand Up @@ -89,6 +88,8 @@ namespace UI
void cSPAssetView::SetVisible(bool visible) {
}

auto_METHOD_(cSPAssetView, bool, sub_6590A0);

AssetDiscoveryCard::AssetDiscoveryCard()
: mLayout()
, mAssetData()
Expand Down
10 changes: 5 additions & 5 deletions Spore ModAPI/Spore/Simulator/SubSystem/UIAssetDiscoveryManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <Spore\UI\AssetDiscoveryCard.h>
#include <EASTL\deque.h>

//#define UIAssetDiscoveryManager (*Simulator::cUIAssetDiscoveryManager::Get())
#define UIAssetDiscoveryManager (*Simulator::cUIAssetDiscoveryManager::Get())

namespace Simulator
{
Expand All @@ -14,7 +14,7 @@ namespace Simulator
, public App::IMessageListener
{
public:
//static cUIAssetDiscoveryManager* Get();
static cUIAssetDiscoveryManager* Get();

public:
/* 20h */ int field_20;
Expand All @@ -23,7 +23,7 @@ namespace Simulator
};
ASSERT_SIZE(cUIAssetDiscoveryManager, 0xA8);

//namespace Addresses(cUIAssetDiscoveryManager) {
// DeclareAddress(Get); // 0xB3D450 TODO
//}
namespace Addresses(cUIAssetDiscoveryManager) {
DeclareAddress(Get); // 0xB3D450 0xB3D5F0
}
}
5 changes: 4 additions & 1 deletion Spore ModAPI/Spore/UI/cSPAssetView.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ namespace UI
/* 24h */ virtual void func24h(int, int);
/* 28h */ virtual void SetVisible(bool visible);

bool sub_6590A0();

public:
/* 0Ch */ char padding_C[0x108 - 0xC];
};
ASSERT_SIZE(cSPAssetView, 0x108);

namespace Addresses(cSPAssetView) {
DeclareAddress(_ctor); // 0x657DA0 TODO
DeclareAddress(_ctor); // 0x657DA0 0x657F30
DeclareAddress(sub_6590A0); // 0x6590A0 0x659230
}
}

0 comments on commit 8498464

Please sign in to comment.