Skip to content

Commit 5c09b0a

Browse files
committed
- Add UI::SimulatorRollover class, with GetRolloverIdForObject() and ShowRollover() static methods
- Fix wrong fields in cTribeTool - Fix compile error in cGameBundle
1 parent 1ab821c commit 5c09b0a

6 files changed

Lines changed: 143 additions & 9 deletions

File tree

Spore ModAPI/SourceCode/DLL/AddressesUI.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <Spore\UI\cSPUITextZoom.h>
88
#include <Spore\UI\GameSettings.h>
99
#include <Spore\UI\EditorNamePanel.h>
10+
#include <Spore\UI\SimulatorRollovers.h>
1011

1112
namespace UI
1213
{
@@ -52,5 +53,11 @@ namespace UI
5253
DefineAddress(SetExtended, SelectAddress(0x5C02A0, 0x5C0470));
5354
DefineAddress(HandleMessage, SelectAddress(0x5BF900, 0x5BFAD0));
5455
}
56+
57+
namespace Addresses(SimulatorRollover)
58+
{
59+
DefineAddress(GetRolloverIdForObject, SelectAddress(0xB67960, 0xB67D70));
60+
DefineAddress(ShowRollover, SelectAddress(0xB68790, 0xB68BA0));
61+
}
5562
}
5663
#endif

Spore ModAPI/SourceCode/UI/UI.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <Spore\UI\EditorNamePanel.h>
44
#include <Spore\UI\cSPAssetView.h>
55
#include <Spore\UI\AssetDiscoveryCard.h>
6+
#include <Spore\UI\SimulatorRollovers.h>
67

78
namespace UI
89
{
@@ -96,5 +97,12 @@ namespace UI
9697
, mAssetWindow()
9798
{
9899
}
100+
101+
102+
auto_STATIC_METHOD(SimulatorRollover, SimulatorRolloverID, GetRolloverIdForObject,
103+
Args(Simulator::cGameData* object), Args(object));
104+
105+
auto_STATIC_METHOD(SimulatorRollover, SimulatorRollover*, ShowRollover,
106+
Args(SimulatorRolloverID rolloverId), Args(rolloverId));
99107
}
100108
#endif

Spore ModAPI/Spore/Simulator/cGameBundleContainer.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@
2828

2929
namespace Simulator
3030
{
31-
#ifdef SDK_TO_GHIDRA
32-
class cGameBundle
33-
{
34-
int todo;
35-
};
36-
#else
37-
class cGameBundle; //TODO
38-
#endif
39-
4031
class cGameBundleContainer;
4132

4233
class cGameBundle
@@ -48,6 +39,10 @@ namespace Simulator
4839
static const uint32_t TYPE = 0x4FFCDEDA;
4940
static const uint32_t NOUN_ID = 0x18C431C;
5041

42+
using Object::AddRef;
43+
using Object::Release;
44+
using Object::Cast;
45+
5146
public:
5247
/* 120h */ int field_120;
5348
/* 124h */ bool mLoose;

Spore ModAPI/Spore/Simulator/cTribeTool.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <Spore\Simulator\cBehaviorList.h>
66
#include <Spore\Simulator\cCombatant.h>
77
#include <Spore\Simulator\cTribeToolData.h>
8+
#include <Spore\Simulator\cPlaceableStructure.h>
89

910
#define cTribeToolPtr eastl::intrusive_ptr<Simulator::cTribeTool>
1011

@@ -17,6 +18,7 @@ namespace Simulator
1718
/* 34h */ , public cSpatialObject
1819
/* 108h */ , public cBehaviorList
1920
/* 120h */ , public cCombatant
21+
/* 1E8h */ , public cPlaceableStructure
2022
{
2123
public:
2224
static const uint32_t TYPE = 0x116D858;
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#pragma once
2+
3+
#include <Spore\UTFWin\UILayout.h>
4+
#include <Spore\Simulator\cObjectPool.h>
5+
#include <Spore\Simulator\cGameData.h>
6+
7+
namespace UI
8+
{
9+
enum class SimulatorRolloverID
10+
{
11+
12+
/// Rollover_TribeTool
13+
TribeTool = 2,
14+
/// Rollover_TribeCitizen
15+
TribeCitizen = 3,
16+
/// Rollover_TribeHut
17+
TribeHut = 4,
18+
/// Rollover_Tribe_Minimap
19+
TribeMinimap = 5,
20+
/// Rollover_ScenarioVehicle or Rollover_CivVehicle
21+
Vehicle = 6,
22+
/// RolloverCity_Minimap
23+
SpaceMinimap = 7,
24+
/// SharedHealthBar, or RolloverSpaceCity in Space stage
25+
HealthBar = 8,
26+
/// Rollover_Building
27+
Building = 9,
28+
/// SharedHealthBar
29+
SharedHealthBar = 10,
30+
/// RolloverUFO
31+
UFO = 11,
32+
/// Rollover_Creature
33+
Creature = 12,
34+
/// SharedHealthBar
35+
SharedHealthBar2 = 13,
36+
/// Rollover_CRGMinimap
37+
CreatureMinimap = 14,
38+
/// SharedHealthBar
39+
SharedHealthBar3 = 15,
40+
/// Rollover_FixedObject
41+
FixedObject = 16,
42+
};
43+
44+
class SimulatorRollover
45+
: public Simulator::cObjectPoolClass
46+
{
47+
public:
48+
/// Returns which kind of rollover must be shown for a certain Simulator object.
49+
/// @param object
50+
/// @returns
51+
static SimulatorRolloverID GetRolloverIdForObject(Simulator::cGameData* object);
52+
53+
static SimulatorRollover* ShowRollover(SimulatorRolloverID rolloverId);
54+
55+
public:
56+
/* 04h */ cGameDataPtr mpObject;
57+
/* 08h */ char padding_8[0x50 - 8];
58+
/* 50h */ UILayoutPtr mpLayout;
59+
/// Control ID 0x93310E4A
60+
/* 54h */ IWindowPtr mpMainWindow;
61+
/// Control ID 0x93310E4B
62+
/* 58h */ IWindowPtr mpFrameWindow;
63+
/// Control ID 0x31E94D0
64+
/* 5Ch */ IWindowPtr field_5C;
65+
/// Control ID 0x933103EA
66+
/* 60h */ IWindowPtr field_60;
67+
/// Control ID 0x26E0DF0
68+
/* 64h */ IWindowPtr field_64;
69+
/// Control ID 0x26E0DF1
70+
/* 68h */ IWindowPtr field_68;
71+
/// Control ID 0x26E0DF2
72+
/* 6Ch */ IWindowPtr field_6C;
73+
/// Control ID 0x26E0DF3
74+
/* 70h */ IWindowPtr field_70;
75+
/// Control ID 0x4D039A8
76+
/* 74h */ IWindowPtr field_74;
77+
/// Control ID 0x4B47745
78+
/* 78h */ IWindowPtr field_78;
79+
/// Control ID 0x553E937
80+
/* 7Ch */ IWindowPtr field_7C;
81+
/// Control ID 0x553EA66
82+
/* 80h */ ObjectPtr field_80;
83+
/// Control ID 0x553E92B
84+
/* 84h */ IWindowPtr field_84;
85+
/// Control ID 0x553EA6E
86+
/* 88h */ IWindowPtr field_88;
87+
/// Control ID 0x657C8F8
88+
/* 8Ch */ IWindowPtr field_8C;
89+
/// Control ID 0x46ADF86
90+
/* 90h */ ObjectPtr field_90; // SporeAnimatedIconWin
91+
/// Control ID 0x26E0001
92+
/* 94h */ ObjectPtr field_94;
93+
/// Control ID 0x26E0003
94+
/* 98h */ ObjectPtr field_98;
95+
/// Control ID 0x26E0001
96+
/* 9Ch */ ObjectPtr field_9C;
97+
/// Control ID 0x542EFB0
98+
/* A0h */ IWindowPtr field_A0;
99+
/// Control ID 0x542EFB0
100+
/* A4h */ ObjectPtr field_A4;
101+
/// Control ID 0x199A7D2
102+
/* A8h */ IWindowPtr field_A8;
103+
/// Control ID 0x41F852D
104+
/* ACh */ IWindowPtr field_AC;
105+
/// Control ID 0x5E62810
106+
/* B0h */ ObjectPtr field_B0;
107+
/// Control ID 0x6303998
108+
/* B4h */ ObjectPtr field_B4;
109+
/* B8h */ char padding_B8[0x130 - 0xB8];
110+
};
111+
ASSERT_SIZE(SimulatorRollover, 0x130);
112+
113+
namespace Addresses(SimulatorRollover)
114+
{
115+
DeclareAddress(GetRolloverIdForObject); // 0xB67960 0xB67D70
116+
DeclareAddress(ShowRollover); // 0xB68790 0xB68BA0
117+
}
118+
}

Spore ModAPI/Spore/UserInterface.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
#include <Spore\UTFWin\CursorManager.h>
4040
#include <Spore\UTFWin\SporeTooltipWinProc.h>
4141
#include <Spore\UI\cSPAssetView.h>
42+
#include <Spore\UI\SpaceGameUI.h>
43+
#include <Spore\UI\GlobalUI.h>
44+
#include <Spore\UI\HintManager.h>
45+
#include <Spore\UI\SimulatorRollovers.h>
4246

4347
///
4448
/// @namespace UTFWin

0 commit comments

Comments
 (0)