feat: add 'hide sorters too' sub-option for do-not-render feature

When enabled (with the parent feature on), sorters are also hidden,
leaving only belts and their cargo visible. Hidden sorters also become
click-through so clicks reach the belts beneath them.

- RenderingPatch: gate InserterRenderer.Render and the RaycastLogic
  inserter exemption on a new HideSorters flag
- FactoryPatch/UXAssist/FactoryConfigProvider: new
  DoNotRenderEntitiesHideSorters config wired to the flag
- UIConfigWindow/I18NKeys: indented sub-checkbox + EN/zh label
- README/CHANGELOG: document the sub-option; bump to 1.5.9
This commit is contained in:
FyisFe
2026-07-22 14:21:05 +08:00
committed by soarqin
parent 82365b3d16
commit a48ae5ad96
9 changed files with 38 additions and 3 deletions
+10 -1
View File
@@ -19,6 +19,8 @@ internal static class RenderingPatch
internal class DoNotRenderEntities : PatchImpl<DoNotRenderEntities>
{
public static bool HideSorters;
[HarmonyPrefix]
[HarmonyPatch(typeof(ObjectRenderer), nameof(ObjectRenderer.Render))]
[HarmonyPatch(typeof(DynamicRenderer), nameof(DynamicRenderer.Render))]
@@ -27,6 +29,13 @@ internal static class RenderingPatch
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(InserterRenderer), nameof(InserterRenderer.Render))]
private static bool InserterRenderer_Render_Prefix()
{
return !HideSorters;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(LabRenderer), nameof(LabRenderer.Render))]
private static bool LabRenderer_Render_Prefix()
@@ -69,7 +78,7 @@ internal static class RenderingPatch
new CodeInstruction(OpCodes.Ldarg_0),
new CodeInstruction(OpCodes.Ldloc_S, 33),
new CodeInstruction(OpCodes.Ldloc_S, 35),
Transpilers.EmitDelegate((RaycastLogic l, ColliderData[] colliderPool, int j) => l.factory.entityPool[colliderPool[j].objId].inserterId > 0),
Transpilers.EmitDelegate((RaycastLogic l, ColliderData[] colliderPool, int j) => !HideSorters && l.factory.entityPool[colliderPool[j].objId].inserterId > 0),
new CodeInstruction(OpCodes.Brfalse, branch1)
);
matcher.Labels.Add(branch2);