Skip to content

Commit

Permalink
Minor update to Vanilla Quests Expanded - The Generator (#515)
Browse files Browse the repository at this point in the history
Replaced syncing of every single upgrade gizmo and replaced it with syncing the method that places the blueprint. This method was added in one of recent updates to the mod.
  • Loading branch information
SokyranTheDragon authored Feb 18, 2025
1 parent 2352fe1 commit 136418f
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions Source/Mods/VanillaQuestsTheGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,34 +99,9 @@ public VanillaQuestsTheGenerator(ModContentPack mod)
MpCompat.RegisterLambdaMethod("VanillaQuestsExpandedTheGenerator.Building_GenetronWithSteamBoost",
nameof(Building.GetGizmos), 0, 1, 2).Skip(1).SetDebugOnly();

// They all have a gizmo to upgrade to next one (0) and another that opens a downgrade dialog (1)
var singleGizmoUpgradableBuildingTypes = new[]
{
"Building_Genetron_Basic",
"Building_Genetron_ChemfuelBoosted",
"Building_Genetron_ChemfuelCharged",
"Building_Genetron_ChemfuelPowered",
"Building_Genetron_Geothermal",
"Building_Genetron_Isotopic",
"Building_Genetron_Nuclear",
"Building_Genetron_SteamPowered",
"Building_Genetron_ThermalVent",
"Building_Genetron_UraniumPowered",
"Building_Genetron_WoodBlasting",
"Building_Genetron_WoodFired",
"Building_Genetron_WoodFueled",
"Building_Genetron_WoodPowered",
};

// Building_Genetron_Atomic, Building_Genetron_HeatPowered - only gizmo opens a downgrade dialog

foreach (var typeName in singleGizmoUpgradableBuildingTypes)
MpCompat.RegisterLambdaMethod($"VanillaQuestsExpandedTheGenerator.{typeName}", nameof(Building.GetGizmos), 0);

// Place geothermal/uranium upgrade blueprint (0/1), as opposed to others it has 2 upgrade paths.
// Other gizmo (2) opens a downgrade dialog.
MpCompat.RegisterLambdaMethod("VanillaQuestsExpandedTheGenerator.Building_Genetron_ChemfuelFortified",
nameof(Building.GetGizmos), 0, 1);
// Upgrade generator gizmo, used by every upgradeable building class
MP.RegisterSyncMethod(AccessTools.DeclaredMethod("VanillaQuestsExpandedTheGenerator.Utils:PlaceDistinctBlueprint"))
.CancelIfAnyArgNull();

// Study genetron (0)
MpCompat.RegisterLambdaMethod("VanillaQuestsExpandedTheGenerator.Building_Genetron_Studiable",
Expand Down

0 comments on commit 136418f

Please sign in to comment.