能量核心2补

This commit is contained in:
2025-07-23 16:54:03 +08:00
parent 596e4b596b
commit 588fff3cdd
11 changed files with 201 additions and 4 deletions

View File

@@ -0,0 +1,21 @@
using HarmonyLib;
using RimWorld;
using Verse;
namespace WulaFallenEmpire.HarmonyPatches
{
[HarmonyPatch(typeof(FloatMenuOptionProvider_Ingest), "GetSingleOptionFor")]
public static class FloatMenuOptionProvider_Ingest_GetSingleOptionFor_Patch
{
[HarmonyPostfix]
public static void Postfix(ref FloatMenuOption __result, Thing clickedThing)
{
// If the standard "Ingest" option is for our energy core, nullify it.
// Our custom "摄取能量" option is added by CompUsable and is not affected by this provider.
if (__result != null && clickedThing != null && clickedThing.def.defName == "WULA_Charge_Cube")
{
__result = null;
}
}
}
}