mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-20 01:46:21 +00:00
2021.4.12s support
This commit is contained in:
1 parent
44403911a9
commit
339ee008ff
6 files changed
+28
-48
No files matched your search
+2
-7
@@ -1,16 +1,11 @@
|
||||
<Project>
|
||||
<PropertyGroup Condition="'$(GamePlatform)' == 'Steam'">
|
||||
<GameVersion>2021.3.31.3s</GameVersion>
|
||||
<GameVersion>2021.4.12s</GameVersion>
|
||||
<DefineConstants>$(DefineConstants);STEAM</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GamePlatform)' == 'Itch'">
|
||||
<GameVersion>2021.3.5i</GameVersion>
|
||||
<DefineConstants>$(DefineConstants);ITCH</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Mappings>NuclearPowered/Mappings:0.3.0</Mappings>
|
||||
<Mappings>NuclearPowered/Mappings:0.4.0</Mappings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using BepInEx;
|
||||
using BepInEx.IL2CPP;
|
||||
using InnerNet;
|
||||
using Reactor.Extensions;
|
||||
using Reactor.Networking;
|
||||
using UnhollowerBaseLib.Attributes;
|
||||
|
||||
@@ -1,41 +1,24 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace Reactor.Extensions
|
||||
{
|
||||
public static class TextRendererExtensions
|
||||
{
|
||||
public static TextRendererPrefab Prefab { get; internal set; }
|
||||
private static readonly Lazy<TextAsset> _fontData = new Lazy<TextAsset>(() => FontCache.Instance.DefaultFonts.ToArray().Single(x => x.name == "Arial"));
|
||||
|
||||
public static TextRenderer AddTextRenderer(this GameObject gameObject)
|
||||
{
|
||||
if (Prefab == null)
|
||||
{
|
||||
throw new ArgumentException("TextRenderer prefab hasn't been initialized yet");
|
||||
}
|
||||
|
||||
var renderer = gameObject.AddComponent<MeshRenderer>();
|
||||
renderer.material = Prefab.Material;
|
||||
renderer.material = new Material(Shader.Find("Unlit/VectFontShader"));
|
||||
|
||||
gameObject.AddComponent<MeshFilter>();
|
||||
|
||||
var textRenderer = gameObject.AddComponent<TextRenderer>();
|
||||
textRenderer.FontData = Prefab.FontData;
|
||||
textRenderer.FontData = _fontData.Value;
|
||||
|
||||
return textRenderer;
|
||||
}
|
||||
}
|
||||
|
||||
public class TextRendererPrefab
|
||||
{
|
||||
public Material Material { get; }
|
||||
public TextAsset FontData { get; }
|
||||
|
||||
internal TextRendererPrefab(TextRenderer textRenderer)
|
||||
{
|
||||
Material = Object.Instantiate(textRenderer.GetComponent<MeshRenderer>().material).DontDestroy();
|
||||
FontData = Object.Instantiate(textRenderer.FontData).DontDestroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.Linq;
|
||||
using HarmonyLib;
|
||||
using Hazel.Dtls;
|
||||
using Il2CppSystem.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Reactor.Networking.Patches
|
||||
@@ -8,13 +6,11 @@ namespace Reactor.Networking.Patches
|
||||
internal static class AuthPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(X509Certificate2Collection), nameof(X509Certificate2Collection.Contains))]
|
||||
public static class AcceptCustomCertificatesPatch
|
||||
public static class AcceptCustomerCertificatesPatch
|
||||
{
|
||||
public static bool Prefix(ref bool __result)
|
||||
public static bool Prefix(X509Certificate2Collection __instance, ref bool __result)
|
||||
{
|
||||
var caller = new Il2CppSystem.Diagnostics.StackTrace().GetFrames().First().GetMethod();
|
||||
|
||||
if (caller.DeclaringType.FullName == typeof(DtlsUnityConnection).FullName && caller.Name == nameof(DtlsUnityConnection.ProcessHandshake))
|
||||
if (AuthManager.Instance && AuthManager.Instance.connection != null && AuthManager.Instance.connection.serverCertificates == __instance)
|
||||
{
|
||||
__result = true;
|
||||
return false;
|
||||
|
||||
@@ -4,6 +4,7 @@ using BepInEx;
|
||||
using BepInEx.IL2CPP;
|
||||
using HarmonyLib;
|
||||
using Reactor.Extensions;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
@@ -11,11 +12,11 @@ namespace Reactor.Patches
|
||||
{
|
||||
public static class ReactorVersionShower
|
||||
{
|
||||
public static TextRenderer Text { get; private set; }
|
||||
public static TextMeshPro Text { get; private set; }
|
||||
|
||||
public static event TextUpdatedHandler TextUpdated;
|
||||
|
||||
public delegate void TextUpdatedHandler(TextRenderer text);
|
||||
public delegate void TextUpdatedHandler(TextMeshPro text);
|
||||
|
||||
internal static void Initialize()
|
||||
{
|
||||
@@ -25,8 +26,6 @@ namespace Reactor.Patches
|
||||
if (!original)
|
||||
return;
|
||||
|
||||
TextRendererExtensions.Prefab ??= new TextRendererPrefab(original.gameObject.GetComponentInChildren<TextRenderer>());
|
||||
|
||||
var gameObject = new GameObject("ReactorVersion " + Guid.NewGuid());
|
||||
gameObject.transform.parent = original.transform.parent;
|
||||
|
||||
@@ -34,14 +33,22 @@ namespace Reactor.Patches
|
||||
|
||||
aspectPosition.Alignment = AspectPosition.EdgeAlignments.LeftTop;
|
||||
|
||||
var position = original.GetComponent<AspectPosition>().DistanceFromEdge;
|
||||
position.y += 0.2f;
|
||||
var originalAspectPosition = original.GetComponent<AspectPosition>();
|
||||
var originalPosition = originalAspectPosition.DistanceFromEdge;
|
||||
originalPosition.y = 0.15f;
|
||||
originalAspectPosition.DistanceFromEdge = originalPosition;
|
||||
originalAspectPosition.AdjustPosition();
|
||||
|
||||
var position = originalPosition;
|
||||
position.x += 10.075f - 0.1f;
|
||||
position.y += 2.75f - 0.15f;
|
||||
position.z -= 1;
|
||||
aspectPosition.DistanceFromEdge = position;
|
||||
|
||||
aspectPosition.AdjustPosition();
|
||||
|
||||
Text = gameObject.AddTextRenderer();
|
||||
Text.scale = 0.65f;
|
||||
Text = gameObject.AddComponent<TextMeshPro>();
|
||||
Text.fontSize = 2;
|
||||
|
||||
UpdateText();
|
||||
}));
|
||||
@@ -49,9 +56,9 @@ namespace Reactor.Patches
|
||||
|
||||
public static void UpdateText()
|
||||
{
|
||||
Text.Text = "Reactor " + typeof(ReactorPlugin).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
|
||||
Text.Text += "\nBepInEx: " + Paths.BepInExVersion;
|
||||
Text.Text += "\nMods: " + IL2CPPChainloader.Instance.Plugins.Count;
|
||||
Text.text = "Reactor " + typeof(ReactorPlugin).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
|
||||
Text.text += "\nBepInEx: " + Paths.BepInExVersion;
|
||||
Text.text += "\nMods: " + IL2CPPChainloader.Instance.Plugins.Count;
|
||||
TextUpdated?.Invoke(Text);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ public sealed class SetupAmongUsTask : AsyncFrostingTask<BuildContext>
|
||||
{
|
||||
public const uint AppId = 945360;
|
||||
public const uint DepotId = 945361;
|
||||
public const ulong ManifestId = 3941730972865408291; // 2021.3.31.3s
|
||||
public const ulong ManifestId = 2725166875026424465; // 2021.4.12s
|
||||
|
||||
public override async Task RunAsync(BuildContext context)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user