mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 06:13:36 +08:00
mark obsolete
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user