Skip to content

Commit

Permalink
EMERGENCY UPDATE
Browse files Browse the repository at this point in the history
The SDK broke all previous versions of the mod, So I guess I will be releasing v1.1 a little early...
  • Loading branch information
NeDether committed Jan 18, 2024
1 parent bb49a7c commit 1fa25f3
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 26 deletions.
6 changes: 6 additions & 0 deletions FabricatorSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,9 @@ bool FabricatorSystem::ReadRecipes()

bool FabricatorSystem::UseMaterial(uint32_t WareID, int neededAmount)
{//Returns True if Has Material. Returns False if Does not.
if (PropManager.HasPropertyList(id("creativeTools"), id("rattlerConfig"))) {
return true;
}
auto inventory = SimulatorSpaceGame.GetPlayerInventory();
auto X = inventory->IndexOf(Simulator::SpaceInventoryItemType(4), { WareID, 0, 0 });
auto H = inventory->GetItem(X);
Expand Down Expand Up @@ -710,6 +713,9 @@ bool FabricatorSystem::GiveSpice(uint32_t WareID, uint32_t givenAmount)
}
bool FabricatorSystem::HasMaterial(uint32_t WareID, int neededAmount)
{ //Checks if has the materials in the first place before using them up.
if (PropManager.HasPropertyList(id("creativeTools"), id("rattlerConfig"))) {
return true;
}
auto inventory = SimulatorSpaceGame.GetPlayerInventory();
auto X = inventory->IndexOf(Simulator::SpaceInventoryItemType(4), { WareID, 0, 0 });
auto H = inventory->GetItem(X);
Expand Down
22 changes: 11 additions & 11 deletions FactoryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ bool FactoryManager::Read(Simulator::ISerializerStream* stream)
Simulator::Attribute FactoryManager::ATTRIBUTES[] = {
// Add more attributes here
// This one must always be at the end
SimAttribute(FactoryManager,SavedBuildings,1),
//SimAttribute(FactoryManager,SavedBuildings,1),
Simulator::Attribute()
};

Expand All @@ -44,7 +44,7 @@ void FactoryManager::Initialize() {
}

void FactoryManager::Dispose() {

//SavedBuildings.clear();
}

void FactoryManager::Update(int deltaTime, int deltaGameTime) {
Expand All @@ -53,7 +53,7 @@ void FactoryManager::Update(int deltaTime, int deltaGameTime) {
if (!LoadPlanet) {
uint32_t pid = GetActivePlanetRecord()->GetID().internalValue;
auto buildings = GetData<DrillBuilding>();
SavedBuildings.clear();
// SavedBuildings.clear();
for (auto fact : buildings) {
if (fact->getPlanetID() == pid) {

Expand All @@ -64,7 +64,7 @@ void FactoryManager::Update(int deltaTime, int deltaGameTime) {


}
SavedBuildings.push_back(fact);
// SavedBuildings.push_back(fact);
LoadPlanet = true;

}
Expand All @@ -73,15 +73,15 @@ void FactoryManager::Update(int deltaTime, int deltaGameTime) {
else {
LoadPlanet = false;
//If simulator got cleared
auto buildings = GetData<DrillBuilding>();
if (buildings.size() < SavedBuildings.size()) {
for (auto fact : SavedBuildings) {
// auto buildings = GetData<DrillBuilding>();
// if (buildings.size() < SavedBuildings.size()) {
// for (auto fact : SavedBuildings) {

auto factory = simulator_new<DrillBuilding>();
factory->init(fact->getPosition(), fact->getPlanetID());
}
// auto factory = simulator_new<DrillBuilding>();
// factory->init(fact->getPosition(), fact->getPlanetID());
// }

}
// }
}


Expand Down
2 changes: 1 addition & 1 deletion FactoryManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ class FactoryManager

bool LoadPlanet = false;
static FactoryManager* sInstance;
vector<DrillBuildingPtr> SavedBuildings;
//vector<DrillBuildingPtr> SavedBuildings;
};
15 changes: 11 additions & 4 deletions ModInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
<remove>Rattler!RecipesCasual.package</remove>
<remove>Rattler!RecipesNormal.package</remove>
<remove>Rattler!RecipesGrindy.package</remove>
<remove>Rattler!RecipesCreative.package</remove>
<remove>RattlerWares.package</remove>
<remove>RattlerSpiceDyeing.package</remove>
<remove>RattlerSpore.package</remove>

<component unique="RattlerCore" displayName="Rattler SPORE Industry Core" description="The core components of RattlerSPORE, contains mineral tiers 1-3. If you do not prefer most of the overhaul elements, but wish to keep the mining. Only install this. Otherwise, select to your heart's content!" game="GalacticAdventures" defaultChecked="true">RattlerSpore.package</component>
<component unique="RattlerCore" displayName="Rattler SPORE Core v1.1" description="The core components of RattlerSPORE, contains mineral tiers 1-3. If you do not prefer most of the overhaul elements, but wish to keep the mining. Only install this. Otherwise, select to your heart's content!" game="GalacticAdventures" defaultChecked="true">RattlerSpore.package</component>

<componentGroup unique="toolRecip" displayName="Core Recipe Addons">
<component unique="CasualTools" displayName="Casual Tool Recipes" description="This difficulty is for more casual players of SPORE. The recipe prices are half off." game="GalacticAdventures" defaultChecked="false">Rattler!RecipesCasual.package</component>
<component unique="NormalTools" displayName="Normal Tool Recipes" description="The intended difficulty of RattlerSPORE. Is a tad grindy." game="GalacticAdventures" defaultChecked="true">Rattler!RecipesNormal.package</component>
<component unique="GrindyTools" displayName="Grindy Tool Recipes" description="Doubles the prices of all recipes, making the mod even more grindy. WARNING: DO NOT USE UNLESS YOU HAVE A MOD THAT ALLOWS YOU TO CARRY MORE THAN 99 SPICE." game="GalacticAdventures" defaultChecked="false">Rattler!RecipesGrindy.package</component>
<component unique="CasualTools" displayName="Casual Tool Recipes v.1.0" description="This difficulty is for more casual players of SPORE. The recipe prices are half off." game="GalacticAdventures" defaultChecked="false">Rattler!RecipesCasual.package</component>
<component unique="NormalTools" displayName="Normal Tool Recipes v.1.0" description="The intended difficulty of RattlerSPORE. Is a tad grindy." game="GalacticAdventures" defaultChecked="true">Rattler!RecipesNormal.package</component>
<component unique="GrindyTools" displayName="Grindy Tool Recipes v.1.0" description="Doubles the prices of all recipes, making the mod even more grindy. WARNING: DO NOT USE UNLESS YOU HAVE A MOD THAT ALLOWS YOU TO CARRY MORE THAN 99 SPICE." game="GalacticAdventures" defaultChecked="false">Rattler!RecipesGrindy.package</component>
</componentGroup>
<component unique="Wares" displayName="Rattler SPORE Wares v.1.0" description="Adds new craftable items that sell for quite a bit. They will be used in future addons." game="GalacticAdventures" defaultChecked="false">RattlerWares.package</component>
<component unique="SpiceDye" displayName="Rattler SPORE Spice Dyeing v.1.0" description="Allows spices to be crafted into each other using late-game Fleshy Mass." game="GalacticAdventures" defaultChecked="false">RattlerSpiceDyeing.package</component>
<component unique="CreativeMode" displayName="Creative Recipes v.1.0" description="Makes every recipe in the game free. For players who want to showcase the mod, or have very little patience. WARNING: Spamming the fabricator on low-end devices could cause a crash." game="GalacticAdventures" defaultChecked="false">Rattler!RecipesCreative.package</component>


<prerequisite>RattlerSpore.dll</prerequisite>

Expand Down
10 changes: 9 additions & 1 deletion ResourceIcon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ ResourceIcon::ResourceIcon(UTFWin::IWindow* window, uint32_t juh, uint32_t neede

string16 products;
products.assign_convert(to_string(needed));
products = u" x" + products;
if (PropManager.HasPropertyList(id("creativeTools"), id("rattlerConfig"))) {
products = u" Free";

}
else {
products = u" x" + products;

}

mapItemWindow->FindWindowByID(id("zurgtastic"))->FindWindowByID(id("count"))->SetCaption(products.c_str());
PropertyListPtr sillyPropList;
PropManager.GetPropertyList(myResource, 0x034d97fa, sillyPropList);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
key feedListItemIconKey graphics_misc_2~!feedlisticon_hammer.png
keys feedListItemKeyList
newline

end
texts feedListItemName
"Creative Mode"
end
key feedListItemType FeedItemMessage
7 changes: 7 additions & 0 deletions SMFX/RattlerRecipesCreative/config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Wed Jan 17 21:55:10 EST 2024
lastTimeUsed=1705545024022
isReadOnly=false
sources="RattlerSpore"|"RattlerRecipesCasual"
packPathType=GALACTIC_ADVENTURES
packageName=Rattler\!RecipesCreative.package
embeddedEditorPackages=None
Empty file.
2 changes: 1 addition & 1 deletion SMFX/RattlerWares/config.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Tue Jan 16 13:48:17 EST 2024
#Tue Jan 16 19:46:15 EST 2024
lastTimeUsed=1705430897314
isReadOnly=false
sources="RattlerSpore"|"RattlerSpiceDyeing"
Expand Down
22 changes: 14 additions & 8 deletions dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ void Initialize() {
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")))
{
Expand All @@ -52,17 +58,17 @@ void Initialize() {

}
//Core Industry
if (PropManager.HasPropertyList(id("industry"), id("rattlerConfig")))
{
App::ConsolePrintF("RattlerSPORE: Core Industry Enabled");
InjectCategories::InjectCategory(u"AssetBrowserFeedItems!rspore_industry.prop");
//if (PropManager.HasPropertyList(id("industry"), id("rattlerConfig")))
//{
// App::ConsolePrintF("RattlerSPORE: Core Industry Enabled");
// InjectCategories::InjectCategory(u"AssetBrowserFeedItems!rspore_industry.prop");

ClassManager.AddFactory(new DrillBuildingFactory());
// ClassManager.AddFactory(new DrillBuildingFactory());

ToolManager.AddStrategy(new PlaceDrill(), id("placedrill"));
// ToolManager.AddStrategy(new PlaceDrill(), id("placedrill"));

SimulatorSystem.AddStrategy(new FactoryManager(), FactoryManager::NOUN_ID);
}
// SimulatorSystem.AddStrategy(new FactoryManager(), FactoryManager::NOUN_ID);
//}

//Spice Dyeing Addon
if (PropManager.HasPropertyList(id("spicedye"), id("rattlerConfig")))
Expand Down

0 comments on commit 1fa25f3

Please sign in to comment.