mark obsolete

This commit is contained in:
2024-01-08 23:08:02 +08:00
parent b3db66ba71
commit acff196bae
4 changed files with 32 additions and 1 deletions
+2
View File
@@ -1,7 +1,9 @@
# LabOpt
#### Performance optimizations for Matrix Labs
#### Marked as obsoleted temporarily, needs more investigation about LabComponent's mechanism
#### 优化研究站性能
#### 暂时标识为过期,需要更多关于LabComponent机制的研究
## Updates
* 0.3.6
+2
View File
@@ -47,7 +47,9 @@ Some tweaks for mecha drones and build functions(Successor to FastDrones MOD)
# [LabOpt](LabOpt)
Performance optimizations for Matrix Labs
Marked as obsoleted temporarily, needs more investigation about LabComponent's mechanism
优化研究站性能
暂时标识为过期,需要更多关于LabComponent机制的研究
# [PoolOpt](PoolOpt)
+27
View File
@@ -281,4 +281,31 @@ public class UXAssist : BaseUnityPlugin
buildings[i].index = i;
}
}
// Can set belt icon tag to float, and increase maximum belt icon tag length to 8
[HarmonyPostfix]
[HarmonyPatch(typeof(UIBeltWindow), nameof(UIBeltWindow._OnCreate))]
private static void UIBeltWindow_OnCreate_Postfix(UIBeltWindow __instance)
{
__instance.iconTagCountInput.contentType = InputField.ContentType.DecimalNumber;
__instance.iconTagCountInput.characterLimit = 8;
}
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIBeltWindow), nameof(UIBeltWindow._OnUpdate))]
private static IEnumerable<CodeInstruction> UIBeltWindow_OnUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
{
var matcher = new CodeMatcher(instructions, generator);
matcher.End().MatchBack(false,
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(UIBeltWindow), nameof(UIBeltWindow.iconTagCountInput))),
new CodeMatch(ci => ci.opcode == OpCodes.Ldloca || ci.opcode == OpCodes.Ldloca_S),
new CodeMatch(OpCodes.Call, AccessTools.Method(typeof(float), nameof(float.ToString), []))
);
matcher.Advance(2).InsertAndAdvance(
new CodeInstruction(OpCodes.Ldstr, "G8")
).Set(
OpCodes.Call, AccessTools.Method(typeof(float), nameof(float.ToString), [typeof(string)])
);
return matcher.InstructionEnumeration();
}
}
+1 -1
View File
@@ -15,7 +15,7 @@
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="0.10.28.21219-r.0" />
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" />
</ItemGroup>