Skip to content

Commit 136418f

Browse files
Minor update to Vanilla Quests Expanded - The Generator (#515)
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.
1 parent 2352fe1 commit 136418f

File tree

1 file changed

+3
-28
lines changed

1 file changed

+3
-28
lines changed

Source/Mods/VanillaQuestsTheGenerator.cs

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -99,34 +99,9 @@ public VanillaQuestsTheGenerator(ModContentPack mod)
9999
MpCompat.RegisterLambdaMethod("VanillaQuestsExpandedTheGenerator.Building_GenetronWithSteamBoost",
100100
nameof(Building.GetGizmos), 0, 1, 2).Skip(1).SetDebugOnly();
101101

102-
// They all have a gizmo to upgrade to next one (0) and another that opens a downgrade dialog (1)
103-
var singleGizmoUpgradableBuildingTypes = new[]
104-
{
105-
"Building_Genetron_Basic",
106-
"Building_Genetron_ChemfuelBoosted",
107-
"Building_Genetron_ChemfuelCharged",
108-
"Building_Genetron_ChemfuelPowered",
109-
"Building_Genetron_Geothermal",
110-
"Building_Genetron_Isotopic",
111-
"Building_Genetron_Nuclear",
112-
"Building_Genetron_SteamPowered",
113-
"Building_Genetron_ThermalVent",
114-
"Building_Genetron_UraniumPowered",
115-
"Building_Genetron_WoodBlasting",
116-
"Building_Genetron_WoodFired",
117-
"Building_Genetron_WoodFueled",
118-
"Building_Genetron_WoodPowered",
119-
};
120-
121-
// Building_Genetron_Atomic, Building_Genetron_HeatPowered - only gizmo opens a downgrade dialog
122-
123-
foreach (var typeName in singleGizmoUpgradableBuildingTypes)
124-
MpCompat.RegisterLambdaMethod($"VanillaQuestsExpandedTheGenerator.{typeName}", nameof(Building.GetGizmos), 0);
125-
126-
// Place geothermal/uranium upgrade blueprint (0/1), as opposed to others it has 2 upgrade paths.
127-
// Other gizmo (2) opens a downgrade dialog.
128-
MpCompat.RegisterLambdaMethod("VanillaQuestsExpandedTheGenerator.Building_Genetron_ChemfuelFortified",
129-
nameof(Building.GetGizmos), 0, 1);
102+
// Upgrade generator gizmo, used by every upgradeable building class
103+
MP.RegisterSyncMethod(AccessTools.DeclaredMethod("VanillaQuestsExpandedTheGenerator.Utils:PlaceDistinctBlueprint"))
104+
.CancelIfAnyArgNull();
130105

131106
// Study genetron (0)
132107
MpCompat.RegisterLambdaMethod("VanillaQuestsExpandedTheGenerator.Building_Genetron_Studiable",

0 commit comments

Comments
 (0)