-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdllmain.cpp
151 lines (126 loc) · 4.94 KB
/
dllmain.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include "Spore/Simulator/SubSystem/SpaceTrading.h"
#include <Spore/Simulator/cToolStrategy.h>
#include "MiningBeam.h"
#include "Fabricator.h"
#include "FabricatorSystem.h"
#include "MiningScanner.h"
#include "InjectCategories.h"
#include "ScanMenu.h"
#include <Spore/Simulator/cDefaultBeamTool.h>
#include "ViewCrafts.h"
#include "DestroySave.h"
#include "FactoryManager.h"
#include "DrillBuilding.h"
#include "PlaceDrill.h"
#include "SkondEmpire.h"
#include "SpawnBee.h"
#include "SpawnStation.h"
#include "ReadPlanet.h"
#include "SolarSystemResources.h"
#include "SolarSystemResourceEntry.h"
#include "SolSysResourcesCheat.h"
// This is in dllmain.cpp
using namespace ArgScript;
void Initialize() {
//Inject Categories in the Space Stage Tool Menu.
InjectCategories::InjectHeader();
InjectCategories::InjectCategory(u"AssetBrowserFeedItems!rspore_core.prop");
App::ConsolePrintF("''We are Skond. We see you.''");
App::ConsolePrintF("RattlerSPORE: Core Enabled");
//May seem pointless but this is for copy and pasting config and stuff.
if (PropManager.HasPropertyList(id("grindytools"), id("rattlerConfig")))
{
App::ConsolePrintF("RattlerSPORE: Grindy Tool Recipes Addon Enabled");
InjectCategories::InjectCategory(u"AssetBrowserFeedItems!rspore_grindytools.prop");
}
if (PropManager.HasPropertyList(id("normaltools"), id("rattlerConfig")))
{
App::ConsolePrintF("RattlerSPORE: Normal Tool Recipes Addon Enabled");
InjectCategories::InjectCategory(u"AssetBrowserFeedItems!rspore_normaltools.prop");
}
if (PropManager.HasPropertyList(id("casualtools"), id("rattlerConfig")))
{
App::ConsolePrintF("RattlerSPORE: Casual Tool Recipes Addon Enabled");
InjectCategories::InjectCategory(u"AssetBrowserFeedItems!rspore_casualtools.prop");
}
if (PropManager.HasPropertyList(id("creativeTools"), id("rattlerConfig")))
{
App::ConsolePrintF("RattlerSPORE: Creative Recipes Addon Enabled");
InjectCategories::InjectCategory(u"AssetBrowserFeedItems!rspore_creativetools.prop");
}
//Core Wares
if (PropManager.HasPropertyList(id("wares"), id("rattlerConfig")))
{
App::ConsolePrintF("RattlerSPORE: Core Wares Enabled");
InjectCategories::InjectCategory(u"AssetBrowserFeedItems!rspore_wares.prop");
}
//Core Industry
if (PropManager.HasPropertyList(id("industry"), id("rattlerConfig")))
{
App::ConsolePrintF("RattlerSPORE: Core Industry Enabled");
InjectCategories::InjectCategory(u"AssetBrowserFeedItems!rspore_industry.prop");
ClassManager.AddFactory(new DrillBuildingFactory());
ToolManager.AddStrategy(new PlaceDrill(), id("placedrill"));
//SimulatorSystem.AddStrategy(new FactoryManager(), FactoryManager::NOUN_ID);
SimulatorSystem.AddStrategy(new SolarSystemResources(), SolarSystemResources::NOUN_ID);
}
//Spice Dyeing Addon
if (PropManager.HasPropertyList(id("spicedye"), id("rattlerConfig")))
{
App::ConsolePrintF("RattlerSPORE: Spice Dyeing Addon Enabled");
InjectCategories::InjectCategory(u"AssetBrowserFeedItems!rspore_dye.prop");
}
SimulatorSystem.AddStrategy(new SkondEmpire(), SkondEmpire::NOUN_ID);
//Add the New Core Tools
ToolManager.AddStrategy(new MiningBeam(1), id("mining_beam1"));
ToolManager.AddStrategy(new MiningScanner(1), id("mineral_scanner1"));
ToolManager.AddStrategy(new MiningBeam(2), id("mining_beam2"));
ToolManager.AddStrategy(new MiningScanner(2), id("mineral_scanner2"));
ToolManager.AddStrategy(new MiningBeam(3), id("mining_beam3"));
ToolManager.AddStrategy(new MiningScanner(3), id("mineral_scanner3"));
ToolManager.AddStrategy(new Fabricator(), id("rattler_forge"));
//Add The New Systems
SimulatorSystem.AddStrategy(new FabricatorSystem(), FabricatorSystem::NOUN_ID);
SimulatorSystem.AddStrategy(new ScanMenu(), ScanMenu::NOUN_ID);
SimulatorSystem.AddStrategy(new AchievementSystem(), AchievementSystem::NOUN_ID);
//Add New Cheats.
CheatManager.AddCheat("viewCrafts", new ViewCrafts());
CheatManager.AddCheat("SpawnStation", new SpawnStation());
CheatManager.AddCheat("ReadPlanet", new ReadPlanet());
CheatManager.AddCheat("SpawnBee", new SpawnBee());
CheatManager.AddCheat("roomroot", new DestroySave());
CheatManager.AddCheat("doSys", new SolSysResourcesCheat());
}
void Dispose()
{
// This method is called when the game is closing
}
void AttachDetours()
{
// Call the attach() method on any detours you want to add
// For example: cViewer_SetRenderType_detour::attach(GetAddress(cViewer, SetRenderType));
}
// Generally, you don't need to touch any code here
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
ModAPI::AddPostInitFunction(Initialize);
ModAPI::AddDisposeFunction(Dispose);
PrepareDetours(hModule);
AttachDetours();
CommitDetours();
break;
case DLL_PROCESS_DETACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}