feat(uxassist): add a shortcut to reverse conveyor belts

- Add a Factory toggle and a configurable Alt+R shortcut for the built belt under the cursor.
- Reuse native reversal while preserving the belt inspector context and native limits.
- Add English and Chinese settings labels, usage notes, and changelog entries.
This commit is contained in:
萌泪酱 authored and Soar Qin committed 2026-11-16 09:06:15 +08:00
1 parent 4c0ad9c27f
commit 9fb75f70b8
8 files changed
+71

No files matched your search

+17
View File
@@ -39,6 +39,7 @@ public static class FactoryPatch
public static ConfigEntry<bool> TankFastFillInAndTakeOutEnabled;
public static ConfigEntry<int> TankFastFillInAndTakeOutMultiplier;
public static ConfigEntry<bool> CutConveyorBeltEnabled;
public static ConfigEntry<bool> ReverseConveyorBeltEnabled;
public static ConfigEntry<bool> TweakBuildingBufferEnabled;
public static ConfigEntry<int> AssemblerBufferTimeMultiplier;
public static ConfigEntry<int> AssemblerBufferMininumMultiplier;
@@ -56,6 +57,7 @@ public static class FactoryPatch
internal static PressKeyBind _doNotRenderEntitiesKey;
internal static PressKeyBind _offgridfForPathsKey;
internal static PressKeyBind _cutConveyorBeltKey;
internal static PressKeyBind _reverseConveyorBeltKey;
internal static PressKeyBind _dismantleBlueprintSelectionKey;
internal static PressKeyBind _selectAllBuildingsInBlueprintCopyKey;
@@ -86,6 +88,14 @@ public static class FactoryPatch
name = "CutConveyorBelt",
canOverride = true
}
);
_reverseConveyorBeltKey = KeyBindings.RegisterKeyBinding(new BuiltinKey
{
key = new CombineKey((int)KeyCode.R, CombineKey.ALT_COMB, ECombineKeyAction.OnceClick, false),
conflictGroup = KeyBindConflict.MOVEMENT | KeyBindConflict.FLYING | KeyBindConflict.SAILING | KeyBindConflict.BUILD_MODE_1 | KeyBindConflict.KEYBOARD_KEYBIND,
name = "ReverseConveyorBelt",
canOverride = true
}
);
_dismantleBlueprintSelectionKey = KeyBindings.RegisterKeyBinding(new BuiltinKey
{
@@ -215,6 +225,13 @@ public static class FactoryPatch
Functions.FactoryFunctions.CutConveyorBelt(cargoTraffic, beltId);
}
}
if (ReverseConveyorBeltEnabled.Value && _reverseConveyorBeltKey.keyValue
&& GameMain.isRunning && !GameMain.isPaused && !VFInput.onGUI)
{
var raycast = GameMain.mainPlayer?.controller?.cmd.raycast;
if (raycast != null && raycast.castEntity.id > 0 && raycast.castEntity.beltId > 0)
Functions.FactoryFunctions.ReverseConveyorBelt(raycast.planet?.factory, raycast.castEntity.beltId);
}
if (ShortcutKeysForBlueprintCopyEnabled.Value)
{
if (_dismantleBlueprintSelectionKey.keyValue)