Initial Commit

This commit is contained in:
copecone committed 2026-05-21 11:38:31 +09:00
commit 44a22ae103
19 files changed
+772

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
using HarmonyLib;
using UnityEngine;
using UnityEngine.UI;
namespace ADOFAIRenderer.Patch.ClassPatch
{
[HarmonyPatch(typeof(scnEditor))]
// ReSharper disable once InconsistentNaming
public static class scnEditorPatch
{
[HarmonyPostfix]
[HarmonyPatch("Start")]
// ReSharper disable once InconsistentNaming
public static void AddButtonRender(scnEditor __instance)
{
var cloneTarget = __instance.buttonExit!.gameObject;
var buttonContainer = cloneTarget.transform.parent!;
var buttonObj = Object.Instantiate(cloneTarget, buttonContainer)!;
buttonObj.name = "buttonRender";
var button = buttonObj.GetComponent<Button>()!;
// Clear persistent and non-persistent listeners from the original button
button.onClick = new Button.ButtonClickedEvent();
button.onClick.AddListener(RenderMod.StartRender);
// The button root has an Image component for the background (rounded box).
// We want to change the icon sprite, which is on a child GameObject.
var images = buttonObj.GetComponentsInChildren<Image>();
if (images.Length <= 1) return;
// ReSharper disable once Unity.UnknownResource
// images[0] is the background on the root, images[1] is the icon on the child
var sprite = Resources.Load<Sprite>("LevelEditor/LevelEvents/MoveCamera");
if (sprite != null)
{
var iconImage = images[1];
iconImage.sprite = sprite;
iconImage.rectTransform.sizeDelta = new Vector2(24, 24);
}
}
}
}
+16
View File
@@ -0,0 +1,16 @@
using HarmonyLib;
namespace ADOFAIRenderer.Patch.ClassPatch
{
[HarmonyPatch(typeof(scrController))]
// ReSharper disable once InconsistentNaming
public static class scrControllerPatch
{
[HarmonyPrefix]
[HarmonyPatch("TogglePauseGame")]
public static bool PreventPause()
{
return !RenderMod.IsRendering;
}
}
}
+21
View File
@@ -0,0 +1,21 @@
using ADOFAIRenderer.Component;
using HarmonyLib;
namespace ADOFAIRenderer.Patch.ClassPatch
{
[HarmonyPatch(typeof(scrPlayerManager))]
// ReSharper disable once InconsistentNaming
public static class scrPlayerManagerPatch
{
[HarmonyPrefix]
[HarmonyPatch("AnyValidInputWasTriggered")]
// ReSharper disable once InconsistentNaming
private static bool IgnoreInput(ref bool __result)
{
if (!RenderMod.IsRendering) return true;
__result = RenderManager.Countdown == 0;
return false;
}
}
}
+20
View File
@@ -0,0 +1,20 @@
using ADOFAIRenderer.Component;
using HarmonyLib;
namespace ADOFAIRenderer.Patch.ClassPatch
{
[HarmonyPatch(typeof(scrPressToStart))]
// ReSharper disable once InconsistentNaming
public class scrPressToStartPatch
{
[HarmonyPrefix]
[HarmonyPatch("ShowText")]
private static bool PreventShowText()
{
if (!RenderManager.SkipPressToStart) return true;
RenderManager.SkipPressToStart = false;
return false;
}
}
}
+26
View File
@@ -0,0 +1,26 @@
using System.Diagnostics.CodeAnalysis;
using ADOFAIRenderer.Component;
using HarmonyLib;
using UnityEngine;
using UnityEngine.UI;
namespace ADOFAIRenderer.Patch.ClassPatch
{
[HarmonyPatch(typeof(scrShowIfDebug))]
// ReSharper disable once InconsistentNaming
public static class scrShowIfDebugPatch
{
[HarmonyPostfix]
[HarmonyPatch("Update")]
[SuppressMessage("ReSharper", "InconsistentNaming")]
private static void IgnoreInput(Text ___txt, Color ___defaultColor)
{
if (!RenderMod.IsRendering) return;
___txt.text = "Rendering";
if (RenderManager.Countdown > 0) ___txt.text += $" in {RenderManager.Countdown}..";
___txt.color = ___defaultColor;
}
}
}