1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 04:13:32 +08:00

work in progress

This commit is contained in:
2025-04-22 01:58:07 +08:00
parent 65522c6f21
commit e765f0f42d
5 changed files with 175 additions and 168 deletions

View File

@@ -89,6 +89,10 @@ public static class LogisticsPatch
{
RealtimeLogisticsInfoPanel.StationInfoPanelsUpdate();
}
if (LogisticsCapacityTweaksEnabled.Value && VFInput.onGUI && !VFInput.inputing)
{
LogisticsCapacityTweaks.UpdateInput();
}
}
private class AutoConfigLogistics: PatchImpl<AutoConfigLogistics>

View File

@@ -70,10 +70,7 @@ public static class PlayerPatch
public static void OnUpdate()
{
if (_toggleAllStarsNameKey.keyValue)
{
ShortcutKeysForStarsName.ToggleAllStarsName();
}
ShortcutKeysForStarsName.OnUpdate();
if (_autoDriveKey.keyValue)
{
AutoNavigation.ToggleAutoCruise();
@@ -156,12 +153,28 @@ public static class PlayerPatch
public class ShortcutKeysForStarsName: PatchImpl<ShortcutKeysForStarsName>
{
private static int _showAllStarsNameStatus;
private static bool _forceShowAllStarsName;
private static bool _forceShowAllStarsNameExternal;
public static void ToggleAllStarsName()
{
_showAllStarsNameStatus = (_showAllStarsNameStatus + 1) % 3;
}
public static void SetForceShowAllStarsNameExternal(bool value)
{
_forceShowAllStarsNameExternal = value;
}
public static void OnUpdate()
{
if (_toggleAllStarsNameKey.keyValue)
{
ToggleAllStarsName();
}
_forceShowAllStarsName = _forceShowAllStarsNameExternal || _showAllStarsNameKey.IsKeyPressing();
}
[HarmonyPostfix]
[HarmonyPatch(typeof(UIStarmap), nameof(UIStarmap._OnClose))]
private static void UIStarmap__OnClose_Postfix()
@@ -189,8 +202,7 @@ public static class PlayerPatch
new CodeInstruction(OpCodes.Ldc_I4_1),
new CodeInstruction(OpCodes.Ceq),
new CodeInstruction(OpCodes.Brtrue, jumpPos.Value),
new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(PlayerPatch), nameof(_showAllStarsNameKey))),
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(KeyBindings), nameof(KeyBindings.IsKeyPressing))),
new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(PlayerPatch.ShortcutKeysForStarsName), nameof(_forceShowAllStarsName))),
new CodeInstruction(OpCodes.Brtrue, jumpPos.Value),
new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(ShortcutKeysForStarsName), nameof(_showAllStarsNameStatus))),
new CodeInstruction(OpCodes.Ldc_I4_2),