From 1fa25f3e999b8c422f1cd60608fd1e01dd7cfa08 Mon Sep 17 00:00:00 2001 From: DeNether <117329895+NeDether@users.noreply.github.com> Date: Wed, 17 Jan 2024 21:56:02 -0500 Subject: [PATCH] EMERGENCY UPDATE The SDK broke all previous versions of the mod, So I guess I will be releasing v1.1 a little early... --- FabricatorSystem.cpp | 6 +++++ FactoryManager.cpp | 22 +++++++++---------- FactoryManager.h | 2 +- ModInfo.xml | 15 +++++++++---- ResourceIcon.cpp | 10 ++++++++- .../rspore_creativetools.prop.prop_t | 9 ++++++++ SMFX/RattlerRecipesCreative/config.properties | 7 ++++++ .../rattlerConfig/creativetools.prop.prop_t | 0 SMFX/RattlerWares/config.properties | 2 +- dllmain.cpp | 22 ++++++++++++------- 10 files changed, 69 insertions(+), 26 deletions(-) create mode 100644 SMFX/RattlerRecipesCreative/AssetBrowserFeedItems/rspore_creativetools.prop.prop_t create mode 100644 SMFX/RattlerRecipesCreative/config.properties create mode 100644 SMFX/RattlerRecipesCreative/rattlerConfig/creativetools.prop.prop_t diff --git a/FabricatorSystem.cpp b/FabricatorSystem.cpp index 3cf7857..85d0ef6 100644 --- a/FabricatorSystem.cpp +++ b/FabricatorSystem.cpp @@ -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); @@ -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); diff --git a/FactoryManager.cpp b/FactoryManager.cpp index 8e71d3b..8a48d12 100644 --- a/FactoryManager.cpp +++ b/FactoryManager.cpp @@ -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() }; @@ -44,7 +44,7 @@ void FactoryManager::Initialize() { } void FactoryManager::Dispose() { - + //SavedBuildings.clear(); } void FactoryManager::Update(int deltaTime, int deltaGameTime) { @@ -53,7 +53,7 @@ void FactoryManager::Update(int deltaTime, int deltaGameTime) { if (!LoadPlanet) { uint32_t pid = GetActivePlanetRecord()->GetID().internalValue; auto buildings = GetData(); - SavedBuildings.clear(); + // SavedBuildings.clear(); for (auto fact : buildings) { if (fact->getPlanetID() == pid) { @@ -64,7 +64,7 @@ void FactoryManager::Update(int deltaTime, int deltaGameTime) { } - SavedBuildings.push_back(fact); + // SavedBuildings.push_back(fact); LoadPlanet = true; } @@ -73,15 +73,15 @@ void FactoryManager::Update(int deltaTime, int deltaGameTime) { else { LoadPlanet = false; //If simulator got cleared - auto buildings = GetData(); - if (buildings.size() < SavedBuildings.size()) { - for (auto fact : SavedBuildings) { + // auto buildings = GetData(); + // if (buildings.size() < SavedBuildings.size()) { + // for (auto fact : SavedBuildings) { - auto factory = simulator_new(); - factory->init(fact->getPosition(), fact->getPlanetID()); - } + // auto factory = simulator_new(); + // factory->init(fact->getPosition(), fact->getPlanetID()); + // } - } + // } } diff --git a/FactoryManager.h b/FactoryManager.h index 205c9a4..b57c706 100644 --- a/FactoryManager.h +++ b/FactoryManager.h @@ -48,5 +48,5 @@ class FactoryManager bool LoadPlanet = false; static FactoryManager* sInstance; - vector SavedBuildings; + //vector SavedBuildings; }; \ No newline at end of file diff --git a/ModInfo.xml b/ModInfo.xml index 55c5c43..fdaf149 100644 --- a/ModInfo.xml +++ b/ModInfo.xml @@ -3,15 +3,22 @@ Rattler!RecipesCasual.package Rattler!RecipesNormal.package Rattler!RecipesGrindy.package + Rattler!RecipesCreative.package + RattlerWares.package + RattlerSpiceDyeing.package RattlerSpore.package - RattlerSpore.package + RattlerSpore.package - Rattler!RecipesCasual.package - Rattler!RecipesNormal.package - Rattler!RecipesGrindy.package + Rattler!RecipesCasual.package + Rattler!RecipesNormal.package + Rattler!RecipesGrindy.package + RattlerWares.package + RattlerSpiceDyeing.package + Rattler!RecipesCreative.package + RattlerSpore.dll diff --git a/ResourceIcon.cpp b/ResourceIcon.cpp index 4d3c1eb..0777c98 100644 --- a/ResourceIcon.cpp +++ b/ResourceIcon.cpp @@ -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); diff --git a/SMFX/RattlerRecipesCreative/AssetBrowserFeedItems/rspore_creativetools.prop.prop_t b/SMFX/RattlerRecipesCreative/AssetBrowserFeedItems/rspore_creativetools.prop.prop_t new file mode 100644 index 0000000..d861667 --- /dev/null +++ b/SMFX/RattlerRecipesCreative/AssetBrowserFeedItems/rspore_creativetools.prop.prop_t @@ -0,0 +1,9 @@ +key feedListItemIconKey graphics_misc_2~!feedlisticon_hammer.png +keys feedListItemKeyList + newline + +end +texts feedListItemName + "Creative Mode" +end +key feedListItemType FeedItemMessage \ No newline at end of file diff --git a/SMFX/RattlerRecipesCreative/config.properties b/SMFX/RattlerRecipesCreative/config.properties new file mode 100644 index 0000000..5efe231 --- /dev/null +++ b/SMFX/RattlerRecipesCreative/config.properties @@ -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 diff --git a/SMFX/RattlerRecipesCreative/rattlerConfig/creativetools.prop.prop_t b/SMFX/RattlerRecipesCreative/rattlerConfig/creativetools.prop.prop_t new file mode 100644 index 0000000..e69de29 diff --git a/SMFX/RattlerWares/config.properties b/SMFX/RattlerWares/config.properties index 048b3f8..5a523ac 100644 --- a/SMFX/RattlerWares/config.properties +++ b/SMFX/RattlerWares/config.properties @@ -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" diff --git a/dllmain.cpp b/dllmain.cpp index 363c08e..cdf1d8e 100644 --- a/dllmain.cpp +++ b/dllmain.cpp @@ -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"))) { @@ -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")))