commit 44a22ae103b91d9a5a6bf66048a80a200656c127ca993c63c8f49e1773cda26a Author: copecone Date: Thu May 21 11:38:31 2026 +0900 Initial Commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..252229a --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +## Build outputs +bin/ +obj/ +Bin/ +Obj/ +build/ +Build/ + +## IDE and Editor Settings +# Visual Studio +.vs/ +*.user +*.suo +*.userprefs +*.sln.docstates + +# JetBrains Rider / IntelliJ +.idea/ +*.sln.DotSettings.user + +# Visual Studio Code +.vscode/ +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/code-snippets + +## OS-specific files +.DS_Store +Thumbs.db +desktop.ini + +## Agent Metadata +.antigravitycli/ diff --git a/ADOFAIRenderer.csproj b/ADOFAIRenderer.csproj new file mode 100644 index 0000000..9184c25 --- /dev/null +++ b/ADOFAIRenderer.csproj @@ -0,0 +1,67 @@ + + + + netstandard2.1 + enable + MSB3277 + + + + + $(ADOFAI_PATH)\MelonLoader\net35\0Harmony.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\Assembly-CSharp.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\Assembly-CSharp-firstpass.dll + + + $(ADOFAI_PATH)\MelonLoader\net35\MelonLoader.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\RDTools.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\SkyHook.Unity.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\Unity.TextMeshPro.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\UnityEngine.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\UnityEngine.AssetBundleModule.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\UnityEngine.AudioModule.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\UnityEngine.CoreModule.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\UnityEngine.InputLegacyModule.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\UnityEngine.InputModule.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\UnityEngine.UI.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\UnityEngine.UIElementsModule.dll + + + $(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\UnityEngine.UIModule.dll + + + + + + + + + + + diff --git a/ADOFAIRenderer.sln b/ADOFAIRenderer.sln new file mode 100644 index 0000000..edde255 --- /dev/null +++ b/ADOFAIRenderer.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ADOFAIRenderer", "ADOFAIRenderer.csproj", "{2D997D97-A2CC-4EB0-8963-DA6A71082319}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2D997D97-A2CC-4EB0-8963-DA6A71082319}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D997D97-A2CC-4EB0-8963-DA6A71082319}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D997D97-A2CC-4EB0-8963-DA6A71082319}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D997D97-A2CC-4EB0-8963-DA6A71082319}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Bundle/Win64/fonts b/Bundle/Win64/fonts new file mode 100644 index 0000000..be1dc84 Binary files /dev/null and b/Bundle/Win64/fonts differ diff --git a/Bundle/Win64/scenes b/Bundle/Win64/scenes new file mode 100644 index 0000000..359fd65 Binary files /dev/null and b/Bundle/Win64/scenes differ diff --git a/Component/FirstUpdate.cs b/Component/FirstUpdate.cs new file mode 100644 index 0000000..61dc6d0 --- /dev/null +++ b/Component/FirstUpdate.cs @@ -0,0 +1,13 @@ +using UnityEngine; + +namespace ADOFAIRenderer.Component +{ + [DefaultExecutionOrder(-2147483648)] + public class FirstUpdate : MonoBehaviour + { + private void Update() + { + RenderMod.OnFirstUpdate(); + } + } +} \ No newline at end of file diff --git a/Component/RenderManager.cs b/Component/RenderManager.cs new file mode 100644 index 0000000..82b470e --- /dev/null +++ b/Component/RenderManager.cs @@ -0,0 +1,108 @@ +using System.Collections; +using UnityEngine; + +namespace ADOFAIRenderer.Component +{ + public class RenderManager : MonoBehaviour + { + public static int Countdown = 0; + public static int FrameCount = 0; + public static bool SkipPressToStart = false; + public static string LevelPath = ""; + public static RenderManager Instance = null!; + private static int _originalInputOffset; + + public static RenderSettings Configuration; + + public struct RenderSettings + { + public double TargetFPS; + public double VideoFPS; + + public int RenderWidth; + public int RenderHeight; + + public int Bitrate; + public string Codec; + + public RenderSettings(double targetFPS, double videoFPS, int renderWidth, int renderHeight, int bitrate, string codec) + { + TargetFPS = targetFPS; + VideoFPS = videoFPS; + + RenderWidth = renderWidth; + RenderHeight = renderHeight; + + Bitrate = bitrate; + Codec = codec; + } + } + + + private static bool _renderSetup; + + private void Awake() + { + Instance = this; + } + + private void Update() + { + if (_renderSetup && ADOBase.lm) + { + ADOBase.lm.hideDifficultyUI = true; + } + + if (_renderSetup && scnGame.instance && !scnGame.instance.isLoading) + { + _renderSetup = false; + scrCamera.instance.forceRTCam = true; + scrCamera.instance.SetupRTCam(true); + + _originalInputOffset = scrConductor.currentPreset.inputOffset; + scrConductor.currentPreset.inputOffset = 0; + RDC.auto = true; + + RenderMod.IsRendering = true; + Countdown = 3; + + scrController.instance.StartCoroutine(SetupPlay()); + } + + if (RenderMod.IsRendering && scrController.instance.state == States.Won) + { + RenderMod.IsRendering = RenderMod.IsCapturing = false; + scrConductor.currentPreset.inputOffset = _originalInputOffset; + } + } + + public void SetupGameScene() + { + GCS.customLevelPaths = new[] { LevelPath }; + GCS.checkpointNum = 0; + GCS.customLevelId = ""; + GCS.nextSpeedRun = 1; + GCS.customLevelIndex = 0; + + ADOBase.loader.LoadSceneWithTransition(WipeDirection.StartsFromRight, "scnGame"); + SkipPressToStart = true; + _renderSetup = true; + } + + private IEnumerator SetupPlay() + { + for (; Countdown > 0; Countdown--) + { + yield return new WaitForSecondsRealtime(1); + } + + FrameCount = 0; + RenderMod.IsCapturing = true; + scrController.instance.paused = scrController.instance.audioPaused = false; + scrController.instance.levelWasSkipped = true; + + scrConductor.instance.song.clip = null; + scrConductor.instance.song.time = -1000; + } + } +} \ No newline at end of file diff --git a/Patch/ClassPatch/scnEditorPatch.cs b/Patch/ClassPatch/scnEditorPatch.cs new file mode 100644 index 0000000..7924506 --- /dev/null +++ b/Patch/ClassPatch/scnEditorPatch.cs @@ -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