mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-03-22 16:53:26 +08:00
WIP
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using BepInEx.Configuration;
|
using BepInEx.Configuration;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UXAssist.Common;
|
using UXAssist.Common;
|
||||||
|
using UXAssist.Patches;
|
||||||
|
|
||||||
namespace UXAssist.Functions;
|
namespace UXAssist.Functions;
|
||||||
|
|
||||||
@@ -33,6 +33,11 @@ public static class WindowFunctions
|
|||||||
|
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
I18N.Add("Cores: {0}\nThreads: {1}", "Cores: {0}\nThreads: {1}", "内核数: {0}\n线程数: {1}");
|
||||||
|
I18N.Add("\nP-Cores: {0}\nE-Cores: {1}", "\nP-Cores: {0}\nE-Cores: {1}", "\n性能核心: {0}\n能效核心: {1}");
|
||||||
|
I18N.Add("\nPriority: {0}", "\nProcess priority: {0}", "\n进程优先级: {0}");
|
||||||
|
I18N.Add("\nEnabled CPUs: ", "\nEnabled CPUs: ", "\n使用的CPU: ");
|
||||||
|
I18N.Add("Unknown", "Unknown", "未知");
|
||||||
ProcessorDetails = WinApi.GetLogicalProcessorDetails();
|
ProcessorDetails = WinApi.GetLogicalProcessorDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +50,7 @@ public static class WindowFunctions
|
|||||||
{
|
{
|
||||||
_oldWndProc = WinApi.SetWindowLongPtr(gameWnd, WinApi.GWLP_WNDPROC, Marshal.GetFunctionPointerForDelegate(wndProc));
|
_oldWndProc = WinApi.SetWindowLongPtr(gameWnd, WinApi.GWLP_WNDPROC, Marshal.GetFunctionPointerForDelegate(wndProc));
|
||||||
}
|
}
|
||||||
Patches.GamePatch.LoadLastWindowRect.MoveWindowPosition(true);
|
GamePatch.LoadLastWindowRect.MoveWindowPosition(true);
|
||||||
|
|
||||||
ProcessPriority.SettingChanged += (_, _) => WinApi.SetPriorityClass(WinApi.GetCurrentProcess(), ProrityFlags[ProcessPriority.Value]);
|
ProcessPriority.SettingChanged += (_, _) => WinApi.SetPriorityClass(WinApi.GetCurrentProcess(), ProrityFlags[ProcessPriority.Value]);
|
||||||
WinApi.SetPriorityClass(WinApi.GetCurrentProcess(), ProrityFlags[ProcessPriority.Value]);
|
WinApi.SetPriorityClass(WinApi.GetCurrentProcess(), ProrityFlags[ProcessPriority.Value]);
|
||||||
@@ -104,7 +109,7 @@ public static class WindowFunctions
|
|||||||
break;
|
break;
|
||||||
case WinApi.WM_MOVING:
|
case WinApi.WM_MOVING:
|
||||||
if (_gameLoaded) break;
|
if (_gameLoaded) break;
|
||||||
var rect = Patches.GamePatch.LastWindowRect.Value;
|
var rect = GamePatch.LastWindowRect.Value;
|
||||||
if (rect is { z: 0f, w: 0f }) break;
|
if (rect is { z: 0f, w: 0f }) break;
|
||||||
var x = Mathf.RoundToInt(rect.x);
|
var x = Mathf.RoundToInt(rect.x);
|
||||||
var y = Mathf.RoundToInt(rect.y);
|
var y = Mathf.RoundToInt(rect.y);
|
||||||
@@ -115,7 +120,7 @@ public static class WindowFunctions
|
|||||||
break;
|
break;
|
||||||
case WinApi.WM_SIZING:
|
case WinApi.WM_SIZING:
|
||||||
if (_gameLoaded) break;
|
if (_gameLoaded) break;
|
||||||
rect = Patches.GamePatch.LastWindowRect.Value;
|
rect = GamePatch.LastWindowRect.Value;
|
||||||
if (rect is { z: 0f, w: 0f }) break;
|
if (rect is { z: 0f, w: 0f }) break;
|
||||||
x = Mathf.RoundToInt(rect.x);
|
x = Mathf.RoundToInt(rect.x);
|
||||||
y = Mathf.RoundToInt(rect.y);
|
y = Mathf.RoundToInt(rect.y);
|
||||||
@@ -132,25 +137,38 @@ public static class WindowFunctions
|
|||||||
return WinApi.CallWindowProc(_oldWndProc, hWnd, uMsg, wParam, lParam);
|
return WinApi.CallWindowProc(_oldWndProc, hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string GetPriorityName(int priority)
|
||||||
|
{
|
||||||
|
return priority switch
|
||||||
|
{
|
||||||
|
WinApi.HIGH_PRIORITY_CLASS => "High".Translate(),
|
||||||
|
WinApi.ABOVE_NORMAL_PRIORITY_CLASS => "Above Normal".Translate(),
|
||||||
|
WinApi.NORMAL_PRIORITY_CLASS => "Normal".Translate(),
|
||||||
|
WinApi.BELOW_NORMAL_PRIORITY_CLASS => "Below Normal".Translate(),
|
||||||
|
WinApi.IDLE_PRIORITY_CLASS => "Idle".Translate(),
|
||||||
|
_ => "Unknown".Translate()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public static void ShowCPUInfo()
|
public static void ShowCPUInfo()
|
||||||
{
|
{
|
||||||
var details = WinApi.GetLogicalProcessorDetails();
|
var details = ProcessorDetails;
|
||||||
var msg = $"Cores: {details.CoreCount}\nThreads: {details.ThreadCount}";
|
var msg = string.Format("Cores: {0}\nThreads: {1}".Translate(), details.CoreCount, details.ThreadCount);
|
||||||
var hybrid = details.HybridArchitecture;
|
var hybrid = details.HybridArchitecture;
|
||||||
if (hybrid)
|
if (hybrid)
|
||||||
{
|
{
|
||||||
msg += $"\nP-Cores: {details.PerformanceCoreCount}\nE-Cores: {details.EfficiencyCoreCount}";
|
msg += string.Format("\nP-Cores: {0}\nE-Cores: {1}".Translate(), details.PerformanceCoreCount, details.EfficiencyCoreCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
var handle = WinApi.GetCurrentProcess();
|
var handle = WinApi.GetCurrentProcess();
|
||||||
var prio = (ProcessPriorityClass)WinApi.GetPriorityClass(handle);
|
var prio = GetPriorityName(WinApi.GetPriorityClass(handle));
|
||||||
msg += $"\nPriority: {prio}";
|
msg += string.Format("\nPriority: {0}".Translate(), prio);
|
||||||
|
|
||||||
var aff = 0UL;
|
var aff = 0UL;
|
||||||
if (WinApi.GetProcessAffinityMask(handle, out var processMask, out var systemMask))
|
if (WinApi.GetProcessAffinityMask(handle, out var processMask, out var systemMask))
|
||||||
aff = (ulong)processMask & (ulong)systemMask;
|
aff = processMask & systemMask;
|
||||||
|
|
||||||
msg += $"\nEnabled CPUs: ";
|
msg += "\nEnabled CPUs: ".Translate();
|
||||||
var first = true;
|
var first = true;
|
||||||
for (var i = 0; aff != 0UL; i++)
|
for (var i = 0; aff != 0UL; i++)
|
||||||
{
|
{
|
||||||
@@ -173,7 +191,7 @@ public static class WindowFunctions
|
|||||||
aff >>= 1;
|
aff >>= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
UIMessageBox.Show("CPU Info".Translate(), msg, "OK".Translate(), -1);
|
UIMessageBox.Show("CPU Info".Translate(), msg, "确定".Translate(), -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetWindowTitle()
|
public static void SetWindowTitle()
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using BepInEx.Bootstrap;
|
||||||
using BepInEx.Configuration;
|
using BepInEx.Configuration;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using UXAssist.Patches;
|
using UXAssist.Patches;
|
||||||
@@ -12,7 +13,7 @@ public static class AuxilaryfunctionWrapper
|
|||||||
|
|
||||||
public static void Start(Harmony harmony)
|
public static void Start(Harmony harmony)
|
||||||
{
|
{
|
||||||
if (!BepInEx.Bootstrap.Chainloader.PluginInfos.TryGetValue(AuxilaryfunctionGuid, out var pluginInfo)) return;
|
if (!Chainloader.PluginInfos.TryGetValue(AuxilaryfunctionGuid, out var pluginInfo)) return;
|
||||||
var assembly = pluginInfo.Instance.GetType().Assembly;
|
var assembly = pluginInfo.Instance.GetType().Assembly;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using BepInEx.Bootstrap;
|
||||||
using System.Reflection.Emit;
|
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using UXAssist.Common;
|
|
||||||
|
|
||||||
namespace UXAssist.ModsCompat;
|
namespace UXAssist.ModsCompat;
|
||||||
|
|
||||||
@@ -12,6 +10,6 @@ public static class BulletTimeWrapper
|
|||||||
|
|
||||||
public static void Start(Harmony _)
|
public static void Start(Harmony _)
|
||||||
{
|
{
|
||||||
HasBulletTime = BepInEx.Bootstrap.Chainloader.PluginInfos.TryGetValue(BulletTimeGuid, out var _);
|
HasBulletTime = Chainloader.PluginInfos.TryGetValue(BulletTimeGuid, out var _);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Reflection;
|
|||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
using BepInEx.Configuration;
|
using BepInEx.Configuration;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using UnityEngine.UI;
|
||||||
using UXAssist.Common;
|
using UXAssist.Common;
|
||||||
|
|
||||||
namespace UXAssist.Patches;
|
namespace UXAssist.Patches;
|
||||||
@@ -428,7 +429,7 @@ public class DysonSpherePatch: PatchImpl<DysonSpherePatch>
|
|||||||
new CodeInstruction(OpCodes.Ldarg_2),
|
new CodeInstruction(OpCodes.Ldarg_2),
|
||||||
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(DysonSwarm), nameof(DysonSwarm.starData))),
|
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(DysonSwarm), nameof(DysonSwarm.starData))),
|
||||||
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(StarData), nameof(StarData.index))),
|
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(StarData), nameof(StarData.index))),
|
||||||
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(StopEjectOnNodeComplete), nameof(StopEjectOnNodeComplete.AnyNodeForAbsorb))),
|
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(StopEjectOnNodeComplete), nameof(AnyNodeForAbsorb))),
|
||||||
new CodeInstruction(OpCodes.And)
|
new CodeInstruction(OpCodes.And)
|
||||||
);
|
);
|
||||||
return matcher.InstructionEnumeration();
|
return matcher.InstructionEnumeration();
|
||||||
@@ -446,7 +447,7 @@ public class DysonSpherePatch: PatchImpl<DysonSpherePatch>
|
|||||||
matcher.Labels = [];
|
matcher.Labels = [];
|
||||||
matcher.Insert(
|
matcher.Insert(
|
||||||
new CodeInstruction(OpCodes.Ldarg_0).WithLabels(labels),
|
new CodeInstruction(OpCodes.Ldarg_0).WithLabels(labels),
|
||||||
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(StopEjectOnNodeComplete), nameof(StopEjectOnNodeComplete.UpdateNodeForAbsorbOnSpChange)))
|
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(StopEjectOnNodeComplete), nameof(UpdateNodeForAbsorbOnSpChange)))
|
||||||
);
|
);
|
||||||
return matcher.InstructionEnumeration();
|
return matcher.InstructionEnumeration();
|
||||||
}
|
}
|
||||||
@@ -467,7 +468,7 @@ public class DysonSpherePatch: PatchImpl<DysonSpherePatch>
|
|||||||
new CodeMatch(OpCodes.Stfld, AccessTools.Field(typeof(DysonNode), nameof(DysonNode._cpReq)))
|
new CodeMatch(OpCodes.Stfld, AccessTools.Field(typeof(DysonNode), nameof(DysonNode._cpReq)))
|
||||||
).Advance(6).Insert(
|
).Advance(6).Insert(
|
||||||
new CodeInstruction(OpCodes.Ldarg_0),
|
new CodeInstruction(OpCodes.Ldarg_0),
|
||||||
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(StopEjectOnNodeComplete), nameof(StopEjectOnNodeComplete.UpdateNodeForAbsorbOnCpChange)))
|
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(StopEjectOnNodeComplete), nameof(UpdateNodeForAbsorbOnCpChange)))
|
||||||
);
|
);
|
||||||
return matcher.InstructionEnumeration();
|
return matcher.InstructionEnumeration();
|
||||||
}
|
}
|
||||||
@@ -483,7 +484,7 @@ public class DysonSpherePatch: PatchImpl<DysonSpherePatch>
|
|||||||
// this.stateText.text = "轨道未设置".Translate();
|
// this.stateText.text = "轨道未设置".Translate();
|
||||||
new CodeMatch(OpCodes.Ldstr, "待机"),
|
new CodeMatch(OpCodes.Ldstr, "待机"),
|
||||||
new CodeMatch(OpCodes.Call, AccessTools.Method(typeof(Localization), nameof(Localization.Translate))),
|
new CodeMatch(OpCodes.Call, AccessTools.Method(typeof(Localization), nameof(Localization.Translate))),
|
||||||
new CodeMatch(OpCodes.Callvirt, AccessTools.PropertySetter(typeof(UnityEngine.UI.Text), nameof(UnityEngine.UI.Text.text)))
|
new CodeMatch(OpCodes.Callvirt, AccessTools.PropertySetter(typeof(Text), nameof(Text.text)))
|
||||||
).InsertAndAdvance(
|
).InsertAndAdvance(
|
||||||
// if (StopEjectOnNodeComplete.AnyNodeForAbsorb(this.starData.index))
|
// if (StopEjectOnNodeComplete.AnyNodeForAbsorb(this.starData.index))
|
||||||
new CodeInstruction(OpCodes.Ldarg_0),
|
new CodeInstruction(OpCodes.Ldarg_0),
|
||||||
@@ -491,7 +492,7 @@ public class DysonSpherePatch: PatchImpl<DysonSpherePatch>
|
|||||||
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(FactorySystem), nameof(FactorySystem.planet))),
|
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(FactorySystem), nameof(FactorySystem.planet))),
|
||||||
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(PlanetData), nameof(PlanetData.star))),
|
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(PlanetData), nameof(PlanetData.star))),
|
||||||
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(StarData), nameof(StarData.index))),
|
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(StarData), nameof(StarData.index))),
|
||||||
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(StopEjectOnNodeComplete), nameof(StopEjectOnNodeComplete.AnyNodeForAbsorb))),
|
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(StopEjectOnNodeComplete), nameof(AnyNodeForAbsorb))),
|
||||||
new CodeInstruction(OpCodes.Brfalse, label1)
|
new CodeInstruction(OpCodes.Brfalse, label1)
|
||||||
).Advance(1).InsertAndAdvance(
|
).Advance(1).InsertAndAdvance(
|
||||||
new CodeInstruction(OpCodes.Br, label2),
|
new CodeInstruction(OpCodes.Br, label2),
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using BepInEx.Configuration;
|
|||||||
using CommonAPI.Systems;
|
using CommonAPI.Systems;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
using UXAssist.Common;
|
using UXAssist.Common;
|
||||||
|
|
||||||
namespace UXAssist.Patches;
|
namespace UXAssist.Patches;
|
||||||
@@ -566,7 +567,7 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
|
|||||||
matcher.MatchForward(false,
|
matcher.MatchForward(false,
|
||||||
new CodeMatch(OpCodes.Ldarg_0),
|
new CodeMatch(OpCodes.Ldarg_0),
|
||||||
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(UIEntityBriefInfo), nameof(UIEntityBriefInfo.entityNameText))),
|
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(UIEntityBriefInfo), nameof(UIEntityBriefInfo.entityNameText))),
|
||||||
new CodeMatch(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(UnityEngine.UI.Text), nameof(UnityEngine.UI.Text.preferredWidth)))
|
new CodeMatch(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Text), nameof(Text.preferredWidth)))
|
||||||
);
|
);
|
||||||
matcher.InsertAndAdvance(
|
matcher.InsertAndAdvance(
|
||||||
new CodeInstruction(OpCodes.Ldarg_0),
|
new CodeInstruction(OpCodes.Ldarg_0),
|
||||||
@@ -1479,7 +1480,7 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
|
|||||||
Name = "存储单元",
|
Name = "存储单元",
|
||||||
GridIndex = 3601,
|
GridIndex = 3601,
|
||||||
IconPath = "assets/signal/memory.png",
|
IconPath = "assets/signal/memory.png",
|
||||||
_iconSprite = Util.LoadEmbeddedSprite($"assets/signal/memory.png", assembly),
|
_iconSprite = Util.LoadEmbeddedSprite("assets/signal/memory.png", assembly),
|
||||||
SID = ""
|
SID = ""
|
||||||
},
|
},
|
||||||
new SignalProto
|
new SignalProto
|
||||||
@@ -1488,7 +1489,7 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
|
|||||||
Name = "能量碎片",
|
Name = "能量碎片",
|
||||||
GridIndex = 3602,
|
GridIndex = 3602,
|
||||||
IconPath = "assets/signal/energy-fragment.png",
|
IconPath = "assets/signal/energy-fragment.png",
|
||||||
_iconSprite = Util.LoadEmbeddedSprite($"assets/signal/energy-fragment.png", assembly),
|
_iconSprite = Util.LoadEmbeddedSprite("assets/signal/energy-fragment.png", assembly),
|
||||||
SID = ""
|
SID = ""
|
||||||
},
|
},
|
||||||
new SignalProto
|
new SignalProto
|
||||||
@@ -1497,7 +1498,7 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
|
|||||||
Name = "硅基神经元",
|
Name = "硅基神经元",
|
||||||
GridIndex = 3603,
|
GridIndex = 3603,
|
||||||
IconPath = "assets/signal/silicon-neuron.png",
|
IconPath = "assets/signal/silicon-neuron.png",
|
||||||
_iconSprite = Util.LoadEmbeddedSprite($"assets/signal/silicon-neuron.png", assembly),
|
_iconSprite = Util.LoadEmbeddedSprite("assets/signal/silicon-neuron.png", assembly),
|
||||||
SID = ""
|
SID = ""
|
||||||
},
|
},
|
||||||
new SignalProto
|
new SignalProto
|
||||||
@@ -1506,7 +1507,7 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
|
|||||||
Name = "负熵奇点",
|
Name = "负熵奇点",
|
||||||
GridIndex = 3604,
|
GridIndex = 3604,
|
||||||
IconPath = "assets/signal/negentropy.png",
|
IconPath = "assets/signal/negentropy.png",
|
||||||
_iconSprite = Util.LoadEmbeddedSprite($"assets/signal/negentropy.png", assembly),
|
_iconSprite = Util.LoadEmbeddedSprite("assets/signal/negentropy.png", assembly),
|
||||||
SID = ""
|
SID = ""
|
||||||
},
|
},
|
||||||
new SignalProto
|
new SignalProto
|
||||||
@@ -1515,7 +1516,7 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
|
|||||||
Name = "物质重组器",
|
Name = "物质重组器",
|
||||||
GridIndex = 3605,
|
GridIndex = 3605,
|
||||||
IconPath = "assets/signal/reassembler.png",
|
IconPath = "assets/signal/reassembler.png",
|
||||||
_iconSprite = Util.LoadEmbeddedSprite($"assets/signal/reassembler.png", assembly),
|
_iconSprite = Util.LoadEmbeddedSprite("assets/signal/reassembler.png", assembly),
|
||||||
SID = ""
|
SID = ""
|
||||||
},
|
},
|
||||||
new SignalProto
|
new SignalProto
|
||||||
@@ -1524,7 +1525,7 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
|
|||||||
Name = "虚粒子",
|
Name = "虚粒子",
|
||||||
GridIndex = 3606,
|
GridIndex = 3606,
|
||||||
IconPath = "assets/signal/virtual-particle.png",
|
IconPath = "assets/signal/virtual-particle.png",
|
||||||
_iconSprite = Util.LoadEmbeddedSprite($"assets/signal/virtual-particle.png", assembly),
|
_iconSprite = Util.LoadEmbeddedSprite("assets/signal/virtual-particle.png", assembly),
|
||||||
SID = ""
|
SID = ""
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using CommonAPI.Systems;
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UXAssist.Common;
|
using UXAssist.Common;
|
||||||
|
using UXAssist.Functions;
|
||||||
|
|
||||||
namespace UXAssist.Patches;
|
namespace UXAssist.Patches;
|
||||||
|
|
||||||
@@ -70,7 +71,7 @@ public class GamePatch: PatchImpl<GamePatch>
|
|||||||
I18N.Add("KEYUPSSpeedUp", "Increase logical frame rate", "提升逻辑帧率");
|
I18N.Add("KEYUPSSpeedUp", "Increase logical frame rate", "提升逻辑帧率");
|
||||||
I18N.Add("Logical frame rate: {0}x", "Logical frame rate: {0}x", "逻辑帧速率: {0}x");
|
I18N.Add("Logical frame rate: {0}x", "Logical frame rate: {0}x", "逻辑帧速率: {0}x");
|
||||||
|
|
||||||
Functions.WindowFunctions.SetWindowTitle();
|
WindowFunctions.SetWindowTitle();
|
||||||
|
|
||||||
EnableWindowResizeEnabled.SettingChanged += (_, _) => EnableWindowResize.Enable(EnableWindowResizeEnabled.Value);
|
EnableWindowResizeEnabled.SettingChanged += (_, _) => EnableWindowResize.Enable(EnableWindowResizeEnabled.Value);
|
||||||
LoadLastWindowRectEnabled.SettingChanged += (_, _) => LoadLastWindowRect.Enable(LoadLastWindowRectEnabled.Value);
|
LoadLastWindowRectEnabled.SettingChanged += (_, _) => LoadLastWindowRect.Enable(LoadLastWindowRectEnabled.Value);
|
||||||
@@ -134,7 +135,7 @@ public class GamePatch: PatchImpl<GamePatch>
|
|||||||
|
|
||||||
private static void RefreshSavePath()
|
private static void RefreshSavePath()
|
||||||
{
|
{
|
||||||
var profileName = Functions.WindowFunctions.ProfileName;
|
var profileName = WindowFunctions.ProfileName;
|
||||||
if (profileName == null) return;
|
if (profileName == null) return;
|
||||||
|
|
||||||
if (UIRoot.instance.loadGameWindow.gameObject.activeSelf)
|
if (UIRoot.instance.loadGameWindow.gameObject.activeSelf)
|
||||||
@@ -162,7 +163,7 @@ public class GamePatch: PatchImpl<GamePatch>
|
|||||||
[HarmonyPrefix, HarmonyPatch(typeof(GameMain), nameof(GameMain.HandleApplicationQuit))]
|
[HarmonyPrefix, HarmonyPatch(typeof(GameMain), nameof(GameMain.HandleApplicationQuit))]
|
||||||
private static void GameMain_HandleApplicationQuit_Prefix()
|
private static void GameMain_HandleApplicationQuit_Prefix()
|
||||||
{
|
{
|
||||||
var wnd = Functions.WindowFunctions.FindGameWindow();
|
var wnd = WindowFunctions.FindGameWindow();
|
||||||
if (wnd == IntPtr.Zero) return;
|
if (wnd == IntPtr.Zero) return;
|
||||||
WinApi.GetWindowRect(wnd, out var rect);
|
WinApi.GetWindowRect(wnd, out var rect);
|
||||||
LastWindowRect.Value = new Vector4(rect.Left, rect.Top, Screen.width, Screen.height);
|
LastWindowRect.Value = new Vector4(rect.Left, rect.Top, Screen.width, Screen.height);
|
||||||
@@ -175,7 +176,7 @@ public class GamePatch: PatchImpl<GamePatch>
|
|||||||
|
|
||||||
protected override void OnEnable()
|
protected override void OnEnable()
|
||||||
{
|
{
|
||||||
var wnd = Functions.WindowFunctions.FindGameWindow();
|
var wnd = WindowFunctions.FindGameWindow();
|
||||||
if (wnd == IntPtr.Zero)
|
if (wnd == IntPtr.Zero)
|
||||||
{
|
{
|
||||||
Enable(false);
|
Enable(false);
|
||||||
@@ -189,7 +190,7 @@ public class GamePatch: PatchImpl<GamePatch>
|
|||||||
|
|
||||||
protected override void OnDisable()
|
protected override void OnDisable()
|
||||||
{
|
{
|
||||||
var wnd = Functions.WindowFunctions.FindGameWindow();
|
var wnd = WindowFunctions.FindGameWindow();
|
||||||
if (wnd == IntPtr.Zero)
|
if (wnd == IntPtr.Zero)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -202,7 +203,7 @@ public class GamePatch: PatchImpl<GamePatch>
|
|||||||
[HarmonyPatch(typeof(UIOptionWindow), nameof(UIOptionWindow.ApplyOptions))]
|
[HarmonyPatch(typeof(UIOptionWindow), nameof(UIOptionWindow.ApplyOptions))]
|
||||||
private static void UIOptionWindow_ApplyOptions_Postfix()
|
private static void UIOptionWindow_ApplyOptions_Postfix()
|
||||||
{
|
{
|
||||||
var wnd = Functions.WindowFunctions.FindGameWindow();
|
var wnd = WindowFunctions.FindGameWindow();
|
||||||
if (wnd == IntPtr.Zero) return;
|
if (wnd == IntPtr.Zero) return;
|
||||||
if (_enabled)
|
if (_enabled)
|
||||||
WinApi.SetWindowLong(wnd, WinApi.GWL_STYLE,
|
WinApi.SetWindowLong(wnd, WinApi.GWL_STYLE,
|
||||||
@@ -276,7 +277,7 @@ public class GamePatch: PatchImpl<GamePatch>
|
|||||||
public static void MoveWindowPosition(bool setResolution = false)
|
public static void MoveWindowPosition(bool setResolution = false)
|
||||||
{
|
{
|
||||||
if (Screen.fullScreenMode is FullScreenMode.ExclusiveFullScreen or FullScreenMode.FullScreenWindow or FullScreenMode.MaximizedWindow || GameMain.isRunning) return;
|
if (Screen.fullScreenMode is FullScreenMode.ExclusiveFullScreen or FullScreenMode.FullScreenWindow or FullScreenMode.MaximizedWindow || GameMain.isRunning) return;
|
||||||
var wnd = Functions.WindowFunctions.FindGameWindow();
|
var wnd = WindowFunctions.FindGameWindow();
|
||||||
if (wnd == IntPtr.Zero) return;
|
if (wnd == IntPtr.Zero) return;
|
||||||
var rect = LastWindowRect.Value;
|
var rect = LastWindowRect.Value;
|
||||||
if (rect is { z: 0f, w: 0f }) return;
|
if (rect is { z: 0f, w: 0f }) return;
|
||||||
@@ -315,7 +316,7 @@ public class GamePatch: PatchImpl<GamePatch>
|
|||||||
{
|
{
|
||||||
if (_loaded || Screen.fullScreenMode is FullScreenMode.ExclusiveFullScreen or FullScreenMode.FullScreenWindow or FullScreenMode.MaximizedWindow) return;
|
if (_loaded || Screen.fullScreenMode is FullScreenMode.ExclusiveFullScreen or FullScreenMode.FullScreenWindow or FullScreenMode.MaximizedWindow) return;
|
||||||
_loaded = true;
|
_loaded = true;
|
||||||
var wnd = Functions.WindowFunctions.FindGameWindow();
|
var wnd = WindowFunctions.FindGameWindow();
|
||||||
if (wnd == IntPtr.Zero) return;
|
if (wnd == IntPtr.Zero) return;
|
||||||
var rect = LastWindowRect.Value;
|
var rect = LastWindowRect.Value;
|
||||||
if (rect is { z: 0f, w: 0f }) return;
|
if (rect is { z: 0f, w: 0f }) return;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using UnityEngine.EventSystems;
|
|||||||
using UnityEngine.Serialization;
|
using UnityEngine.Serialization;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using UXAssist.Common;
|
using UXAssist.Common;
|
||||||
|
using Object = UnityEngine.Object;
|
||||||
|
|
||||||
namespace UXAssist.Patches;
|
namespace UXAssist.Patches;
|
||||||
|
|
||||||
@@ -524,11 +525,11 @@ public static class LogisticsPatch
|
|||||||
|
|
||||||
public static void InitGUI()
|
public static void InitGUI()
|
||||||
{
|
{
|
||||||
_stationTipRoot = UnityEngine.Object.Instantiate(GameObject.Find("UI Root/Overlay Canvas/In Game/Scene UIs/Vein Marks"),
|
_stationTipRoot = Object.Instantiate(GameObject.Find("UI Root/Overlay Canvas/In Game/Scene UIs/Vein Marks"),
|
||||||
GameObject.Find("UI Root/Overlay Canvas/In Game/Scene UIs").transform);
|
GameObject.Find("UI Root/Overlay Canvas/In Game/Scene UIs").transform);
|
||||||
_stationTipRoot.name = "stationTip";
|
_stationTipRoot.name = "stationTip";
|
||||||
UnityEngine.Object.Destroy(_stationTipRoot.GetComponent<UIVeinDetail>());
|
Object.Destroy(_stationTipRoot.GetComponent<UIVeinDetail>());
|
||||||
_tipPrefab = UnityEngine.Object.Instantiate(GameObject.Find("UI Root/Overlay Canvas/In Game/Scene UIs/Vein Marks/vein-tip-prefab"), _stationTipRoot.transform);
|
_tipPrefab = Object.Instantiate(GameObject.Find("UI Root/Overlay Canvas/In Game/Scene UIs/Vein Marks/vein-tip-prefab"), _stationTipRoot.transform);
|
||||||
_tipPrefab.name = "tipPrefab";
|
_tipPrefab.name = "tipPrefab";
|
||||||
var sliderBgPrefab = GameObject.Find("UI Root/Overlay Canvas/In Game/Windows/Station Window/storage-box-0/slider-bg");
|
var sliderBgPrefab = GameObject.Find("UI Root/Overlay Canvas/In Game/Windows/Station Window/storage-box-0/slider-bg");
|
||||||
var image = _tipPrefab.GetComponent<Image>();
|
var image = _tipPrefab.GetComponent<Image>();
|
||||||
@@ -539,14 +540,14 @@ public static class LogisticsPatch
|
|||||||
rectTrans.localPosition = new Vector3(200f, 800f, 0);
|
rectTrans.localPosition = new Vector3(200f, 800f, 0);
|
||||||
rectTrans.sizeDelta = new Vector2(150f, 160f);
|
rectTrans.sizeDelta = new Vector2(150f, 160f);
|
||||||
rectTrans.pivot = new Vector2(0.5f, 0.5f);
|
rectTrans.pivot = new Vector2(0.5f, 0.5f);
|
||||||
UnityEngine.Object.Destroy(_tipPrefab.GetComponent<UIVeinDetailNode>());
|
Object.Destroy(_tipPrefab.GetComponent<UIVeinDetailNode>());
|
||||||
var infoText = _tipPrefab.transform.Find("info-text").gameObject;
|
var infoText = _tipPrefab.transform.Find("info-text").gameObject;
|
||||||
|
|
||||||
for (var index = 0; index < StorageSlotCount; ++index)
|
for (var index = 0; index < StorageSlotCount; ++index)
|
||||||
{
|
{
|
||||||
var y = -5f - 35f * index;
|
var y = -5f - 35f * index;
|
||||||
var iconTrans = _tipPrefab.transform.Find("icon");
|
var iconTrans = _tipPrefab.transform.Find("icon");
|
||||||
var itemIcon = UnityEngine.Object.Instantiate(iconTrans.gameObject, new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
var itemIcon = Object.Instantiate(iconTrans.gameObject, new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
||||||
itemIcon.name = "icon" + index;
|
itemIcon.name = "icon" + index;
|
||||||
rectTrans = (RectTransform)itemIcon.transform;
|
rectTrans = (RectTransform)itemIcon.transform;
|
||||||
rectTrans.sizeDelta = new Vector2(30f, 30f);
|
rectTrans.sizeDelta = new Vector2(30f, 30f);
|
||||||
@@ -555,7 +556,7 @@ public static class LogisticsPatch
|
|||||||
rectTrans.pivot = new Vector2(0f, 1f);
|
rectTrans.pivot = new Vector2(0f, 1f);
|
||||||
rectTrans.anchoredPosition3D = new Vector3(0, y, 0);
|
rectTrans.anchoredPosition3D = new Vector3(0, y, 0);
|
||||||
|
|
||||||
var sliderBg = UnityEngine.Object.Instantiate(sliderBgPrefab.gameObject, new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
var sliderBg = Object.Instantiate(sliderBgPrefab.gameObject, new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
||||||
sliderBg.name = "sliderBg" + index;
|
sliderBg.name = "sliderBg" + index;
|
||||||
rectTrans = (RectTransform)sliderBg.transform;
|
rectTrans = (RectTransform)sliderBg.transform;
|
||||||
rectTrans.sizeDelta = new Vector2(StorageSliderWidth, StorageSliderHeight);
|
rectTrans.sizeDelta = new Vector2(StorageSliderWidth, StorageSliderHeight);
|
||||||
@@ -583,12 +584,12 @@ public static class LogisticsPatch
|
|||||||
rectTrans.localPosition = new Vector3(0f, 0f, 0f);
|
rectTrans.localPosition = new Vector3(0f, 0f, 0f);
|
||||||
image = rectTrans.GetComponent<Image>();
|
image = rectTrans.GetComponent<Image>();
|
||||||
image.color = new Color(image.color.r, image.color.g, image.color.b, 0.15f);
|
image.color = new Color(image.color.r, image.color.g, image.color.b, 0.15f);
|
||||||
UnityEngine.Object.Destroy(sliderBg.GetComponent<Slider>());
|
Object.Destroy(sliderBg.GetComponent<Slider>());
|
||||||
UnityEngine.Object.Destroy(sliderBg.transform.Find("thumb").gameObject);
|
Object.Destroy(sliderBg.transform.Find("thumb").gameObject);
|
||||||
UnityEngine.Object.Destroy(sliderBg.transform.Find("speed-text").gameObject);
|
Object.Destroy(sliderBg.transform.Find("speed-text").gameObject);
|
||||||
sliderBg.gameObject.SetActive(false);
|
sliderBg.gameObject.SetActive(false);
|
||||||
|
|
||||||
var countText = UnityEngine.Object.Instantiate(infoText, Vector3.zero, Quaternion.identity, _tipPrefab.transform);
|
var countText = Object.Instantiate(infoText, Vector3.zero, Quaternion.identity, _tipPrefab.transform);
|
||||||
countText.name = "countText" + index;
|
countText.name = "countText" + index;
|
||||||
var text = countText.GetComponent<Text>();
|
var text = countText.GetComponent<Text>();
|
||||||
text.fontSize = 18;
|
text.fontSize = 18;
|
||||||
@@ -600,9 +601,9 @@ public static class LogisticsPatch
|
|||||||
rectTrans.anchorMin = new Vector2(0f, 1f);
|
rectTrans.anchorMin = new Vector2(0f, 1f);
|
||||||
rectTrans.pivot = new Vector2(0f, 1f);
|
rectTrans.pivot = new Vector2(0f, 1f);
|
||||||
rectTrans.anchoredPosition3D = new Vector3(30f, y, 0);
|
rectTrans.anchoredPosition3D = new Vector3(30f, y, 0);
|
||||||
UnityEngine.Object.Destroy(countText.GetComponent<Shadow>());
|
Object.Destroy(countText.GetComponent<Shadow>());
|
||||||
|
|
||||||
var stateLocal = UnityEngine.Object.Instantiate(iconTrans.gameObject, new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
var stateLocal = Object.Instantiate(iconTrans.gameObject, new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
||||||
stateLocal.name = "iconLocal" + index;
|
stateLocal.name = "iconLocal" + index;
|
||||||
stateLocal.GetComponent<Image>().material = null;
|
stateLocal.GetComponent<Image>().material = null;
|
||||||
rectTrans = (RectTransform)stateLocal.transform;
|
rectTrans = (RectTransform)stateLocal.transform;
|
||||||
@@ -611,7 +612,7 @@ public static class LogisticsPatch
|
|||||||
rectTrans.anchorMin = new Vector2(0f, 1f);
|
rectTrans.anchorMin = new Vector2(0f, 1f);
|
||||||
rectTrans.pivot = new Vector2(0f, 1f);
|
rectTrans.pivot = new Vector2(0f, 1f);
|
||||||
rectTrans.anchoredPosition3D = new Vector3(102f, y, 0);
|
rectTrans.anchoredPosition3D = new Vector3(102f, y, 0);
|
||||||
var stateRemote = UnityEngine.Object.Instantiate(iconTrans.gameObject, new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
var stateRemote = Object.Instantiate(iconTrans.gameObject, new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
||||||
stateRemote.name = "iconRemote" + index;
|
stateRemote.name = "iconRemote" + index;
|
||||||
stateRemote.GetComponent<Image>().material = null;
|
stateRemote.GetComponent<Image>().material = null;
|
||||||
rectTrans = (RectTransform)stateRemote.transform;
|
rectTrans = (RectTransform)stateRemote.transform;
|
||||||
@@ -624,12 +625,12 @@ public static class LogisticsPatch
|
|||||||
|
|
||||||
for (var i = 0; i < CarrierSlotCount; i++)
|
for (var i = 0; i < CarrierSlotCount; i++)
|
||||||
{
|
{
|
||||||
var iconObj = UnityEngine.Object.Instantiate(GameObject.Find("UI Root/Overlay Canvas/In Game/Top Tips/Entity Briefs/brief-info-top/brief-info/content/icons/icon"),
|
var iconObj = Object.Instantiate(GameObject.Find("UI Root/Overlay Canvas/In Game/Top Tips/Entity Briefs/brief-info-top/brief-info/content/icons/icon"),
|
||||||
new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
||||||
UnityEngine.Object.Destroy(iconObj.transform.Find("count-text").gameObject);
|
Object.Destroy(iconObj.transform.Find("count-text").gameObject);
|
||||||
UnityEngine.Object.Destroy(iconObj.transform.Find("bg").gameObject);
|
Object.Destroy(iconObj.transform.Find("bg").gameObject);
|
||||||
UnityEngine.Object.Destroy(iconObj.transform.Find("inc").gameObject);
|
Object.Destroy(iconObj.transform.Find("inc").gameObject);
|
||||||
UnityEngine.Object.Destroy(iconObj.GetComponent<UIIconCountInc>());
|
Object.Destroy(iconObj.GetComponent<UIIconCountInc>());
|
||||||
|
|
||||||
iconObj.name = "carrierIcon" + i;
|
iconObj.name = "carrierIcon" + i;
|
||||||
iconObj.GetComponent<Image>().sprite = LogisticsExtraItemSprites[i];
|
iconObj.GetComponent<Image>().sprite = LogisticsExtraItemSprites[i];
|
||||||
@@ -640,8 +641,8 @@ public static class LogisticsPatch
|
|||||||
rectTrans.pivot = new Vector2(0f, 1f);
|
rectTrans.pivot = new Vector2(0f, 1f);
|
||||||
rectTrans.anchoredPosition3D = new Vector3(0f, -180f, 0);
|
rectTrans.anchoredPosition3D = new Vector3(0f, -180f, 0);
|
||||||
|
|
||||||
var countText = UnityEngine.Object.Instantiate(infoText, Vector3.zero, Quaternion.identity, iconObj.transform);
|
var countText = Object.Instantiate(infoText, Vector3.zero, Quaternion.identity, iconObj.transform);
|
||||||
UnityEngine.Object.Destroy(countText.GetComponent<Shadow>());
|
Object.Destroy(countText.GetComponent<Shadow>());
|
||||||
countText.name = "carrierTotalCountText";
|
countText.name = "carrierTotalCountText";
|
||||||
var text = countText.GetComponent<Text>();
|
var text = countText.GetComponent<Text>();
|
||||||
text.fontSize = 22;
|
text.fontSize = 22;
|
||||||
@@ -657,8 +658,8 @@ public static class LogisticsPatch
|
|||||||
|
|
||||||
if (i >= CarrierSlotCount - 1) continue;
|
if (i >= CarrierSlotCount - 1) continue;
|
||||||
|
|
||||||
countText = UnityEngine.Object.Instantiate(infoText, Vector3.zero, Quaternion.identity, iconObj.transform);
|
countText = Object.Instantiate(infoText, Vector3.zero, Quaternion.identity, iconObj.transform);
|
||||||
UnityEngine.Object.Destroy(countText.GetComponent<Shadow>());
|
Object.Destroy(countText.GetComponent<Shadow>());
|
||||||
|
|
||||||
countText.name = "carrierIdleCountText";
|
countText.name = "carrierIdleCountText";
|
||||||
text = countText.GetComponent<Text>();
|
text = countText.GetComponent<Text>();
|
||||||
@@ -691,7 +692,7 @@ public static class LogisticsPatch
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UnityEngine.Object.Destroy(stationTip);
|
Object.Destroy(stationTip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -707,7 +708,7 @@ public static class LogisticsPatch
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tempTip = UnityEngine.Object.Instantiate(_tipPrefab, _stationTipRoot.transform);
|
var tempTip = Object.Instantiate(_tipPrefab, _stationTipRoot.transform);
|
||||||
var stationTip = tempTip.AddComponent<StationTip>();
|
var stationTip = tempTip.AddComponent<StationTip>();
|
||||||
stationTip.InitStationTip();
|
stationTip.InitStationTip();
|
||||||
return stationTip;
|
return stationTip;
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ public static class TechPatch
|
|||||||
}
|
}
|
||||||
if (!enough)
|
if (!enough)
|
||||||
{
|
{
|
||||||
UIRealtimeTip.Popup("元数据不足".Translate(), true, 0);
|
UIRealtimeTip.Popup("元数据不足".Translate());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Cryptography;
|
|
||||||
using BepInEx.Configuration;
|
using BepInEx.Configuration;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public class MyKeyBinder : MonoBehaviour
|
|||||||
setTheKeyToggle.isOn = false;
|
setTheKeyToggle.isOn = false;
|
||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
else if (!this.inputUIButton.highlighted)
|
else if (!inputUIButton.highlighted)
|
||||||
{
|
{
|
||||||
setTheKeyToggle.isOn = false;
|
setTheKeyToggle.isOn = false;
|
||||||
Reset();
|
Reset();
|
||||||
@@ -173,7 +173,7 @@ public class MyKeyBinder : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (Input.GetKey(modKey))
|
if (Input.GetKey(modKey))
|
||||||
{
|
{
|
||||||
mod += "+" + modKey.ToString();
|
mod += "+" + modKey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using HarmonyLib;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using BepInEx.Configuration;
|
using BepInEx.Configuration;
|
||||||
|
using HarmonyLib;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Events;
|
using UnityEngine.Events;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UXAssist.UI;
|
|
||||||
using UXAssist.Common;
|
using UXAssist.Common;
|
||||||
using UXAssist.Functions;
|
using UXAssist.Functions;
|
||||||
|
using UXAssist.ModsCompat;
|
||||||
using UXAssist.Patches;
|
using UXAssist.Patches;
|
||||||
|
using UXAssist.UI;
|
||||||
|
|
||||||
namespace UXAssist;
|
namespace UXAssist;
|
||||||
|
|
||||||
@@ -47,7 +48,8 @@ public static class UIConfigWindow
|
|||||||
I18N.Add("First 8 CPUs", "First 8 CPUs", "前8个CPU");
|
I18N.Add("First 8 CPUs", "First 8 CPUs", "前8个CPU");
|
||||||
I18N.Add("First CPU only", "First CPU only", "仅第一个CPU");
|
I18N.Add("First CPU only", "First CPU only", "仅第一个CPU");
|
||||||
I18N.Add("All P-Cores", "All P-Cores", "所有性能(P)核心");
|
I18N.Add("All P-Cores", "All P-Cores", "所有性能(P)核心");
|
||||||
I18N.Add("All E-Cores", "All E-Cores", "所有效率(E)核心");
|
I18N.Add("All E-Cores", "All E-Cores", "所有能效(E)核心");
|
||||||
|
I18N.Add("CPU Info", "CPU Info", "CPU信息");
|
||||||
I18N.Add("Unlimited interactive range", "Unlimited interactive range", "无限交互距离");
|
I18N.Add("Unlimited interactive range", "Unlimited interactive range", "无限交互距离");
|
||||||
I18N.Add("Night Light", "Sunlight at night", "夜间日光灯");
|
I18N.Add("Night Light", "Sunlight at night", "夜间日光灯");
|
||||||
I18N.Add("Angle X:", "Angle X:", "入射角度X:");
|
I18N.Add("Angle X:", "Angle X:", "入射角度X:");
|
||||||
@@ -179,12 +181,7 @@ public static class UIConfigWindow
|
|||||||
wnd.AddInputField(x + 2f, y, 200f, tab1, GamePatch.DefaultProfileName, 15, "input-profile-save-folder");
|
wnd.AddInputField(x + 2f, y, 200f, tab1, GamePatch.DefaultProfileName, 15, "input-profile-save-folder");
|
||||||
y += 18f;
|
y += 18f;
|
||||||
}
|
}
|
||||||
/*
|
if (!BulletTimeWrapper.HasBulletTime)
|
||||||
x = 400f;
|
|
||||||
y = 10f;
|
|
||||||
wnd.AddButton(x, y, tab1, "Show CPU Info", 16, "button-show-cpu-info", WindowFunctions.ShowCPUInfo);
|
|
||||||
*/
|
|
||||||
if (!ModsCompat.BulletTimeWrapper.HasBulletTime)
|
|
||||||
{
|
{
|
||||||
y += 36f;
|
y += 36f;
|
||||||
txt = wnd.AddText2(x + 2f, y, tab1, "Logical Frame Rate", 15, "game-frame-rate");
|
txt = wnd.AddText2(x + 2f, y, tab1, "Logical Frame Rate", 15, "game-frame-rate");
|
||||||
@@ -213,6 +210,8 @@ public static class UIConfigWindow
|
|||||||
affinities[2] = details.ThreadCount > 16 ? "First 8 CPUs" : "First CPU only";
|
affinities[2] = details.ThreadCount > 16 ? "First 8 CPUs" : "First CPU only";
|
||||||
y += 36f;
|
y += 36f;
|
||||||
wnd.AddComboBox(x + 2f, y, tab1, "Enabled CPUs").WithItems(affinities).WithSize(200f, 0f).WithConfigEntry(WindowFunctions.ProcessAffinity);
|
wnd.AddComboBox(x + 2f, y, tab1, "Enabled CPUs").WithItems(affinities).WithSize(200f, 0f).WithConfigEntry(WindowFunctions.ProcessAffinity);
|
||||||
|
y += 36f;
|
||||||
|
((RectTransform)wnd.AddButton(x, y, tab1, "CPU Info", 16, "button-show-cpu-info", WindowFunctions.ShowCPUInfo).transform).sizeDelta = new Vector2(100f, 25f);
|
||||||
|
|
||||||
var tab2 = wnd.AddTab(trans, "Planet/Factory");
|
var tab2 = wnd.AddTab(trans, "Planet/Factory");
|
||||||
x = 0f;
|
x = 0f;
|
||||||
@@ -288,14 +287,14 @@ public static class UIConfigWindow
|
|||||||
var cb1 = wnd.AddCheckBox(x + 20f, y, tab2, LogisticsPatch.RealtimeLogisticsInfoPanelBarsEnabled, "Show status bars for storage items", 13);
|
var cb1 = wnd.AddCheckBox(x + 20f, y, tab2, LogisticsPatch.RealtimeLogisticsInfoPanelBarsEnabled, "Show status bars for storage items", 13);
|
||||||
EventHandler anySettingsChanged = (_, _) =>
|
EventHandler anySettingsChanged = (_, _) =>
|
||||||
{
|
{
|
||||||
if (ModsCompat.AuxilaryfunctionWrapper.ShowStationInfo == null)
|
if (AuxilaryfunctionWrapper.ShowStationInfo == null)
|
||||||
{
|
{
|
||||||
cb0.SetEnable(true);
|
cb0.SetEnable(true);
|
||||||
cb1.SetEnable(LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.Value);
|
cb1.SetEnable(LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.Value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var on = !ModsCompat.AuxilaryfunctionWrapper.ShowStationInfo.Value;
|
var on = !AuxilaryfunctionWrapper.ShowStationInfo.Value;
|
||||||
cb0.SetEnable(on);
|
cb0.SetEnable(on);
|
||||||
cb1.SetEnable(on & LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.Value);
|
cb1.SetEnable(on & LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.Value);
|
||||||
if (!on)
|
if (!on)
|
||||||
@@ -303,10 +302,10 @@ public static class UIConfigWindow
|
|||||||
LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.Value = false;
|
LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.Value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (ModsCompat.AuxilaryfunctionWrapper.ShowStationInfo != null)
|
if (AuxilaryfunctionWrapper.ShowStationInfo != null)
|
||||||
{
|
{
|
||||||
ModsCompat.AuxilaryfunctionWrapper.ShowStationInfo.SettingChanged += anySettingsChanged;
|
AuxilaryfunctionWrapper.ShowStationInfo.SettingChanged += anySettingsChanged;
|
||||||
wnd.OnFree += () => { ModsCompat.AuxilaryfunctionWrapper.ShowStationInfo.SettingChanged -= anySettingsChanged; };
|
wnd.OnFree += () => { AuxilaryfunctionWrapper.ShowStationInfo.SettingChanged -= anySettingsChanged; };
|
||||||
}
|
}
|
||||||
LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.SettingChanged += anySettingsChanged;
|
LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.SettingChanged += anySettingsChanged;
|
||||||
wnd.OnFree += () => { LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.SettingChanged -= anySettingsChanged; };
|
wnd.OnFree += () => { LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.SettingChanged -= anySettingsChanged; };
|
||||||
@@ -415,7 +414,6 @@ public static class UIConfigWindow
|
|||||||
uiGame.CloseEnemyBriefInfo();
|
uiGame.CloseEnemyBriefInfo();
|
||||||
uiGame.OpenCommunicatorWindow(5);
|
uiGame.OpenCommunicatorWindow(5);
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void UpdateUI()
|
private static void UpdateUI()
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.IO;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using BepInEx;
|
using BepInEx;
|
||||||
using BepInEx.Configuration;
|
using BepInEx.Configuration;
|
||||||
|
using BepInEx.Logging;
|
||||||
using CommonAPI;
|
using CommonAPI;
|
||||||
using CommonAPI.Systems;
|
using CommonAPI.Systems;
|
||||||
using crecheng.DSPModSave;
|
using crecheng.DSPModSave;
|
||||||
@@ -13,6 +14,7 @@ using UXAssist.Common;
|
|||||||
using UXAssist.Functions;
|
using UXAssist.Functions;
|
||||||
using UXAssist.Patches;
|
using UXAssist.Patches;
|
||||||
using UXAssist.UI;
|
using UXAssist.UI;
|
||||||
|
using Util = UXAssist.Common.Util;
|
||||||
|
|
||||||
namespace UXAssist;
|
namespace UXAssist;
|
||||||
|
|
||||||
@@ -22,7 +24,7 @@ namespace UXAssist;
|
|||||||
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
|
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
|
||||||
public class UXAssist : BaseUnityPlugin, IModCanSave
|
public class UXAssist : BaseUnityPlugin, IModCanSave
|
||||||
{
|
{
|
||||||
public new static readonly BepInEx.Logging.ManualLogSource Logger =
|
public new static readonly ManualLogSource Logger =
|
||||||
BepInEx.Logging.Logger.CreateLogSource(PluginInfo.PLUGIN_NAME);
|
BepInEx.Logging.Logger.CreateLogSource(PluginInfo.PLUGIN_NAME);
|
||||||
|
|
||||||
private static bool _configWinInitialized;
|
private static bool _configWinInitialized;
|
||||||
@@ -171,10 +173,10 @@ public class UXAssist : BaseUnityPlugin, IModCanSave
|
|||||||
|
|
||||||
UIConfigWindow.Init();
|
UIConfigWindow.Init();
|
||||||
|
|
||||||
_patches = Common.Util.GetTypesFiltered(Assembly.GetExecutingAssembly(),
|
_patches = Util.GetTypesFiltered(Assembly.GetExecutingAssembly(),
|
||||||
t => string.Equals(t.Namespace, "UXAssist.Patches", StringComparison.Ordinal) || string.Equals(t.Namespace, "UXAssist.Functions", StringComparison.Ordinal));
|
t => string.Equals(t.Namespace, "UXAssist.Patches", StringComparison.Ordinal) || string.Equals(t.Namespace, "UXAssist.Functions", StringComparison.Ordinal));
|
||||||
_patches?.Do(type => type.GetMethod("Init")?.Invoke(null, null));
|
_patches?.Do(type => type.GetMethod("Init")?.Invoke(null, null));
|
||||||
_compats = Common.Util.GetTypesInNamespace(Assembly.GetExecutingAssembly(), "UXAssist.ModsCompat");
|
_compats = Util.GetTypesInNamespace(Assembly.GetExecutingAssembly(), "UXAssist.ModsCompat");
|
||||||
_compats?.Do(type => type.GetMethod("Init")?.Invoke(null, null));
|
_compats?.Do(type => type.GetMethod("Init")?.Invoke(null, null));
|
||||||
|
|
||||||
I18N.Apply();
|
I18N.Apply();
|
||||||
|
|||||||
Reference in New Issue
Block a user