Refactor Every namespace Keyword Usage

This commit is contained in:
copecone committed 2026-08-19 15:40:00 +09:00
1 parent 4e67cb9b09
commit 27be2141f7
44 files changed
+208 -134

No files matched your search

+64
View File
@@ -110,4 +110,68 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="FFmpeg.AutoGen" Version="8.1.0" /> <PackageReference Include="FFmpeg.AutoGen" Version="8.1.0" />
</ItemGroup> </ItemGroup>
<!-- Build 후 XML 문서에서 ADOFAIRenderer.API 네임스페이스만 남기고 나머지 제거 -->
<UsingTask TaskName="FilterXmlDoc" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<XmlFilePath ParameterType="System.String" Required="true" />
<TargetNamespace ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Collections.Generic" />
<Using Namespace="System.Xml.Linq" />
<Code Type="Fragment" Language="cs">
<![CDATA[
if (!File.Exists(XmlFilePath)) return true;
try
{
var doc = XDocument.Load(XmlFilePath);
var members = doc.Root?.Element("members");
if (members != null)
{
var prefix = TargetNamespace + ".";
var toRemove = new List<XElement>();
foreach (var member in members.Elements("member"))
{
var nameAttr = member.Attribute("name")?.Value;
if (string.IsNullOrEmpty(nameAttr)) continue;
// XML 주석 형식: T:네임스페이스.타입, M:메서드, P:프로퍼티, F:필드/열거형, E:이벤트 등
int colonIndex = nameAttr.IndexOf(':');
string fullName = colonIndex >= 0 ? nameAttr.Substring(colonIndex + 1) : nameAttr;
if (!fullName.StartsWith(prefix, StringComparison.Ordinal) && !fullName.Equals(TargetNamespace, StringComparison.Ordinal))
{
toRemove.Add(member);
}
}
foreach (var elem in toRemove)
{
elem.Remove();
}
doc.Save(XmlFilePath);
Log.LogMessage(Microsoft.Build.Framework.MessageImportance.High, $"[FilterXmlDoc] Kept '{TargetNamespace}' namespace docs. Removed {toRemove.Count} other members.");
}
}
catch (Exception ex)
{
Log.LogWarning($"[FilterXmlDoc] XML filtering failed: {ex.Message}");
}
]]>
</Code>
</Task>
</UsingTask>
<Target Name="FilterDocumentationFile" AfterTargets="Build" Condition="'$(GenerateDocumentationFile)' == 'true'">
<PropertyGroup>
<_XmlDocPath Condition="'$(_XmlDocPath)' == '' and Exists('$(TargetDir)$(TargetName).xml')">$(TargetDir)$(TargetName).xml</_XmlDocPath>
<_XmlDocPath Condition="'$(_XmlDocPath)' == '' and Exists('$(DocumentationFile)')">$(DocumentationFile)</_XmlDocPath>
</PropertyGroup>
<FilterXmlDoc Condition="'$(_XmlDocPath)' != ''" XmlFilePath="$(_XmlDocPath)" TargetNamespace="ADOFAIRenderer.API" />
</Target>
</Project> </Project>
+35 -4
View File
@@ -5,9 +5,10 @@ using System.IO;
namespace ADOFAIRenderer.API; namespace ADOFAIRenderer.API;
/// <summary> /// <summary>
/// Represents the result and metadata of a completed or cancelled render session. /// Represents the result and metadata of a completed or canceled render session.
/// </summary> /// </summary>
[SuppressMessage("ReSharper", "UnusedType.Global")] [SuppressMessage("ReSharper", "UnusedType.Global")]
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class RenderResult public class RenderResult
{ {
/// <summary> /// <summary>
@@ -41,10 +42,20 @@ public class RenderResult
public long FileSizeBytes { get; } public long FileSizeBytes { get; }
/// <summary> /// <summary>
/// Error message or reason if rendering failed or was cancelled; <c>null</c> on success. /// Error message or reason if rendering failed or was canceled; <c>null</c> on success.
/// </summary> /// </summary>
public string? ErrorMessage { get; } public string? ErrorMessage { get; }
/// <summary>
/// Initializes a new instance of the <see cref="RenderResult"/> class.
/// </summary>
/// <param name="success">Whether the render session completed successfully.</param>
/// <param name="outputPath">The absolute output path of the rendered video file.</param>
/// <param name="totalFrames">Total number of video frames sent to the encoder.</param>
/// <param name="videoDuration">Calculated video duration in seconds.</param>
/// <param name="renderDuration">Total wall-clock time spent rendering.</param>
/// <param name="fileSizeBytes">File size of the output video in bytes.</param>
/// <param name="errorMessage">Error message or reason if failed or canceled; otherwise, <c>null</c>.</param>
public RenderResult( public RenderResult(
bool success, bool success,
string outputPath, string outputPath,
@@ -63,7 +74,15 @@ public class RenderResult
ErrorMessage = errorMessage; ErrorMessage = errorMessage;
} }
public static RenderResult CreateSuccess(string outputPath, long totalFrames, double fps, TimeSpan renderDuration) /// <summary>
/// Creates a successful <see cref="RenderResult"/> instance from the specified render metrics.
/// </summary>
/// <param name="outputPath">The path to the rendered video file.</param>
/// <param name="totalFrames">Total number of video frames sent to the encoder.</param>
/// <param name="fps">The effective frames per second used to compute video duration.</param>
/// <param name="renderDuration">Total wall-clock time spent rendering.</param>
/// <returns>A new <see cref="RenderResult"/> representing a successful render session.</returns>
internal static RenderResult CreateSuccess(string outputPath, long totalFrames, double fps, TimeSpan renderDuration)
{ {
var fileSizeBytes = 0L; var fileSizeBytes = 0L;
if (!string.IsNullOrEmpty(outputPath) && File.Exists(outputPath)) if (!string.IsNullOrEmpty(outputPath) && File.Exists(outputPath))
@@ -76,12 +95,24 @@ public class RenderResult
return new RenderResult(true, outputPath, totalFrames, videoDuration, renderDuration, fileSizeBytes); return new RenderResult(true, outputPath, totalFrames, videoDuration, renderDuration, fileSizeBytes);
} }
public static RenderResult CreateFailure(string? errorMessage, long totalFrames, double fps, TimeSpan renderDuration) /// <summary>
/// Creates a failed or cancelled <see cref="RenderResult"/> instance.
/// </summary>
/// <param name="errorMessage">Error message or reason for failure/cancellation.</param>
/// <param name="totalFrames">Total number of video frames sent to the encoder prior to termination.</param>
/// <param name="fps">The effective frames per second used to compute video duration.</param>
/// <param name="renderDuration">Total wall-clock time spent rendering prior to termination.</param>
/// <returns>A new <see cref="RenderResult"/> representing a failed or canceled render session.</returns>
internal static RenderResult CreateFailure(string? errorMessage, long totalFrames, double fps, TimeSpan renderDuration)
{ {
var videoDuration = fps > 0 ? totalFrames / fps : 0.0; var videoDuration = fps > 0 ? totalFrames / fps : 0.0;
return new RenderResult(false, string.Empty, totalFrames, videoDuration, renderDuration, 0, errorMessage ?? "Rendering failed or was cancelled."); return new RenderResult(false, string.Empty, totalFrames, videoDuration, renderDuration, 0, errorMessage ?? "Rendering failed or was cancelled.");
} }
/// <summary>
/// Returns a string summarizing the render result metrics or failure reason.
/// </summary>
/// <returns>A string representation of the <see cref="RenderResult"/>.</returns>
public override string ToString() public override string ToString()
{ {
return Success return Success
+11
View File
@@ -92,12 +92,22 @@ public class RenderSession
return this; return this;
} }
/// <summary>
/// Sets whether desktop notifications should be displayed when rendering completes.
/// </summary>
/// <param name="enabled"><c>true</c> to enable desktop notifications; otherwise, <c>false</c>.</param>
/// <returns>The current <see cref="RenderSession"/> instance for method chaining.</returns>
public RenderSession WithNotification(bool enabled) public RenderSession WithNotification(bool enabled)
{ {
_notification = enabled; _notification = enabled;
return this; return this;
} }
/// <summary>
/// Adds a callback action to be invoked when the render session completes or fails.
/// </summary>
/// <param name="callback">The callback action that receives the resulting <see cref="RenderResult"/>.</param>
/// <returns>The current <see cref="RenderSession"/> instance for method chaining.</returns>
public RenderSession OnComplete(Action<RenderResult> callback) public RenderSession OnComplete(Action<RenderResult> callback)
{ {
_onComplete += callback; _onComplete += callback;
@@ -109,6 +119,7 @@ public class RenderSession
/// </summary> /// </summary>
/// <param name="renderConfig">The configuration settings for the render session.</param> /// <param name="renderConfig">The configuration settings for the render session.</param>
/// <param name="levelPath">The file path of the level to render.</param> /// <param name="levelPath">The file path of the level to render.</param>
/// <exception cref="InvalidOperationException">Thrown when the output directory cannot be determined from the output path.</exception>
public void Start(RenderConfig renderConfig, string levelPath) public void Start(RenderConfig renderConfig, string levelPath)
{ {
RenderContext.Auto = _auto; RenderContext.Auto = _auto;
+2 -3
View File
@@ -1,8 +1,8 @@
using ADOFAIRenderer.UI; using ADOFAIRenderer.UI;
using UnityEngine; using UnityEngine;
namespace ADOFAIRenderer.Core namespace ADOFAIRenderer.Core;
{
[DefaultExecutionOrder(int.MinValue)] [DefaultExecutionOrder(int.MinValue)]
internal class FirstUpdateHook : MonoBehaviour internal class FirstUpdateHook : MonoBehaviour
{ {
@@ -63,4 +63,3 @@ namespace ADOFAIRenderer.Core
); );
} }
} }
}
+2 -3
View File
@@ -3,8 +3,8 @@ using System.Reflection;
using HarmonyLib; using HarmonyLib;
using UnityEngine; using UnityEngine;
namespace ADOFAIRenderer.Core namespace ADOFAIRenderer.Core;
{
[DefaultExecutionOrder(int.MaxValue)] [DefaultExecutionOrder(int.MaxValue)]
internal class PostRenderHook : MonoBehaviour internal class PostRenderHook : MonoBehaviour
{ {
@@ -32,4 +32,3 @@ namespace ADOFAIRenderer.Core
RenderManager.Instance.OnPostFrame(val.sharedMaterial.mainTexture as RenderTexture); RenderManager.Instance.OnPostFrame(val.sharedMaterial.mainTexture as RenderTexture);
} }
} }
}
+6 -5
View File
@@ -1,5 +1,5 @@
namespace ADOFAIRenderer.Data namespace ADOFAIRenderer.Data;
{
/// <summary> /// <summary>
/// Base class for double input validation limits. /// Base class for double input validation limits.
/// Multiple limits can be composed on a single input field — all are checked in order. /// Multiple limits can be composed on a single input field — all are checked in order.
@@ -42,8 +42,10 @@ namespace ADOFAIRenderer.Data
/// </summary> /// </summary>
internal class RangeDoubleLimit : DoubleLimit internal class RangeDoubleLimit : DoubleLimit
{ {
// ReSharper disable MemberCanBePrivate.Global
public double? Min { get; } public double? Min { get; }
public double? Max { get; } public double? Max { get; }
// ReSharper restore MemberCanBePrivate.Global
/// <param name="min">Inclusive lower bound, or null for no lower bound.</param> /// <param name="min">Inclusive lower bound, or null for no lower bound.</param>
/// <param name="max">Inclusive upper bound, or null for no upper bound.</param> /// <param name="max">Inclusive upper bound, or null for no upper bound.</param>
@@ -55,7 +57,7 @@ namespace ADOFAIRenderer.Data
public override bool Validate(double value, out string errorMessage) public override bool Validate(double value, out string errorMessage)
{ {
if (Min.HasValue && value < Min.Value) if (value < Min)
{ {
errorMessage = Max.HasValue errorMessage = Max.HasValue
? $"값은 {Min.Value}에서 {Max.Value} 사이의 숫자여야 합니다." ? $"값은 {Min.Value}에서 {Max.Value} 사이의 숫자여야 합니다."
@@ -63,7 +65,7 @@ namespace ADOFAIRenderer.Data
return false; return false;
} }
if (Max.HasValue && value > Max.Value) if (value > Max)
{ {
errorMessage = Min.HasValue errorMessage = Min.HasValue
? $"값은 {Min.Value}에서 {Max.Value} 사이의 숫자여야 합니다." ? $"값은 {Min.Value}에서 {Max.Value} 사이의 숫자여야 합니다."
@@ -75,4 +77,3 @@ namespace ADOFAIRenderer.Data
return true; return true;
} }
} }
}
+2 -3
View File
@@ -3,8 +3,8 @@ using System.Linq;
using MelonLoader; using MelonLoader;
using UnityEngine.UIElements; using UnityEngine.UIElements;
namespace ADOFAIRenderer.Data.Input namespace ADOFAIRenderer.Data.Input;
{
internal class DoubleInputValidator internal class DoubleInputValidator
{ {
private struct FieldEntry private struct FieldEntry
@@ -74,4 +74,3 @@ namespace ADOFAIRenderer.Data.Input
} }
} }
} }
}
+4 -3
View File
@@ -1,16 +1,18 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq; using System.Linq;
using MelonLoader; using MelonLoader;
using UnityEngine.UIElements; using UnityEngine.UIElements;
namespace ADOFAIRenderer.Data.Input namespace ADOFAIRenderer.Data.Input;
{
/// <summary> /// <summary>
/// Binds a UI Toolkit <see cref="DropdownField"/> to an enum type. /// Binds a UI Toolkit <see cref="DropdownField"/> to an enum type.
/// Populates choices from enum names and provides typed access to the selected value. /// Populates choices from enum names and provides typed access to the selected value.
/// </summary> /// </summary>
/// <typeparam name="T">The enum type to bind.</typeparam> /// <typeparam name="T">The enum type to bind.</typeparam>
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
internal class EnumDropdownBinder<T> where T : struct, Enum internal class EnumDropdownBinder<T> where T : struct, Enum
{ {
private readonly DropdownField? _dropdown; private readonly DropdownField? _dropdown;
@@ -83,4 +85,3 @@ namespace ADOFAIRenderer.Data.Input
} }
} }
} }
}
+2 -3
View File
@@ -3,8 +3,8 @@ using System.Linq;
using MelonLoader; using MelonLoader;
using UnityEngine.UIElements; using UnityEngine.UIElements;
namespace ADOFAIRenderer.Data.Input namespace ADOFAIRenderer.Data.Input;
{
internal class IntegerInputValidator internal class IntegerInputValidator
{ {
private struct FieldEntry private struct FieldEntry
@@ -74,4 +74,3 @@ namespace ADOFAIRenderer.Data.Input
} }
} }
} }
}
+6 -5
View File
@@ -1,5 +1,5 @@
namespace ADOFAIRenderer.Data namespace ADOFAIRenderer.Data;
{
/// <summary> /// <summary>
/// Base class for integer input validation limits. /// Base class for integer input validation limits.
/// Multiple limits can be composed on a single input field — all are checked in order. /// Multiple limits can be composed on a single input field — all are checked in order.
@@ -42,8 +42,10 @@ namespace ADOFAIRenderer.Data
/// </summary> /// </summary>
internal class RangeIntegerLimit : IntegerLimit internal class RangeIntegerLimit : IntegerLimit
{ {
// ReSharper disable MemberCanBePrivate.Global
public int? Min { get; } public int? Min { get; }
public int? Max { get; } public int? Max { get; }
// ReSharper restore MemberCanBePrivate.Global
/// <param name="min">Inclusive lower bound, or null for no lower bound.</param> /// <param name="min">Inclusive lower bound, or null for no lower bound.</param>
/// <param name="max">Inclusive upper bound, or null for no upper bound.</param> /// <param name="max">Inclusive upper bound, or null for no upper bound.</param>
@@ -55,7 +57,7 @@ namespace ADOFAIRenderer.Data
public override bool Validate(int value, out string errorMessage) public override bool Validate(int value, out string errorMessage)
{ {
if (Min.HasValue && value < Min.Value) if (value < Min)
{ {
errorMessage = Max.HasValue errorMessage = Max.HasValue
? $"값은 {Min.Value}에서 {Max.Value} 사이의 정수여야 합니다." ? $"값은 {Min.Value}에서 {Max.Value} 사이의 정수여야 합니다."
@@ -63,7 +65,7 @@ namespace ADOFAIRenderer.Data
return false; return false;
} }
if (Max.HasValue && value > Max.Value) if (value > Max)
{ {
errorMessage = Min.HasValue errorMessage = Min.HasValue
? $"값은 {Min.Value}에서 {Max.Value} 사이의 정수여야 합니다." ? $"값은 {Min.Value}에서 {Max.Value} 사이의 정수여야 합니다."
@@ -75,4 +77,3 @@ namespace ADOFAIRenderer.Data
return true; return true;
} }
} }
}
+2 -3
View File
@@ -7,8 +7,8 @@ using MelonLoader.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
namespace ADOFAIRenderer.Data namespace ADOFAIRenderer.Data;
{
internal class RenderPreset internal class RenderPreset
{ {
public string Name { get; set; } = string.Empty; public string Name { get; set; } = string.Empty;
@@ -187,4 +187,3 @@ namespace ADOFAIRenderer.Data
} }
} }
} }
}
+2 -3
View File
@@ -1,8 +1,8 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using ADOFAIRenderer.Util.FFmpeg; using ADOFAIRenderer.Util.FFmpeg;
namespace ADOFAIRenderer.Data namespace ADOFAIRenderer.Data;
{
[SuppressMessage("ReSharper", "RedundantDefaultMemberInitializer")] [SuppressMessage("ReSharper", "RedundantDefaultMemberInitializer")]
public class RenderConfig public class RenderConfig
{ {
@@ -68,4 +68,3 @@ namespace ADOFAIRenderer.Data
set => _audioBitrate = value <= 0 ? 256000 : value; set => _audioBitrate = value <= 0 ? 256000 : value;
} }
} }
}
+2 -3
View File
@@ -1,8 +1,8 @@
using ADOFAIRenderer.Core; using ADOFAIRenderer.Core;
using HarmonyLib; using HarmonyLib;
namespace ADOFAIRenderer.Patch.Engine namespace ADOFAIRenderer.Patch.Engine;
{
[HarmonyPatch(typeof(AsyncInputUtils), "UpdateOffsetTime")] [HarmonyPatch(typeof(AsyncInputUtils), "UpdateOffsetTime")]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public static class AsyncInputPatches public static class AsyncInputPatches
@@ -18,4 +18,3 @@ namespace ADOFAIRenderer.Patch.Engine
return false; // Skip the original damped offset calculation return false; // Skip the original damped offset calculation
} }
} }
}
+2 -3
View File
@@ -4,8 +4,8 @@ using HarmonyLib;
using UnityEngine; using UnityEngine;
using UnityEngine.Audio; using UnityEngine.Audio;
namespace ADOFAIRenderer.Patch.Engine namespace ADOFAIRenderer.Patch.Engine;
{
[HarmonyPatch(typeof(AudioManager), "_Play")] [HarmonyPatch(typeof(AudioManager), "_Play")]
public static class AudioManagerPlayPatch public static class AudioManagerPlayPatch
{ {
@@ -110,4 +110,3 @@ namespace ADOFAIRenderer.Patch.Engine
} }
} }
} }
}
+2 -5
View File
@@ -1,15 +1,13 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using ADOFAIRenderer.Core; using ADOFAIRenderer.Core;
using ADOFAIRenderer.Util;
using ADOFAIRenderer.Util.Audio; using ADOFAIRenderer.Util.Audio;
using HarmonyLib; using HarmonyLib;
using UnityEngine; using UnityEngine;
namespace ADOFAIRenderer.Patch.Engine namespace ADOFAIRenderer.Patch.Engine;
{
public static class RenderEnvironmentPatches public static class RenderEnvironmentPatches
{ {
private const bool RenderPatch = true;
private static double TimeSpent => RenderManager.Instance.frameCount / RenderManager.Instance.Configuration.RenderFPS; private static double TimeSpent => RenderManager.Instance.frameCount / RenderManager.Instance.Configuration.RenderFPS;
[HarmonyPatch(typeof(Time), "time", MethodType.Getter)] [HarmonyPatch(typeof(Time), "time", MethodType.Getter)]
@@ -165,4 +163,3 @@ namespace ADOFAIRenderer.Patch.Engine
} }
} }
} }
}
+2 -3
View File
@@ -2,8 +2,8 @@ using System.Diagnostics.CodeAnalysis;
using ADOFAIRenderer.Core; using ADOFAIRenderer.Core;
using HarmonyLib; using HarmonyLib;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(EndscreenLanterns))] [HarmonyPatch(typeof(EndscreenLanterns))]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public static class EndscreenLanternsPatch public static class EndscreenLanternsPatch
@@ -71,4 +71,3 @@ namespace ADOFAIRenderer.Patch.Game
chainSequenceField.SetValue(null); chainSequenceField.SetValue(null);
} }
} }
}
+2 -3
View File
@@ -1,8 +1,8 @@
using ADOFAIRenderer.Core; using ADOFAIRenderer.Core;
using HarmonyLib; using HarmonyLib;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(Persistence))] [HarmonyPatch(typeof(Persistence))]
public static class PersistencePatch public static class PersistencePatch
{ {
@@ -19,4 +19,3 @@ namespace ADOFAIRenderer.Patch.Game
} }
} }
} }
}
+2 -3
View File
@@ -4,8 +4,8 @@ using MelonLoader;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(scnEditor))] [HarmonyPatch(typeof(scnEditor))]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public static class scnEditorPatch public static class scnEditorPatch
@@ -48,4 +48,3 @@ namespace ADOFAIRenderer.Patch.Game
iconImage.rectTransform.sizeDelta = new Vector2(24, 24); iconImage.rectTransform.sizeDelta = new Vector2(24, 24);
} }
} }
}
+2 -3
View File
@@ -4,8 +4,8 @@ using ADOFAIRenderer.Util;
using HarmonyLib; using HarmonyLib;
using UnityEngine; using UnityEngine;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(scnGame))] [HarmonyPatch(typeof(scnGame))]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public static class scnGamePatch public static class scnGamePatch
@@ -139,4 +139,3 @@ namespace ADOFAIRenderer.Patch.Game
return false; // Skip original UpdateVideo return false; // Skip original UpdateVideo
} }
} }
}
+2 -3
View File
@@ -1,8 +1,8 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using HarmonyLib; using HarmonyLib;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(scrCamera))] [HarmonyPatch(typeof(scrCamera))]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public class scrCameraPatch public class scrCameraPatch
@@ -20,4 +20,3 @@ namespace ADOFAIRenderer.Patch.Game
return false; return false;
} }
} }
}
+2 -3
View File
@@ -1,8 +1,8 @@
using ADOFAIRenderer.Core; using ADOFAIRenderer.Core;
using HarmonyLib; using HarmonyLib;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(scrController))] [HarmonyPatch(typeof(scrController))]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public static class scrControllerPatch public static class scrControllerPatch
@@ -42,4 +42,3 @@ namespace ADOFAIRenderer.Patch.Game
return !RenderManager.IsActive; return !RenderManager.IsActive;
} }
} }
}
+2 -3
View File
@@ -1,7 +1,7 @@
using HarmonyLib; using HarmonyLib;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(scrDecoration))] [HarmonyPatch(typeof(scrDecoration))]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public static class scrDecorationPatch public static class scrDecorationPatch
@@ -38,4 +38,3 @@ namespace ADOFAIRenderer.Patch.Game
return __instance != null && __instance && __instance.pivotTrans != null; return __instance != null && __instance && __instance.pivotTrans != null;
} }
} }
}
+2 -3
View File
@@ -1,8 +1,8 @@
using ADOFAIRenderer.Core; using ADOFAIRenderer.Core;
using HarmonyLib; using HarmonyLib;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(scrFloor))] [HarmonyPatch(typeof(scrFloor))]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public class scrFloorPatch public class scrFloorPatch
@@ -19,4 +19,3 @@ namespace ADOFAIRenderer.Patch.Game
return !nonTile; return !nonTile;
} }
} }
}
+2 -3
View File
@@ -1,8 +1,8 @@
using ADOFAIRenderer.Core; using ADOFAIRenderer.Core;
using HarmonyLib; using HarmonyLib;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(scrHitTextManager), "ShowHitText")] [HarmonyPatch(typeof(scrHitTextManager), "ShowHitText")]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public class scrHitTextManagerPatch public class scrHitTextManagerPatch
@@ -12,4 +12,3 @@ namespace ADOFAIRenderer.Patch.Game
return !RenderManager.IsActive || RenderManager.Instance is { Configuration: { ShowJudgementText: true } }; return !RenderManager.IsActive || RenderManager.Instance is { Configuration: { ShowJudgementText: true } };
} }
} }
}
+2 -3
View File
@@ -1,8 +1,8 @@
using ADOFAIRenderer.Core; using ADOFAIRenderer.Core;
using HarmonyLib; using HarmonyLib;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(scrMistakesManager))] [HarmonyPatch(typeof(scrMistakesManager))]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public static class scrMistakesManagerPatch public static class scrMistakesManagerPatch
@@ -14,4 +14,3 @@ namespace ADOFAIRenderer.Patch.Game
return !RenderManager.IsActive; return !RenderManager.IsActive;
} }
} }
}
+2 -3
View File
@@ -1,8 +1,8 @@
using ADOFAIRenderer.Core; using ADOFAIRenderer.Core;
using HarmonyLib; using HarmonyLib;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(scrPlayerManager))] [HarmonyPatch(typeof(scrPlayerManager))]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public static class scrPlayerManagerPatch public static class scrPlayerManagerPatch
@@ -18,4 +18,3 @@ namespace ADOFAIRenderer.Patch.Game
return false; return false;
} }
} }
}
+2 -3
View File
@@ -2,8 +2,8 @@ using ADOFAIRenderer.Core;
using HarmonyLib; using HarmonyLib;
using UnityEngine; using UnityEngine;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(scrPortalParticles))] [HarmonyPatch(typeof(scrPortalParticles))]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public static class scrPortalParticlesPatch public static class scrPortalParticlesPatch
@@ -26,4 +26,3 @@ namespace ADOFAIRenderer.Patch.Game
} }
} }
} }
}
+2 -3
View File
@@ -1,8 +1,8 @@
using ADOFAIRenderer.Core; using ADOFAIRenderer.Core;
using HarmonyLib; using HarmonyLib;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(scrPressToStart))] [HarmonyPatch(typeof(scrPressToStart))]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public class scrPressToStartPatch public class scrPressToStartPatch
@@ -17,4 +17,3 @@ namespace ADOFAIRenderer.Patch.Game
return false; return false;
} }
} }
}
+2 -3
View File
@@ -4,8 +4,8 @@ using HarmonyLib;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(scrShowIfDebug))] [HarmonyPatch(typeof(scrShowIfDebug))]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public static class scrShowIfDebugPatch public static class scrShowIfDebugPatch
@@ -34,4 +34,3 @@ namespace ADOFAIRenderer.Patch.Game
___txt.color = ___defaultColor; ___txt.color = ___defaultColor;
} }
} }
}
+2 -3
View File
@@ -1,8 +1,8 @@
using ADOFAIRenderer.Core; using ADOFAIRenderer.Core;
using HarmonyLib; using HarmonyLib;
namespace ADOFAIRenderer.Patch.Game namespace ADOFAIRenderer.Patch.Game;
{
[HarmonyPatch(typeof(scrUIController))] [HarmonyPatch(typeof(scrUIController))]
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public class scrUIControllerPatch public class scrUIControllerPatch
@@ -18,4 +18,3 @@ namespace ADOFAIRenderer.Patch.Game
} }
} }
} }
}
+1 -1
View File
@@ -7,7 +7,7 @@ using MelonLoader.Utils;
using UnityEngine; using UnityEngine;
using UnityEngine.EventSystems; using UnityEngine.EventSystems;
[assembly: MelonInfo(typeof(RenderMod), "ADOFAI Renderer", "0.1.1-INDEV", "ADOFAI Editor Forum")] [assembly: MelonInfo(typeof(RenderMod), "ADOFAI Renderer", "0.1.2-INDEV", "ADOFAI Editor Forum")]
[assembly: MelonGame("7th Beat Games", "A Dance of Fire and Ice")] [assembly: MelonGame("7th Beat Games", "A Dance of Fire and Ice")]
namespace ADOFAIRenderer namespace ADOFAIRenderer
+5 -4
View File
@@ -7,13 +7,15 @@ using UnityEngine.UIElements;
using Button = UnityEngine.UI.Button; using Button = UnityEngine.UI.Button;
using Image = UnityEngine.UI.Image; using Image = UnityEngine.UI.Image;
namespace ADOFAIRenderer.UI namespace ADOFAIRenderer.UI;
{
internal class DialogButton internal class DialogButton
{ {
// ReSharper disable FieldCanBeMadeReadOnly.Global
public string Text; public string Text;
public Action OnClick; public Action OnClick;
public Color? BackgroundColor; public Color? BackgroundColor;
// ReSharper restore FieldCanBeMadeReadOnly.Global
public DialogButton(string text, Action onClick, Color? backgroundColor = null) public DialogButton(string text, Action onClick, Color? backgroundColor = null)
{ {
@@ -112,7 +114,7 @@ namespace ADOFAIRenderer.UI
foreach (var doc in FindObjectsByType<UIDocument>(FindObjectsSortMode.None)) foreach (var doc in FindObjectsByType<UIDocument>(FindObjectsSortMode.None))
{ {
if (doc && doc.rootVisualElement != null && doc.rootVisualElement.enabledSelf) if (doc && doc.rootVisualElement is { enabledSelf: true })
{ {
doc.rootVisualElement.SetEnabled(false); doc.rootVisualElement.SetEnabled(false);
_disabledElements.Add(doc.rootVisualElement); _disabledElements.Add(doc.rootVisualElement);
@@ -320,4 +322,3 @@ namespace ADOFAIRenderer.UI
return new Color(r, g, b, color.a); return new Color(r, g, b, color.a);
} }
} }
}
+2 -3
View File
@@ -6,8 +6,8 @@ using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
namespace ADOFAIRenderer.UI namespace ADOFAIRenderer.UI;
{
internal class DebugMonitorUI : MonoBehaviour internal class DebugMonitorUI : MonoBehaviour
{ {
// --- Progress Bar UI Configuration Constants --- // --- Progress Bar UI Configuration Constants ---
@@ -231,4 +231,3 @@ namespace ADOFAIRenderer.UI
if (_progressText) _progressText.text = $"{progress * 100f:F1}% ({currentFloor}/{totalFloors})"; if (_progressText) _progressText.text = $"{progress * 100f:F1}% ({currentFloor}/{totalFloors})";
} }
} }
}
+2 -3
View File
@@ -4,8 +4,8 @@ using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
namespace ADOFAIRenderer.UI namespace ADOFAIRenderer.UI;
{
internal class EscapeHandlerUI : MonoBehaviour internal class EscapeHandlerUI : MonoBehaviour
{ {
private GameObject _containerObj = null!; private GameObject _containerObj = null!;
@@ -128,4 +128,3 @@ namespace ADOFAIRenderer.UI
_escapeStopwatch = null; _escapeStopwatch = null;
} }
} }
}
+2 -3
View File
@@ -10,8 +10,8 @@ using UnityEngine.UI;
using MelonLoader; using MelonLoader;
using MelonLoader.Utils; using MelonLoader.Utils;
namespace ADOFAIRenderer.UI namespace ADOFAIRenderer.UI;
{
internal class FFmpegDownloadUI : MonoBehaviour internal class FFmpegDownloadUI : MonoBehaviour
{ {
private GameObject _buttonContainerObj = null!; private GameObject _buttonContainerObj = null!;
@@ -690,4 +690,3 @@ namespace ADOFAIRenderer.UI
} }
} }
} }
}
+2 -3
View File
@@ -7,8 +7,8 @@ using MelonLoader;
using UnityEngine; using UnityEngine;
using UnityEngine.UIElements; using UnityEngine.UIElements;
namespace ADOFAIRenderer.UI namespace ADOFAIRenderer.UI;
{
internal class RenderConfigUIManager : MonoBehaviour internal class RenderConfigUIManager : MonoBehaviour
{ {
[SerializeField] [SerializeField]
@@ -1148,4 +1148,3 @@ namespace ADOFAIRenderer.UI
return label; return label;
} }
} }
}
+2 -3
View File
@@ -1,7 +1,7 @@
using System; using System;
namespace ADOFAIRenderer.Util.Audio namespace ADOFAIRenderer.Util.Audio;
{
internal static class AudioResampler internal static class AudioResampler
{ {
public static float[] Resample(float[] inputSamples, int inputChannels, int inputFrequency, int targetChannels, int targetFrequency) public static float[] Resample(float[] inputSamples, int inputChannels, int inputFrequency, int targetChannels, int targetFrequency)
@@ -98,4 +98,3 @@ namespace ADOFAIRenderer.Util.Audio
return outputSamples; return outputSamples;
} }
} }
}
+4 -3
View File
@@ -3,14 +3,16 @@ using System.Collections.Generic;
using ADOFAIRenderer.Core; using ADOFAIRenderer.Core;
using UnityEngine; using UnityEngine;
namespace ADOFAIRenderer.Util.Audio namespace ADOFAIRenderer.Util.Audio;
{
internal static class AudioSpectrumGenerator internal static class AudioSpectrumGenerator
{ {
// ReSharper disable MemberCanBePrivate.Global
public static float[]? AudioClipData { get; private set; } public static float[]? AudioClipData { get; private set; }
public static int Channels { get; private set; } public static int Channels { get; private set; }
public static int Frequency { get; private set; } public static int Frequency { get; private set; }
public static int TotalSamples { get; private set; } public static int TotalSamples { get; private set; }
// ReSharper restore MemberCanBePrivate.Global
private static long _cachedFrame = -1; private static long _cachedFrame = -1;
private static readonly Dictionary<int, float[]> CachedSpectrums = new(); private static readonly Dictionary<int, float[]> CachedSpectrums = new();
@@ -237,4 +239,3 @@ namespace ADOFAIRenderer.Util.Audio
} }
} }
} }
}
+2 -3
View File
@@ -1,7 +1,7 @@
using System; using System;
namespace ADOFAIRenderer.Util.Audio namespace ADOFAIRenderer.Util.Audio;
{
internal class AudioSyncCalculator internal class AudioSyncCalculator
{ {
private readonly long _sampleRate; private readonly long _sampleRate;
@@ -38,4 +38,3 @@ namespace ADOFAIRenderer.Util.Audio
return (int)samplesNeeded; return (int)samplesNeeded;
} }
} }
}
+2 -3
View File
@@ -1,7 +1,7 @@
using System; using System;
namespace ADOFAIRenderer.Util.Audio.Filter namespace ADOFAIRenderer.Util.Audio.Filter;
{
internal class Gain : IAudioFilter internal class Gain : IAudioFilter
{ {
public float Level = 0f; public float Level = 0f;
@@ -21,4 +21,3 @@ namespace ADOFAIRenderer.Util.Audio.Filter
public double Latency => 0.0; public double Latency => 0.0;
} }
}
+2 -3
View File
@@ -1,8 +1,8 @@
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace ADOFAIRenderer.Util.Audio.Filter namespace ADOFAIRenderer.Util.Audio.Filter;
{
internal class HardClip : IAudioFilter internal class HardClip : IAudioFilter
{ {
// ReSharper disable once MemberCanBePrivate.Global // ReSharper disable once MemberCanBePrivate.Global
@@ -30,4 +30,3 @@ namespace ADOFAIRenderer.Util.Audio.Filter
public double Latency => 0.0; public double Latency => 0.0;
} }
}
+2 -3
View File
@@ -1,7 +1,7 @@
using System; using System;
namespace ADOFAIRenderer.Util.Audio.Filter namespace ADOFAIRenderer.Util.Audio.Filter;
{
internal interface IAudioFilter internal interface IAudioFilter
{ {
void Initialize(int sampleRate, int channels); void Initialize(int sampleRate, int channels);
@@ -13,4 +13,3 @@ namespace ADOFAIRenderer.Util.Audio.Filter
double Latency { get; } double Latency { get; }
} }
}
+4 -5
View File
@@ -1,8 +1,8 @@
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace ADOFAIRenderer.Util.Audio.Filter namespace ADOFAIRenderer.Util.Audio.Filter;
{
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
internal class RMSCompressor : IAudioFilter internal class RMSCompressor : IAudioFilter
{ {
@@ -219,11 +219,10 @@ namespace ADOFAIRenderer.Util.Audio.Filter
Array.Clear(_rmsState, 0, _rmsState.Length); Array.Clear(_rmsState, 0, _rmsState.Length);
Array.Clear(_gainState, 0, _gainState.Length); Array.Clear(_gainState, 0, _gainState.Length);
for (int i = 0; i < _delayBuffers.Length; i++) foreach (var delayBuffer in _delayBuffers)
{ {
Array.Clear(_delayBuffers[i], 0, _delayBuffers[i].Length); Array.Clear(delayBuffer, 0, delayBuffer.Length);
} }
Array.Clear(_delayWriteIndices, 0, _delayWriteIndices.Length); Array.Clear(_delayWriteIndices, 0, _delayWriteIndices.Length);
} }
} }
}
+2 -3
View File
@@ -5,8 +5,8 @@ using ADOFAIRenderer.Util.Audio.Filter;
using MelonLoader; using MelonLoader;
using UnityEngine; using UnityEngine;
namespace ADOFAIRenderer.Util.Audio namespace ADOFAIRenderer.Util.Audio;
{
internal class AudioClipCache internal class AudioClipCache
{ {
private readonly Dictionary<string, CachedClipData> _cache = new(); private readonly Dictionary<string, CachedClipData> _cache = new();
@@ -414,4 +414,3 @@ namespace ADOFAIRenderer.Util.Audio
} }
} }
} }
}