SHA256
Compare commits
26
Commits
| Author | SHA256 | Date | |
|---|---|---|---|
|
|
51626f65c7
|
||
|
|
65669d5afd
|
||
|
|
5929b5ddbe
|
||
|
|
a7c64e6c27
|
||
|
|
36c569057c
|
||
|
|
b05e18c8bb
|
||
|
|
888663aa86
|
||
|
|
1a8fcaec7d
|
||
|
|
394fe00b25
|
||
|
|
48a56cd3f2
|
||
|
|
63f38883c8
|
||
|
|
24ec6aa1d0
|
||
|
|
44caf92ada | ||
|
|
b3e50cd50e
|
||
|
|
1d4b1cdd46
|
||
|
|
98cf00578d | ||
|
|
b6f1c0e4d2 | ||
|
|
477b46a8dc
|
||
|
|
6e348ecae3
|
||
|
|
b15903f1e0
|
||
|
|
6c0347609d
|
||
|
|
92a4654f14
|
||
|
|
ec5b2f0ab6
|
||
|
|
85575d3185
|
||
|
|
2277025829
|
||
|
|
e3cb2263d9
|
No files matched your search
@@ -42,3 +42,4 @@ GEMINI.md
|
|||||||
# Developer Description Files
|
# Developer Description Files
|
||||||
/AsyncInputAutoplayFix.md
|
/AsyncInputAutoplayFix.md
|
||||||
/AudioMixerExplanation.md
|
/AudioMixerExplanation.md
|
||||||
|
/O5Theme.md
|
||||||
+14
-27
@@ -16,6 +16,9 @@
|
|||||||
<Reference Include="0Harmony">
|
<Reference Include="0Harmony">
|
||||||
<HintPath>$(ADOFAI_PATH)\MelonLoader\net35\0Harmony.dll</HintPath>
|
<HintPath>$(ADOFAI_PATH)\MelonLoader\net35\0Harmony.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="O5Kit">
|
||||||
|
<HintPath>$(ADOFAI_PATH)\UserLibs\O5Kit.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Assembly-CSharp">
|
<Reference Include="Assembly-CSharp">
|
||||||
<HintPath>$(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\Assembly-CSharp.dll</HintPath>
|
<HintPath>$(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -81,37 +84,21 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="Bundle\Win64\fonts" />
|
|
||||||
<EmbeddedResource Include="Bundle\Win64\fonts" />
|
|
||||||
<None Remove="Bundle\Win64\scenes" />
|
|
||||||
<EmbeddedResource Include="Bundle\Win64\scenes" />
|
|
||||||
<None Remove="Bundle\Win64\shaders" />
|
|
||||||
<EmbeddedResource Include="Bundle\Win64\shaders" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="Bundle\Linux\fonts" />
|
|
||||||
<EmbeddedResource Include="Bundle\Linux\fonts" />
|
|
||||||
<None Remove="Bundle\Linux\scenes" />
|
|
||||||
<EmbeddedResource Include="Bundle\Linux\scenes" />
|
|
||||||
<None Remove="Bundle\Linux\shaders" />
|
|
||||||
<EmbeddedResource Include="Bundle\Linux\shaders" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="Bundle\OSX\fonts" />
|
|
||||||
<EmbeddedResource Include="Bundle\OSX\fonts" />
|
|
||||||
<None Remove="Bundle\OSX\scenes" />
|
|
||||||
<EmbeddedResource Include="Bundle\OSX\scenes" />
|
|
||||||
<None Remove="Bundle\OSX\shaders" />
|
|
||||||
<EmbeddedResource Include="Bundle\OSX\shaders" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="FFmpeg.AutoGen" Version="8.1.0" />
|
<PackageReference Include="FFmpeg.AutoGen" Version="8.1.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Localization/Locale/*.json" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Bundle/" />
|
||||||
|
<EmbeddedResource Include="Bundle/Linux/*" />
|
||||||
|
<EmbeddedResource Include="Bundle/Win64/*" />
|
||||||
|
<EmbeddedResource Include="Bundle/OSX/*" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- Build 후 XML 문서에서 ADOFAIRenderer.API 네임스페이스만 남기고 나머지 제거 -->
|
<!-- Build 후 XML 문서에서 ADOFAIRenderer.API 네임스페이스만 남기고 나머지 제거 -->
|
||||||
<UsingTask TaskName="FilterXmlDoc" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
|
<UsingTask TaskName="FilterXmlDoc" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
|
||||||
<ParameterGroup>
|
<ParameterGroup>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+7
-13
@@ -9,6 +9,7 @@ using System.Linq;
|
|||||||
using ADOFAIRenderer.API;
|
using ADOFAIRenderer.API;
|
||||||
using ADOFAIRenderer.Data;
|
using ADOFAIRenderer.Data;
|
||||||
using ADOFAIRenderer.UI;
|
using ADOFAIRenderer.UI;
|
||||||
|
using ADOFAIRenderer.UI.Window;
|
||||||
using ADOFAIRenderer.Util;
|
using ADOFAIRenderer.Util;
|
||||||
using ADOFAIRenderer.Util.Audio;
|
using ADOFAIRenderer.Util.Audio;
|
||||||
using ADOFAIRenderer.Util.FFmpeg;
|
using ADOFAIRenderer.Util.FFmpeg;
|
||||||
@@ -336,7 +337,8 @@ internal class RenderManager : MonoBehaviour
|
|||||||
(Func<bool>)Delegate.CreateDelegate(typeof(Func<bool>), scnEditor.instance, targetMethod);
|
(Func<bool>)Delegate.CreateDelegate(typeof(Func<bool>), scnEditor.instance, targetMethod);
|
||||||
|
|
||||||
Application.wantsToQuit -= quitDelegate;
|
Application.wantsToQuit -= quitDelegate;
|
||||||
ADOBase.loader.LoadSceneWithTransition(WipeDirection.StartsFromRight, "Assets/Scenes/RenderSettingsScene.unity");
|
RenderConfigWindow.CreateWindow();
|
||||||
|
// ADOBase.loader.LoadSceneWithTransition(WipeDirection.StartsFromRight, "Assets/Scenes/RenderSettingsScene.unity");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,9 +364,10 @@ internal class RenderManager : MonoBehaviour
|
|||||||
|
|
||||||
private IEnumerator SetupPlay()
|
private IEnumerator SetupPlay()
|
||||||
{
|
{
|
||||||
if (Configuration.AudioConfig.RenderAudio && Configuration.VideoConfig.Codec is Codec.VP9 or Codec.AV1 or Codec.VVC)
|
if (Configuration.AudioConfig.RenderAudio)
|
||||||
{
|
{
|
||||||
Configuration.AudioConfig.AudioSampleRate = 48000;
|
if (!CodecUtil.AvailableSampleRate[CodecUtil.AudioCodecMatch[Configuration.VideoConfig.Codec]].Contains(Configuration.AudioConfig.AudioSampleRate))
|
||||||
|
Configuration.AudioConfig.AudioSampleRate = 48000; // most compatible value
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; countdown > 0; countdown--)
|
for (; countdown > 0; countdown--)
|
||||||
@@ -461,7 +464,7 @@ internal class RenderManager : MonoBehaviour
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var effectiveVideoFps = Math.Min(videoFPS, renderFPS);
|
var effectiveVideoFps = Math.Min(videoFPS, renderFPS);
|
||||||
var codecId = AudioCodecMatch[Configuration.VideoConfig.Codec];
|
var codecId = CodecUtil.AudioCodecMatch[Configuration.VideoConfig.Codec];
|
||||||
var settings = new FFmpegNativeEncoder.EncoderSettings
|
var settings = new FFmpegNativeEncoder.EncoderSettings
|
||||||
{
|
{
|
||||||
Width = Configuration.RenderWidth,
|
Width = Configuration.RenderWidth,
|
||||||
@@ -814,13 +817,4 @@ internal class RenderManager : MonoBehaviour
|
|||||||
Melon<RenderMod>.Logger.Error($"OnLastUpdate callback caused error: {err}");
|
Melon<RenderMod>.Logger.Error($"OnLastUpdate callback caused error: {err}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly Dictionary<Codec, AVCodecID> AudioCodecMatch = new()
|
|
||||||
{
|
|
||||||
[Codec.H264] = AVCodecID.AV_CODEC_ID_AAC,
|
|
||||||
[Codec.H265] = AVCodecID.AV_CODEC_ID_AAC,
|
|
||||||
[Codec.VP9] = AVCodecID.AV_CODEC_ID_OPUS,
|
|
||||||
[Codec.AV1] = AVCodecID.AV_CODEC_ID_OPUS,
|
|
||||||
[Codec.VVC] = AVCodecID.AV_CODEC_ID_OPUS
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,7 @@ public class RenderConfig
|
|||||||
public AudioEncodingConfig AudioConfig { get; set; } = new();
|
public AudioEncodingConfig AudioConfig { get; set; } = new();
|
||||||
public AdvancedConfig AdvancedConfig { get; set; } = new();
|
public AdvancedConfig AdvancedConfig { get; set; } = new();
|
||||||
|
|
||||||
public double DelayAfterEnd { get; set; }
|
public double DelayAfterEnd { get; set; } = 15;
|
||||||
public bool ShowJudgementText { get; set; } = false;
|
public bool ShowJudgementText { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ public class VideoEncodingConfig
|
|||||||
|
|
||||||
public class AudioEncodingConfig
|
public class AudioEncodingConfig
|
||||||
{
|
{
|
||||||
private int _audioSampleRate = 44100;
|
private int _audioSampleRate = 48000;
|
||||||
private int _audioChannels = 2;
|
private int _audioChannels = 2;
|
||||||
private int _audioBitrate = 256000;
|
private int _audioBitrate = 256000;
|
||||||
|
|
||||||
@@ -57,8 +57,8 @@ public class AudioEncodingConfig
|
|||||||
|
|
||||||
public int AudioSampleRate
|
public int AudioSampleRate
|
||||||
{
|
{
|
||||||
get => _audioSampleRate <= 0 ? 44100 : _audioSampleRate;
|
get => _audioSampleRate <= 0 ? 48000 : _audioSampleRate;
|
||||||
set => _audioSampleRate = value <= 0 ? 44100 : value;
|
set => _audioSampleRate = value <= 0 ? 48000 : value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int AudioChannels
|
public int AudioChannels
|
||||||
|
|||||||
+34
-83
@@ -1,85 +1,36 @@
|
|||||||
{
|
{
|
||||||
"ui.button.presets": "Presets",
|
"ui.render_config.window_title": "Render Config",
|
||||||
"ui.placeholder.render_fps": "Render FPS",
|
"ui.render_config.render_fps": "Render FPS",
|
||||||
"ui.placeholder.video_fps": "Video FPS",
|
"ui.render_config.video_fps": "Video FPS",
|
||||||
"ui.placeholder.render_width": "Render Width (px)",
|
"ui.render_config.render_width": "Render Width",
|
||||||
"ui.placeholder.render_height": "Render Height (px)",
|
"ui.render_config.render_height": "Render Height",
|
||||||
"ui.button.video_config": "Video Encoding Config",
|
"ui.render_config.delay_after_end": "Delay After End (s)",
|
||||||
"ui.button.audio_config": "Audio Encoding Config",
|
"ui.render_config.show_judgement": "Show Judgement Text",
|
||||||
"ui.placeholder.delay_after_end": "Delay After Level End",
|
"ui.render_config.video_encoding": "Video Encoding Config",
|
||||||
"ui.toggle.show_judgement": "Show Judgement",
|
"ui.render_config.audio_encoding": "Audio Encoding Config",
|
||||||
"ui.button.go_render": "Go Render",
|
"ui.render_config.global_settings": "Global Settings",
|
||||||
"ui.button.advanced_settings": "Advanced Settings...",
|
"ui.render_config.advanced_settings": "Advanced Settings",
|
||||||
"ui.version.expired": " (Expired)",
|
"ui.render_config.go_render": "Go Render",
|
||||||
"ui.validation.required_fields": "Required input fields are empty or invalid. Please fill in all settings.",
|
"ui.render_config.codec": "Codec",
|
||||||
|
"ui.render_config.rate_control": "Rate Control Mode",
|
||||||
"ui.advanced.title": "Advanced Settings",
|
"ui.render_config.bitrate": "Bitrate (kbps)",
|
||||||
"ui.advanced.file_extension": "File Extension",
|
"ui.render_config.max_bitrate": "Max Bitrate (kbps)",
|
||||||
"ui.advanced.process_audio": "Process Audio",
|
"ui.render_config.qp": "Quality (QP)",
|
||||||
"ui.advanced.non_tile_mode": "Non-Tile Mode",
|
"ui.render_config.keyframe_interval": "Keyframe Interval (s)",
|
||||||
"ui.advanced.random_seed": "Random Seed (Optional)",
|
"ui.render_config.force_software": "Force Software Encoder",
|
||||||
"ui.button.cancel": "Cancel",
|
"ui.render_config.render_audio": "Render Audio",
|
||||||
"ui.button.save": "Save",
|
"ui.render_config.sample_rate": "Sample Rate (Hz)",
|
||||||
|
"ui.render_config.channels": "Audio Channels",
|
||||||
"ui.video.title": "Video Encoding Settings",
|
"ui.render_config.audio_bitrate": "Audio Bitrate (kbps)",
|
||||||
"ui.video.codec": "Codec",
|
"ui.render_config.output_dir": "Output Directory",
|
||||||
"ui.video.rate_control": "Bitrate Control Mode",
|
"ui.render_config.browse": "Browse...",
|
||||||
"ui.video.bitrate": "Bitrate (kbps)",
|
"ui.render_config.reset_default": "Reset to Default",
|
||||||
"ui.video.max_bitrate": "Max Bitrate (kbps)",
|
"ui.render_config.file_extension": "File Extension",
|
||||||
"ui.video.qp": "Quality (QP)",
|
"ui.render_config.process_audio": "Process Audio",
|
||||||
"ui.video.keyframe_interval": "Keyframe Interval (s)",
|
"ui.render_config.non_tile": "Non-Tile Mode",
|
||||||
"ui.video.force_software": "Force Software Encoder",
|
"ui.render_config.random_seed": "Random Seed (Optional)",
|
||||||
"ui.video.qp_zero_warning": "Warning: Setting QP to 0 applies lossless encoding and may result in very large file sizes.",
|
"ui.render_config.validation_title": "Invalid Settings",
|
||||||
|
"ui.render_config.validation_error": "Please check your input values:\n- Width and Height must be integers > 0\n- Render FPS and Video FPS must be > 0\n- Delay After End must be >= 0",
|
||||||
"ui.audio.title": "Audio Encoding Settings",
|
"ui.render_config.invalid_path": "Output directory path is invalid:\n{0}",
|
||||||
"ui.audio.rendering": "Audio Rendering",
|
"ui.render_config.expired": "(Expired)"
|
||||||
"ui.audio.sample_rate": "Sample Rate (Hz)",
|
|
||||||
"ui.audio.channels": "Audio Channels",
|
|
||||||
"ui.audio.channels_mono": "1 (Mono)",
|
|
||||||
"ui.audio.channels_stereo": "2 (Stereo)",
|
|
||||||
"ui.audio.bitrate": "Audio Bitrate (kbps)",
|
|
||||||
|
|
||||||
"ui.preset.title": "Preset Settings",
|
|
||||||
"ui.preset.new_name": "New Preset Name",
|
|
||||||
"ui.preset.no_presets": "No saved presets.",
|
|
||||||
"ui.button.load": "Load",
|
|
||||||
"ui.button.delete": "Delete",
|
|
||||||
"ui.button.close": "Close",
|
|
||||||
"ui.preset.save_failed": "Save Failed",
|
|
||||||
"ui.preset.enter_name": "Please enter a preset name.",
|
|
||||||
"ui.preset.invalid_inputs": "Cannot save preset because required input values are empty or invalid.",
|
|
||||||
"ui.preset.save_error": "An error occurred while saving the preset: {0}",
|
|
||||||
"ui.preset.delete_title": "Delete Preset",
|
|
||||||
"ui.preset.delete_confirm": "Are you sure you want to delete the preset '{0}'?",
|
|
||||||
"ui.button.yes": "Yes",
|
|
||||||
"ui.button.no": "No",
|
|
||||||
"ui.button.ok": "OK",
|
|
||||||
|
|
||||||
"ui.ffmpeg.title": "FFmpeg Library Installation Required",
|
|
||||||
"ui.ffmpeg.desc_main": "FFmpeg shared libraries are required to render video.",
|
|
||||||
"ui.ffmpeg.desc_osx": "For macOS, reliable public builds are unavailable, so FFmpeg 8.1 must be built manually.\nClick the button below to open the official FFmpeg website.",
|
|
||||||
"ui.ffmpeg.desc_auto": "Click the button below to automatically download and install from the internet.\n<color=#aaaaaa><size=13>(Download size: ~70MB, extracted to UserLibs folder)</size></color>",
|
|
||||||
"ui.ffmpeg.button_download": "Download & Install",
|
|
||||||
"ui.ffmpeg.button_open_web": "Open Download Page",
|
|
||||||
"ui.ffmpeg.button_cancel": "Cancel",
|
|
||||||
"ui.ffmpeg.button_opening": "Opening...",
|
|
||||||
"ui.ffmpeg.status_downloading": "Downloading... ({0:F1}%)",
|
|
||||||
"ui.ffmpeg.status_extracting": "Extracting FFmpeg files...",
|
|
||||||
"ui.ffmpeg.status_done": "Done! Restarting audio/video engine...",
|
|
||||||
"ui.ffmpeg.status_failed": "Failed to download FFmpeg: {0}",
|
|
||||||
|
|
||||||
"ui.escape.cancelling": "<color=#FF5252>Cancelling in {0:F1}s..</color>\n<size=40><color=#DDDDDD>Hold Esc to cancel render</color></size>",
|
|
||||||
|
|
||||||
"ui.monitor.title": "ADOFAI Renderer Realtime Monitor",
|
|
||||||
"ui.monitor.queue": "• Queue: <b>{0}</b> / {1} frames",
|
|
||||||
"ui.monitor.rendered_frames": "• Rendered Frames: <b>{0}</b>",
|
|
||||||
"ui.monitor.frames_sent": "• Frames Sent: <b>{0}</b>",
|
|
||||||
"ui.monitor.throttling": "• Throttling Controls: {0} times",
|
|
||||||
"ui.monitor.readback_failures": "• Readback Hard Failures: <color=#ff3333>{0}</color> times",
|
|
||||||
"ui.monitor.skip_retry": "• Render Skip-Retry: {0} / {1}",
|
|
||||||
"ui.monitor.memory": "• Mono Heap Memory: {0:F2} MB",
|
|
||||||
|
|
||||||
"ui.notification.complete_title": "Rendering Complete!",
|
|
||||||
"ui.notification.complete_msg": "{0} saved successfully.",
|
|
||||||
"ui.notification.video_fallback": "Video"
|
|
||||||
}
|
}
|
||||||
+34
-83
@@ -1,85 +1,36 @@
|
|||||||
{
|
{
|
||||||
"ui.button.presets": "프리셋",
|
"ui.render_config.window_title": "렌더 설정",
|
||||||
"ui.placeholder.render_fps": "렌더링 FPS",
|
"ui.render_config.render_fps": "렌더링 FPS",
|
||||||
"ui.placeholder.video_fps": "영상 FPS",
|
"ui.render_config.video_fps": "영상 FPS",
|
||||||
"ui.placeholder.render_width": "렌더링 너비 (px)",
|
"ui.render_config.render_width": "렌더링 너비",
|
||||||
"ui.placeholder.render_height": "렌더링 높이 (px)",
|
"ui.render_config.render_height": "렌더링 높이",
|
||||||
"ui.button.video_config": "비디오 인코딩 설정",
|
"ui.render_config.delay_after_end": "종료 후 대기 시간 (초)",
|
||||||
"ui.button.audio_config": "오디오 인코딩 설정",
|
"ui.render_config.show_judgement": "판정 텍스트 표시",
|
||||||
"ui.placeholder.delay_after_end": "레벨 종료 후 대기 시간 (초)",
|
"ui.render_config.video_encoding": "Video Encoding Config",
|
||||||
"ui.toggle.show_judgement": "판정 텍스트 표시",
|
"ui.render_config.audio_encoding": "Audio Encoding Config",
|
||||||
"ui.button.go_render": "렌더링 시작",
|
"ui.render_config.global_settings": "Global Settings",
|
||||||
"ui.button.advanced_settings": "고급 설정...",
|
"ui.render_config.advanced_settings": "Advanced Settings",
|
||||||
"ui.version.expired": " (만료됨)",
|
"ui.render_config.go_render": "렌더 시작",
|
||||||
"ui.validation.required_fields": "필수 입력란이 비어 있거나 올바르지 않습니다. 모든 설정을 확인해 주세요.",
|
"ui.render_config.codec": "코덱",
|
||||||
|
"ui.render_config.rate_control": "비트레이트 제어 모드",
|
||||||
"ui.advanced.title": "고급 설정",
|
"ui.render_config.bitrate": "비트레이트 (kbps)",
|
||||||
"ui.advanced.file_extension": "파일 확장자",
|
"ui.render_config.max_bitrate": "최대 비트레이트 (kbps)",
|
||||||
"ui.advanced.process_audio": "오디오 처리",
|
"ui.render_config.qp": "품질 (QP)",
|
||||||
"ui.advanced.non_tile_mode": "논타일 모드",
|
"ui.render_config.keyframe_interval": "키프레임 간격 (초)",
|
||||||
"ui.advanced.random_seed": "랜덤 시드 (선택 사항)",
|
"ui.render_config.force_software": "강제 소프트웨어 인코더",
|
||||||
"ui.button.cancel": "취소",
|
"ui.render_config.render_audio": "오디오 렌더링",
|
||||||
"ui.button.save": "저장",
|
"ui.render_config.sample_rate": "샘플레이트 (Hz)",
|
||||||
|
"ui.render_config.channels": "오디오 채널",
|
||||||
"ui.video.title": "비디오 인코딩 설정",
|
"ui.render_config.audio_bitrate": "오디오 비트레이트 (kbps)",
|
||||||
"ui.video.codec": "코덱",
|
"ui.render_config.output_dir": "출력 디렉토리",
|
||||||
"ui.video.rate_control": "비트레이트 제어 모드",
|
"ui.render_config.browse": "찾아보기...",
|
||||||
"ui.video.bitrate": "비트레이트 (kbps)",
|
"ui.render_config.reset_default": "기본값으로 초기화",
|
||||||
"ui.video.max_bitrate": "최대 비트레이트 (kbps)",
|
"ui.render_config.file_extension": "파일 확장자",
|
||||||
"ui.video.qp": "품질 (QP)",
|
"ui.render_config.process_audio": "오디오 처리",
|
||||||
"ui.video.keyframe_interval": "키프레임 간격 (초)",
|
"ui.render_config.non_tile": "논타일 모드",
|
||||||
"ui.video.force_software": "강제 소프트웨어 인코더",
|
"ui.render_config.random_seed": "랜덤 시드 (선택 사항)",
|
||||||
"ui.video.qp_zero_warning": "경고: QP를 0으로 설정하면 무손실 인코딩이 적용되어 파일 크기가 매우 커질 수 있습니다.",
|
"ui.render_config.validation_title": "설정 오류",
|
||||||
|
"ui.render_config.validation_error": "입력값을 확인해 주세요:\n- 너비와 높이는 0보다 큰 정수여야 합니다.\n- 렌더 FPS와 영상 FPS는 0보다 커야 합니다.\n- 종료 후 대기 시간은 0 이상이어야 합니다.",
|
||||||
"ui.audio.title": "오디오 인코딩 설정",
|
"ui.render_config.invalid_path": "출력 디렉토리 경로가 올바르지 않습니다:\n{0}",
|
||||||
"ui.audio.rendering": "오디오 렌더링",
|
"ui.render_config.expired": "(만료됨)"
|
||||||
"ui.audio.sample_rate": "샘플레이트 (Hz)",
|
|
||||||
"ui.audio.channels": "오디오 채널",
|
|
||||||
"ui.audio.channels_mono": "1 (모노)",
|
|
||||||
"ui.audio.channels_stereo": "2 (스테레오)",
|
|
||||||
"ui.audio.bitrate": "오디오 비트레이트 (kbps)",
|
|
||||||
|
|
||||||
"ui.preset.title": "프리셋 설정",
|
|
||||||
"ui.preset.new_name": "새 프리셋 이름",
|
|
||||||
"ui.preset.no_presets": "저장된 프리셋이 없습니다.",
|
|
||||||
"ui.button.load": "불러오기",
|
|
||||||
"ui.button.delete": "삭제",
|
|
||||||
"ui.button.close": "닫기",
|
|
||||||
"ui.preset.save_failed": "저장 실패",
|
|
||||||
"ui.preset.enter_name": "프리셋 이름을 입력해 주세요.",
|
|
||||||
"ui.preset.invalid_inputs": "필수 입력값이 비어 있거나 올바르지 않아 프리셋을 저장할 수 없습니다.",
|
|
||||||
"ui.preset.save_error": "프리셋 저장 중 오류가 발생했습니다: {0}",
|
|
||||||
"ui.preset.delete_title": "프리셋 삭제",
|
|
||||||
"ui.preset.delete_confirm": "정말 '{0}' 프리셋을 삭제하시겠습니까?",
|
|
||||||
"ui.button.yes": "예",
|
|
||||||
"ui.button.no": "아니오",
|
|
||||||
"ui.button.ok": "확인",
|
|
||||||
|
|
||||||
"ui.ffmpeg.title": "FFmpeg 라이브러리 설치 필요",
|
|
||||||
"ui.ffmpeg.desc_main": "영상을 렌더링하려면 FFmpeg 공유 라이브러리가 필요합니다.",
|
|
||||||
"ui.ffmpeg.desc_osx": "macOS의 경우 신뢰할 수 있는 빌드가 제공되지 않아 FFmpeg 8.1을 직접 빌드해야 합니다.\n아래 버튼을 눌러 공식 FFmpeg 웹사이트를 방문하세요.",
|
|
||||||
"ui.ffmpeg.desc_auto": "아래 버튼을 눌러 인터넷에서 자동으로 다운로드하여 설치합니다.\n<color=#aaaaaa><size=13>(다운로드 크기: 약 70MB, UserLibs 폴더에 압축 해제됨)</size></color>",
|
|
||||||
"ui.ffmpeg.button_download": "다운로드 및 설치",
|
|
||||||
"ui.ffmpeg.button_open_web": "다운로드 페이지 열기",
|
|
||||||
"ui.ffmpeg.button_cancel": "취소",
|
|
||||||
"ui.ffmpeg.button_opening": "열리는 중...",
|
|
||||||
"ui.ffmpeg.status_downloading": "다운로드 중... ({0:F1}%)",
|
|
||||||
"ui.ffmpeg.status_extracting": "FFmpeg 파일 압축 해제 중...",
|
|
||||||
"ui.ffmpeg.status_done": "완료! 오디오/비디오 엔진을 재시작합니다...",
|
|
||||||
"ui.ffmpeg.status_failed": "FFmpeg 다운로드 실패: {0}",
|
|
||||||
|
|
||||||
"ui.escape.cancelling": "<color=#FF5252>{0:F1}초 후 취소됩니다..</color>\n<size=40><color=#DDDDDD>렌더링을 취소하려면 Esc를 길게 누르세요</color></size>",
|
|
||||||
|
|
||||||
"ui.monitor.title": "ADOFAI Renderer 실시간 모니터",
|
|
||||||
"ui.monitor.queue": "• 대기열: <b>{0}</b> / {1} 프레임",
|
|
||||||
"ui.monitor.rendered_frames": "• 렌더링된 프레임: <b>{0}</b>",
|
|
||||||
"ui.monitor.frames_sent": "• 전송된 프레임: <b>{0}</b>",
|
|
||||||
"ui.monitor.throttling": "• 쓰로틀링 제어: {0}회",
|
|
||||||
"ui.monitor.readback_failures": "• 리드백 실패: <color=#ff3333>{0}</color>회",
|
|
||||||
"ui.monitor.skip_retry": "• 렌더 건너뜀-재시도: {0} / {1}",
|
|
||||||
"ui.monitor.memory": "• 모노 힙 메모리: {0:F2} MB",
|
|
||||||
|
|
||||||
"ui.notification.complete_title": "렌더링 완료!",
|
|
||||||
"ui.notification.complete_msg": "{0}이(가) 성공적으로 저장되었습니다.",
|
|
||||||
"ui.notification.video_fallback": "동영상"
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -33,6 +32,11 @@ internal static class LocalizationManager
|
|||||||
|
|
||||||
private static bool _initialized;
|
private static bool _initialized;
|
||||||
|
|
||||||
|
static LocalizationManager()
|
||||||
|
{
|
||||||
|
Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes the localization system and loads embedded language dictionaries.
|
/// Initializes the localization system and loads embedded language dictionaries.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -115,7 +119,7 @@ internal static class LocalizationManager
|
|||||||
localeCode = FallbackLocaleCode;
|
localeCode = FallbackLocaleCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
var isChanged = (language != CurrentLanguage) || (localeCode != CurrentLocaleCode);
|
var isChanged = language != CurrentLanguage || localeCode != CurrentLocaleCode;
|
||||||
|
|
||||||
CurrentLanguage = language;
|
CurrentLanguage = language;
|
||||||
CurrentLocaleCode = localeCode;
|
CurrentLocaleCode = localeCode;
|
||||||
@@ -140,6 +144,7 @@ internal static class LocalizationManager
|
|||||||
public static string Get(string key)
|
public static string Get(string key)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(key)) return string.Empty;
|
if (string.IsNullOrEmpty(key)) return string.Empty;
|
||||||
|
if (!_initialized) Initialize();
|
||||||
|
|
||||||
// 1. Try currently active locale
|
// 1. Try currently active locale
|
||||||
if (Locales.TryGetValue(CurrentLocaleCode, out var activeDict) && activeDict.TryGetValue(key, out var val))
|
if (Locales.TryGetValue(CurrentLocaleCode, out var activeDict) && activeDict.TryGetValue(key, out var val))
|
||||||
@@ -165,7 +170,7 @@ internal static class LocalizationManager
|
|||||||
public static string Get(string key, params object[] args)
|
public static string Get(string key, params object[] args)
|
||||||
{
|
{
|
||||||
var template = Get(key);
|
var template = Get(key);
|
||||||
if (args == null || args.Length == 0) return template;
|
if (args.Length == 0) return template;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -185,7 +190,6 @@ internal static class LocalizationManager
|
|||||||
return language switch
|
return language switch
|
||||||
{
|
{
|
||||||
SystemLanguage.Korean => "ko",
|
SystemLanguage.Korean => "ko",
|
||||||
SystemLanguage.English => "en",
|
|
||||||
_ => "en"
|
_ => "en"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -218,6 +222,7 @@ internal static class LocalizationManager
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Convenient shorthand alias for <see cref="LocalizationManager"/>.
|
/// Convenient shorthand alias for <see cref="LocalizationManager"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
internal static class I18n
|
internal static class I18n
|
||||||
{
|
{
|
||||||
/// <inheritdoc cref="LocalizationManager.Get(string)"/>
|
/// <inheritdoc cref="LocalizationManager.Get(string)"/>
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ public static class PlanetRendererPatch
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
void ApplyColor(ref PlanetColor planetColor, scrPlanet targetPlanet, Color? customColor)
|
void ApplyColor(ref PlanetColor planetColor, scrPlanet? targetPlanet, Color? customColor)
|
||||||
{
|
{
|
||||||
if (__instance == targetPlanet.planetRenderer && customColor != null)
|
if (targetPlanet != null && __instance == targetPlanet.planetRenderer && customColor != null)
|
||||||
planetColor = new PlanetColor(customColor.Value);
|
planetColor = new PlanetColor(customColor.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-39
@@ -2,72 +2,41 @@ using System;
|
|||||||
using ADOFAIRenderer;
|
using ADOFAIRenderer;
|
||||||
using ADOFAIRenderer.Core;
|
using ADOFAIRenderer.Core;
|
||||||
using ADOFAIRenderer.Data;
|
using ADOFAIRenderer.Data;
|
||||||
using ADOFAIRenderer.Util;
|
using ADOFAIRenderer.UI;
|
||||||
using FFmpeg.AutoGen;
|
using FFmpeg.AutoGen;
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
using MelonLoader.Utils;
|
using MelonLoader.Utils;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.EventSystems;
|
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
|
|
||||||
[assembly: MelonInfo(typeof(RenderMod), "ADOFAI Renderer", "0.3.3-BETA", "ADOFAI Editor Forum")]
|
[assembly: MelonInfo(typeof(RenderMod), "ADOFAI Renderer", "0.2.1-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;
|
||||||
|
|
||||||
internal class RenderMod : MelonMod
|
internal class RenderMod : MelonMod
|
||||||
{
|
{
|
||||||
public static AssetBundle FontBundle = null!;
|
|
||||||
// ReSharper disable once MemberCanBePrivate.Global
|
// ReSharper disable once MemberCanBePrivate.Global
|
||||||
public static AssetBundle SceneBundle = null!;
|
|
||||||
// ReSharper disable once MemberCanBePrivate.Global
|
|
||||||
public static AssetBundle ShaderBundle = null!;
|
|
||||||
public static ComputeShader ColorConversionShader = null!;
|
|
||||||
public static bool IsFeatureDisabled = false;
|
public static bool IsFeatureDisabled = false;
|
||||||
public static DateTime ExpirationTime = new(2026, 09, 21, 0, 0, 0, DateTimeKind.Utc);
|
public static DateTime ExpirationTime = new(2026, 11, 21, 0, 0, 0, DateTimeKind.Utc);
|
||||||
|
|
||||||
public override void OnInitializeMelon()
|
public override void OnInitializeMelon()
|
||||||
{
|
{
|
||||||
GlobalSettings.Load();
|
GlobalSettings.Load();
|
||||||
|
Localization.LocalizationManager.Initialize();
|
||||||
ffmpeg.RootPath = MelonEnvironment.UserLibsDirectory;
|
ffmpeg.RootPath = MelonEnvironment.UserLibsDirectory;
|
||||||
|
|
||||||
var renderManagerObj = new GameObject("Render Manager");
|
var renderManagerObj = new GameObject("Render Manager");
|
||||||
var updateHookerObj = new GameObject("Update Hooker");
|
var updateHookerObj = new GameObject("Update Hooker");
|
||||||
|
var uiManagerObj = new GameObject("Renderer UI Manager");
|
||||||
Object.DontDestroyOnLoad(renderManagerObj);
|
Object.DontDestroyOnLoad(renderManagerObj);
|
||||||
Object.DontDestroyOnLoad(updateHookerObj);
|
Object.DontDestroyOnLoad(updateHookerObj);
|
||||||
|
Object.DontDestroyOnLoad(uiManagerObj);
|
||||||
|
|
||||||
renderManagerObj.AddComponent<RenderManager>();
|
renderManagerObj.AddComponent<RenderManager>();
|
||||||
updateHookerObj.AddComponent<FirstUpdateHook>();
|
updateHookerObj.AddComponent<FirstUpdateHook>();
|
||||||
LoadBundles();
|
uiManagerObj.AddComponent<RendererUIManager>();
|
||||||
}
|
ModAssets.Load();
|
||||||
|
|
||||||
private static void LoadBundles()
|
|
||||||
{
|
|
||||||
FontBundle = BundleLoader.GetBundle("fonts");
|
|
||||||
SceneBundle = BundleLoader.GetBundle("scenes");
|
|
||||||
SceneBundle.GetAllScenePaths();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ShaderBundle = BundleLoader.GetBundle("shaders");
|
|
||||||
ColorConversionShader = ShaderBundle.LoadAsset<ComputeShader>("ColorConversion");
|
|
||||||
Melon<RenderMod>.Logger.Msg("Color conversion Compute Shader loaded successfully.");
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Melon<RenderMod>.Logger.Warning($"Failed to load Shader AssetBundle. GPU color conversion will be disabled and fallback to CPU. Error: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void FixEventSystem()
|
|
||||||
{
|
|
||||||
if (EventSystem.current == null) return;
|
|
||||||
var currentModule = EventSystem.current.currentInputModule;
|
|
||||||
|
|
||||||
if (currentModule) return;
|
|
||||||
Melon<RenderMod>.Logger.Msg("Ported Unity 6 Input Module.");
|
|
||||||
|
|
||||||
var newModule = EventSystem.current.gameObject.AddComponent<StandaloneInputModule>();
|
|
||||||
newModule.enabled = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnApplicationQuit()
|
public override void OnApplicationQuit()
|
||||||
|
|||||||
@@ -52,46 +52,6 @@ internal class CommonWarningDialogUI : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TMP_FontAsset GetNanumSquareNeoBdFontAsset()
|
|
||||||
{
|
|
||||||
TMP_FontAsset? font = null;
|
|
||||||
if (RenderMod.FontBundle)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
font = RenderMod.FontBundle.LoadAsset<TMP_FontAsset>("NanumSquareNeoOTF-Bd SDF");
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
// Loading failed
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fallback processing
|
|
||||||
if (!font)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
font = RDString.fontData.fontTMP;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
// ignored
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!font)
|
|
||||||
{
|
|
||||||
// ReSharper disable once Unity.UnknownResource
|
|
||||||
font = Resources.Load<TMP_FontAsset>("Fonts & Materials/LiberationSans SDF");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (font) return font;
|
|
||||||
var fonts = Resources.FindObjectsOfTypeAll<TMP_FontAsset>();
|
|
||||||
if (fonts.Length > 0) font = fonts[0];
|
|
||||||
|
|
||||||
return font!;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void ShowDialog(string title, string description, params DialogButton[] buttons)
|
public static void ShowDialog(string title, string description, params DialogButton[] buttons)
|
||||||
{
|
{
|
||||||
if (buttons.Length == 0) return;
|
if (buttons.Length == 0) return;
|
||||||
@@ -153,7 +113,7 @@ internal class CommonWarningDialogUI : MonoBehaviour
|
|||||||
bgRect.offsetMin = Vector2.zero;
|
bgRect.offsetMin = Vector2.zero;
|
||||||
bgRect.offsetMax = Vector2.zero;
|
bgRect.offsetMax = Vector2.zero;
|
||||||
|
|
||||||
var font = GetNanumSquareNeoBdFontAsset();
|
var font = ModAssets.NanumSquareNeoNormal;
|
||||||
|
|
||||||
// 2. Create modal container
|
// 2. Create modal container
|
||||||
var modalContainerObj = new GameObject("ModalContainer");
|
var modalContainerObj = new GameObject("ModalContainer");
|
||||||
|
|||||||
+2
-36
@@ -30,39 +30,6 @@ internal class DebugMonitorUI : MonoBehaviour
|
|||||||
private RectTransform _fillRect = null!;
|
private RectTransform _fillRect = null!;
|
||||||
private TextMeshProUGUI _progressText = null!;
|
private TextMeshProUGUI _progressText = null!;
|
||||||
|
|
||||||
private static TMP_FontAsset GetNanumSquareNeoBdFontAsset()
|
|
||||||
{
|
|
||||||
TMP_FontAsset? font = null;
|
|
||||||
if (RenderMod.FontBundle != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
font = RenderMod.FontBundle.LoadAsset<TMP_FontAsset>("NanumSquareNeoOTF-Bd SDF");
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
// Loading failed
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fallback: Use game's own font or built-in TMP SDF font if AssetBundle loading fails
|
|
||||||
if (font == null)
|
|
||||||
{
|
|
||||||
font = RDString.fontData.fontTMP;
|
|
||||||
}
|
|
||||||
if (font == null)
|
|
||||||
{
|
|
||||||
// ReSharper disable once Unity.UnknownResource
|
|
||||||
font = Resources.Load<TMP_FontAsset>("Fonts & Materials/LiberationSans SDF");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (font != null) return font;
|
|
||||||
var fonts = Resources.FindObjectsOfTypeAll<TMP_FontAsset>();
|
|
||||||
if (fonts.Length > 0) font = fonts[0];
|
|
||||||
|
|
||||||
return font!;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
// Set UI layer (5)
|
// Set UI layer (5)
|
||||||
@@ -112,8 +79,7 @@ internal class DebugMonitorUI : MonoBehaviour
|
|||||||
_text.overflowMode = TextOverflowModes.Overflow;
|
_text.overflowMode = TextOverflowModes.Overflow;
|
||||||
|
|
||||||
// Load and apply font
|
// Load and apply font
|
||||||
var font = GetNanumSquareNeoBdFontAsset();
|
_text.font = ModAssets.NanumSquareNeoNormal;
|
||||||
_text.font = font;
|
|
||||||
|
|
||||||
var textRect = textObj.GetComponent<RectTransform>();
|
var textRect = textObj.GetComponent<RectTransform>();
|
||||||
textRect.anchorMin = Vector2.zero;
|
textRect.anchorMin = Vector2.zero;
|
||||||
@@ -166,7 +132,7 @@ internal class DebugMonitorUI : MonoBehaviour
|
|||||||
_progressText.richText = true;
|
_progressText.richText = true;
|
||||||
_progressText.fontSize = BarTextFontSize;
|
_progressText.fontSize = BarTextFontSize;
|
||||||
_progressText.alignment = TextAlignmentOptions.Center;
|
_progressText.alignment = TextAlignmentOptions.Center;
|
||||||
_progressText.font = font;
|
_progressText.font = ModAssets.NanumSquareNeoNormal;
|
||||||
_progressText.color = BarTextColor;
|
_progressText.color = BarTextColor;
|
||||||
|
|
||||||
// Add progress bar text outline for readability
|
// Add progress bar text outline for readability
|
||||||
|
|||||||
@@ -88,11 +88,11 @@ internal class FFmpegDownloadUI : MonoBehaviour
|
|||||||
private static TMP_FontAsset GetNanumSquareNeoBdFontAsset()
|
private static TMP_FontAsset GetNanumSquareNeoBdFontAsset()
|
||||||
{
|
{
|
||||||
TMP_FontAsset? font = null;
|
TMP_FontAsset? font = null;
|
||||||
if (RenderMod.FontBundle)
|
if (ModAssets.FontBundle)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
font = RenderMod.FontBundle.LoadAsset<TMP_FontAsset>("NanumSquareNeoOTF-Bd SDF");
|
font = ModAssets.FontBundle.LoadAsset<TMP_FontAsset>("NanumSquareNeoOTF-Bd SDF");
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,124 @@
|
|||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using ADOFAIRenderer.Util;
|
||||||
|
using MelonLoader;
|
||||||
|
using O5Kit.Core;
|
||||||
|
using TMPro;
|
||||||
|
|
||||||
|
namespace ADOFAIRenderer.UI;
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||||
|
internal static class ModAssets
|
||||||
|
{
|
||||||
|
public static void Load()
|
||||||
|
{
|
||||||
|
FontBundle = BundleLoader.GetBundle("fonts");
|
||||||
|
NanumSquareNeoNormal = FontBundle.LoadAsset<TMP_FontAsset>("NanumSquareNeoOTF-Bd SDF");
|
||||||
|
NanumSquareNeoBold = FontBundle.LoadAsset<TMP_FontAsset>("NanumSquareNeoOTF-Eb SDF");
|
||||||
|
Melon<RenderMod>.Logger.Msg("Fonts loaded successfully.");
|
||||||
|
|
||||||
|
ShaderBundle = BundleLoader.GetBundle("shaders");
|
||||||
|
ColorConversionShader = ShaderBundle.LoadAsset<ComputeShader>("ColorConversion");
|
||||||
|
Melon<RenderMod>.Logger.Msg("Shader loaded successfully.");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AssetBundle FontBundle = null!;
|
||||||
|
public static AssetBundle ShaderBundle = null!;
|
||||||
|
|
||||||
|
public static TMP_FontAsset NanumSquareNeoNormal = null!;
|
||||||
|
public static TMP_FontAsset NanumSquareNeoBold = null!;
|
||||||
|
|
||||||
|
public static ComputeShader ColorConversionShader = null!;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal sealed class RendererFontProvider : IFontProvider
|
||||||
|
{
|
||||||
|
private static readonly DefaultFontProvider DefaultFontProvider = new();
|
||||||
|
private bool _disposed;
|
||||||
|
|
||||||
|
public TMP_FontAsset Regular => ModAssets.NanumSquareNeoNormal;
|
||||||
|
public TMP_FontAsset Medium => ModAssets.NanumSquareNeoBold;
|
||||||
|
public TMP_FontAsset Monospace => DefaultFontProvider.Monospace;
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (_disposed) return;
|
||||||
|
_disposed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class RendererUIManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
private static RendererUIManager? _instance;
|
||||||
|
public static RendererUIManager Instance
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_instance != null) return _instance;
|
||||||
|
|
||||||
|
var go = new GameObject("RendererUIManager");
|
||||||
|
DontDestroyOnLoad(go);
|
||||||
|
|
||||||
|
_instance = go.AddComponent<RendererUIManager>();
|
||||||
|
return _instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static O5Context Context => Instance._context;
|
||||||
|
public O5WindowManager WindowManager => _windowManager;
|
||||||
|
|
||||||
|
private O5Context _context = null!;
|
||||||
|
private O5WindowManager _windowManager = null!;
|
||||||
|
|
||||||
|
private void Awake() {
|
||||||
|
_instance = this;
|
||||||
|
|
||||||
|
_context = new O5Context(
|
||||||
|
config: new O5Config {
|
||||||
|
UIScale = 1.0f,
|
||||||
|
MiddleClickToDefault = true,
|
||||||
|
SliderSensitivity = 1.0f
|
||||||
|
},
|
||||||
|
theme: O5Theme.Dark with
|
||||||
|
{
|
||||||
|
PanelBG = new Color(0.067f, 0.067f, 0.067f, 1f),
|
||||||
|
TopBar = new Color(0f, 0f, 0f, 0.6f),
|
||||||
|
MenuBG = new Color(0f, 0f, 0f, 0.6f),
|
||||||
|
MenuHover = new Color(1.000f, 0.294f, 0.079f, .6f),
|
||||||
|
ObjectBG = new Color(0f, 0f, 0f, 1f),
|
||||||
|
ObjectButton = new Color(0f, 0f, 0f, 1f),
|
||||||
|
ObjectActive = new Color(1.000f, 0.294f, 0.079f, 1f),
|
||||||
|
ObjectActiveBright = new Color(0.812f, 0.827f, 1.000f, 1f),
|
||||||
|
ControlOutlineIdle = new Color(1f, 1f, 1f, 0.4f),
|
||||||
|
ButtonHover = new Color(0.133f, 0.133f, 0.133f, 1.0f),
|
||||||
|
ControlOutlineHover = new Color(1f, 1f, 1f, 0.4f),
|
||||||
|
CardHeader = new Color(0.157f, 0f, 0f, 1f),
|
||||||
|
CardPanel = new Color(0, 0, 0, 0f),
|
||||||
|
SoftRed = new Color(1.000f, 0.576f, 0.590f, 1f),
|
||||||
|
MathOk = new Color(0.408f, 0.827f, 0.569f, 1f),
|
||||||
|
MathWarn = new Color(0.964f, 0.647f, 0.315f, 1f),
|
||||||
|
MathErr = new Color(1.000f, 0.576f, 0.590f, 1f),
|
||||||
|
CornerRadius = 12, OutlineWidth = 2, ControlHeight = 40, FontSizeBody = 18, FontSizeH1 = 48,
|
||||||
|
Outline = new Color(1f, 1f, 1f, 0.2f),
|
||||||
|
TextDimAlpha = 1f
|
||||||
|
},
|
||||||
|
fonts: new RendererFontProvider()
|
||||||
|
);
|
||||||
|
|
||||||
|
_windowManager = O5WindowManager.Create(_context, transform, "RendererMod_Canvas");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update() {
|
||||||
|
O5Object.TickAll();
|
||||||
|
Context.Tooltip.Tick();
|
||||||
|
O5Kit.Input.O5ShortcutManager.HandleUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDestroy() {
|
||||||
|
_windowManager.Dispose();
|
||||||
|
_context.Dispose();
|
||||||
|
|
||||||
|
if (_instance == this) _instance = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,824 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using ADOFAIRenderer.API;
|
||||||
|
using ADOFAIRenderer.Core;
|
||||||
|
using ADOFAIRenderer.Data;
|
||||||
|
using ADOFAIRenderer.Localization;
|
||||||
|
using ADOFAIRenderer.Util;
|
||||||
|
using ADOFAIRenderer.Util.FFmpeg;
|
||||||
|
using HarmonyLib;
|
||||||
|
using MelonLoader;
|
||||||
|
using O5Kit.Control;
|
||||||
|
using O5Kit.Core;
|
||||||
|
using O5Kit.Factory;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace ADOFAIRenderer.UI.Window;
|
||||||
|
|
||||||
|
internal static class RenderConfigWindow
|
||||||
|
{
|
||||||
|
private static O5Window? _configWindow;
|
||||||
|
|
||||||
|
// Controls cache for validation & sync
|
||||||
|
private static O5Slider? _renderFpsSlider;
|
||||||
|
private static O5Slider? _videoFPSSlider;
|
||||||
|
private static O5Slider? _renderWidthSlider;
|
||||||
|
private static O5Slider? _renderHeightSlider;
|
||||||
|
private static O5Slider? _delayAfterEndSlider;
|
||||||
|
private static O5Toggle? _showJudgementToggle;
|
||||||
|
|
||||||
|
private static O5Dropdown<Codec>? _codecDropdown;
|
||||||
|
private static O5Dropdown<RateControlMode>? _rateControlDropdown;
|
||||||
|
private static O5InputField? _bitrateInput;
|
||||||
|
private static O5InputField? _maxBitrateInput;
|
||||||
|
private static O5InputField? _qpInput;
|
||||||
|
private static O5Slider? _keyframeIntervalSlider;
|
||||||
|
private static O5Toggle? _forceSoftwareToggle;
|
||||||
|
|
||||||
|
private static O5Toggle? _renderAudioToggle;
|
||||||
|
private static O5Dropdown<int>? _sampleRateDropdown;
|
||||||
|
private static O5Dropdown<int>? _channelsDropdown;
|
||||||
|
private static O5Slider? _audioBitrateSlider;
|
||||||
|
|
||||||
|
private static O5InputField? _outputDirInput;
|
||||||
|
|
||||||
|
private static O5Dropdown<string>? _fileExtensionDropdown;
|
||||||
|
private static O5InputField? _randomSeedInput;
|
||||||
|
private static O5Toggle? _processAudioToggle;
|
||||||
|
private static O5Toggle? _nonTileToggle;
|
||||||
|
|
||||||
|
public static void CreateWindow()
|
||||||
|
{
|
||||||
|
if (_configWindow == null)
|
||||||
|
{
|
||||||
|
_configWindow = RendererUIManager.Instance.WindowManager.Create(new O5WindowOptions
|
||||||
|
{
|
||||||
|
Id = "RendererMod_RenderConfig",
|
||||||
|
Title = LocalizationManager.Get("ui.render_config.window_title"),
|
||||||
|
Size = new Vector2(580f, 480f),
|
||||||
|
Draggable = true,
|
||||||
|
Resizable = true,
|
||||||
|
ShowCloseButton = true
|
||||||
|
});
|
||||||
|
|
||||||
|
_configWindow.CloseRequested += win =>
|
||||||
|
{
|
||||||
|
win.Rect.gameObject.SetActive(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
BuildUI(_configWindow.Content);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract
|
||||||
|
var config = RenderManager.Instance.Configuration ??= new RenderConfig();
|
||||||
|
ApplyConfigToUI(config);
|
||||||
|
|
||||||
|
SetWindowActive(true);
|
||||||
|
_configWindow.BringToFront();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void BuildUI(RectTransform content)
|
||||||
|
{
|
||||||
|
var ctx = RendererUIManager.Context;
|
||||||
|
var (viewport, scrollContent, scroller) =
|
||||||
|
O5Factory.ScrollView(ctx, content, spacing: 10f, padding: 8f);
|
||||||
|
|
||||||
|
// ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract
|
||||||
|
var config = RenderManager.Instance.Configuration ??= new RenderConfig();
|
||||||
|
EnsureDefaultConfig(config);
|
||||||
|
|
||||||
|
double[] renderFpsSnap = { 23.976, 24, 29.97, 30, 59.94, 60, 144,
|
||||||
|
120, 240, 360, 480, 600, 720, // +120
|
||||||
|
288, 576, 864, 1152, 1440, 1728, // +288
|
||||||
|
3000 // MAX
|
||||||
|
};
|
||||||
|
double[] videoFpsSnap = { 23.976, 24, 29.97, 30, 59.94, 60, 72,
|
||||||
|
120, 180, 240, 300, 360, 420, 480, 540, // +60
|
||||||
|
144, 216, 288, 432, 504, 576, // +72
|
||||||
|
600 // MAX
|
||||||
|
};
|
||||||
|
|
||||||
|
double[] audioBitrateSnap = { 64, 96, 128, 192, 256, 320, 384 };
|
||||||
|
|
||||||
|
double[] renderWidthSnap = {
|
||||||
|
256, 426, 640, 854, 960, 1280, 1366, 1600, 1920, 2048, 2560, 3200, 3840, 4096, 5120, 5760, 6016, 7680, 10240, 15360, // 16:9
|
||||||
|
230, 384, 576, 768, 1152, 1440, 1680, 2880, 3072, // 16:10
|
||||||
|
192, 320, 480, 800, 1024, 1400, 2732, 6400, 11520 // 4:3
|
||||||
|
};
|
||||||
|
|
||||||
|
double[] renderHeightSnap = {
|
||||||
|
144, 240, 360, 480, 540, 720, 768, 900, 1080, 1152, 1440, 1800, 2160, 2304, 2880, 3240, 3384, 4320, 5760, 8640, // 16:9
|
||||||
|
400, 600, 800, 1050, 1200, 1600, 1920, 2400, 3200, 4800, 9600, // 16:10
|
||||||
|
864, 960, 1536, 2048, 3072 // 4:3
|
||||||
|
};
|
||||||
|
|
||||||
|
// TODO: Presets
|
||||||
|
|
||||||
|
// 1-3. Top section: 좌/우 컨테이너 1개씩으로 3행을 쌓는다 (중앙선 1개)
|
||||||
|
var (topLeft, topRight) = CreateTwoColumnPanel(scrollContent, spacing: 8f, columnSpacing: 10f);
|
||||||
|
|
||||||
|
_renderFpsSlider = O5Factory.Slider(
|
||||||
|
ctx: ctx, parent: CreateFieldSlot(topLeft),
|
||||||
|
defaultValue: 60, min: 0.01, max: 3000, value: 60,
|
||||||
|
format: "F3", clampMode: ClampMode.All,
|
||||||
|
|
||||||
|
sliderFilter: value => renderFpsSnap.OrderBy(n => Math.Abs(n - value)).First(),
|
||||||
|
inputFilter: null, onComplete: null, onChanged: val => { config.RenderFPS = val; },
|
||||||
|
text: LocalizationManager.Get("ui.render_config.render_fps"),
|
||||||
|
id: "slider_render_fps", showFill: true
|
||||||
|
);
|
||||||
|
|
||||||
|
_videoFPSSlider = O5Factory.Slider(
|
||||||
|
ctx: ctx, parent: CreateFieldSlot(topRight),
|
||||||
|
defaultValue: 60, min: 0.01, max: 600, value: 60,
|
||||||
|
format: "F3", clampMode: ClampMode.All,
|
||||||
|
|
||||||
|
sliderFilter: value => videoFpsSnap.OrderBy(n => Math.Abs(n - value)).First(),
|
||||||
|
inputFilter: null, onComplete: null, onChanged: val => { config.VideoFPS = val; },
|
||||||
|
text: LocalizationManager.Get("ui.render_config.video_fps"),
|
||||||
|
id: "slider_video_fps", showFill: true
|
||||||
|
);
|
||||||
|
|
||||||
|
_renderWidthSlider = O5Factory.Slider(
|
||||||
|
ctx: ctx, parent: CreateFieldSlot(topLeft),
|
||||||
|
defaultValue: 2560, min: 0, max: 15360, value: 2560,
|
||||||
|
format: "F0", clampMode: ClampMode.All,
|
||||||
|
|
||||||
|
sliderFilter: value => renderWidthSnap.OrderBy(n => Math.Abs(n - value)).First(), inputFilter: value => Math.Max(value, 2),
|
||||||
|
onComplete: null, onChanged: val => { config.RenderWidth = (int)Math.Round(val); },
|
||||||
|
text: LocalizationManager.Get("ui.render_config.render_width"),
|
||||||
|
id: "slider_render_width", showFill: true
|
||||||
|
);
|
||||||
|
|
||||||
|
_renderHeightSlider = O5Factory.Slider(
|
||||||
|
ctx: ctx, parent: CreateFieldSlot(topRight),
|
||||||
|
defaultValue: 1440, min: 0, max: 8640, value: 1440,
|
||||||
|
format: "F0", clampMode: ClampMode.All,
|
||||||
|
|
||||||
|
sliderFilter: value => renderHeightSnap.OrderBy(n => Math.Abs(n - value)).First(), inputFilter: value => Math.Max(value, 2),
|
||||||
|
onComplete: null, onChanged: val => { config.RenderWidth = (int)Math.Round(val); },
|
||||||
|
text: LocalizationManager.Get("ui.render_config.render_height"),
|
||||||
|
id: "slider_render_height", showFill: true
|
||||||
|
);
|
||||||
|
|
||||||
|
_delayAfterEndSlider = O5Factory.Slider(
|
||||||
|
ctx: ctx, parent: CreateFieldSlot(topLeft),
|
||||||
|
defaultValue: 15, min: 0, max: 9999.999, value: 15,
|
||||||
|
format: "F3", clampMode: ClampMode.All,
|
||||||
|
|
||||||
|
sliderFilter: null, inputFilter: null,
|
||||||
|
onComplete: null, onChanged: val => { config.DelayAfterEnd = val; },
|
||||||
|
text: LocalizationManager.Get("ui.render_config.delay_after_end"),
|
||||||
|
id: "slider_delay_after_end", showFill: true
|
||||||
|
);
|
||||||
|
|
||||||
|
_showJudgementToggle = CreateToggleField(
|
||||||
|
ctx, CreateFieldSlot(topRight), "",
|
||||||
|
false, config.ShowJudgementText,
|
||||||
|
LocalizationManager.Get("ui.render_config.show_judgement"),
|
||||||
|
"toggle_show_judgement",
|
||||||
|
val => config.ShowJudgementText = val,
|
||||||
|
generateLabel: false
|
||||||
|
);
|
||||||
|
|
||||||
|
// 4. Video Encoding Config (Collapsible Card)
|
||||||
|
var (_, videoContent) = O5Factory.Card(
|
||||||
|
ctx, scrollContent,
|
||||||
|
LocalizationManager.Get("ui.render_config.video_encoding"),
|
||||||
|
activeValue: true,
|
||||||
|
onActiveChanged: null,
|
||||||
|
onDeleteClick: null,
|
||||||
|
showDeleteButton: false,
|
||||||
|
showActiveToggle: false
|
||||||
|
);
|
||||||
|
|
||||||
|
var (videoLeft, videoRight) = CreateTwoColumnPanel(videoContent);
|
||||||
|
var codecs = (Codec[])Enum.GetValues(typeof(Codec));
|
||||||
|
_codecDropdown = CreateDropdownField(
|
||||||
|
ctx, CreateFieldSlot(videoLeft),
|
||||||
|
LocalizationManager.Get("ui.render_config.codec"),
|
||||||
|
Codec.H264, config.VideoConfig.Codec,
|
||||||
|
codecs, c => c.ToString(),
|
||||||
|
"dd_video_codec",
|
||||||
|
c =>
|
||||||
|
{
|
||||||
|
config.VideoConfig.Codec = c;
|
||||||
|
UpdateVideoCodec(c);
|
||||||
|
});
|
||||||
|
|
||||||
|
_bitrateInput = CreateInputField(
|
||||||
|
ctx, CreateFieldSlot(videoLeft),
|
||||||
|
LocalizationManager.Get("ui.render_config.bitrate"),
|
||||||
|
"30000", config.VideoConfig.Bitrate.ToString(),
|
||||||
|
"input_bitrate",
|
||||||
|
TMPro.TMP_InputField.CharacterValidation.Integer,
|
||||||
|
val => { if (int.TryParse(val, out var b) && b > 0) config.VideoConfig.Bitrate = b; }
|
||||||
|
);
|
||||||
|
|
||||||
|
_qpInput = CreateInputField(
|
||||||
|
ctx, CreateFieldSlot(videoLeft),
|
||||||
|
LocalizationManager.Get("ui.render_config.qp"),
|
||||||
|
"18", config.VideoConfig.QP.ToString(),
|
||||||
|
"input_qp",
|
||||||
|
TMPro.TMP_InputField.CharacterValidation.Integer,
|
||||||
|
val => { if (int.TryParse(val, out var qp) && qp >= 0) config.VideoConfig.QP = qp; }
|
||||||
|
);
|
||||||
|
|
||||||
|
var rateModes = (RateControlMode[])Enum.GetValues(typeof(RateControlMode));
|
||||||
|
_rateControlDropdown = CreateDropdownField(
|
||||||
|
ctx, CreateFieldSlot(videoRight),
|
||||||
|
LocalizationManager.Get("ui.render_config.rate_control"),
|
||||||
|
RateControlMode.CBR, config.VideoConfig.RateControlMode,
|
||||||
|
rateModes, m => m.ToString(),
|
||||||
|
"dd_rate_control",
|
||||||
|
m => config.VideoConfig.RateControlMode = m
|
||||||
|
);
|
||||||
|
|
||||||
|
_maxBitrateInput = CreateInputField(
|
||||||
|
ctx, CreateFieldSlot(videoRight),
|
||||||
|
LocalizationManager.Get("ui.render_config.max_bitrate"),
|
||||||
|
"50000", config.VideoConfig.MaxBitrate.ToString(),
|
||||||
|
"input_max_bitrate",
|
||||||
|
TMPro.TMP_InputField.CharacterValidation.Integer,
|
||||||
|
val => { if (int.TryParse(val, out var mb) && mb > 0) config.VideoConfig.MaxBitrate = mb; }
|
||||||
|
);
|
||||||
|
|
||||||
|
_forceSoftwareToggle = CreateToggleField(
|
||||||
|
ctx, CreateFieldSlot(videoRight), "",
|
||||||
|
false, config.VideoConfig.ForceSoftwareEncoder,
|
||||||
|
LocalizationManager.Get("ui.render_config.force_software"),
|
||||||
|
"toggle_force_software",
|
||||||
|
val => config.AudioConfig.RenderAudio = val,
|
||||||
|
generateLabel: true
|
||||||
|
);
|
||||||
|
|
||||||
|
_keyframeIntervalSlider = O5Factory.Slider(
|
||||||
|
ctx: ctx, parent: videoContent,
|
||||||
|
defaultValue: 2, min: 0.1, max: 10, value: 2,
|
||||||
|
format: "F1", clampMode: ClampMode.All,
|
||||||
|
|
||||||
|
sliderFilter: null, inputFilter: null,
|
||||||
|
onComplete: null, onChanged: val => { config.VideoConfig.KeyframeInterval = val; },
|
||||||
|
text: LocalizationManager.Get("ui.render_config.keyframe_interval"),
|
||||||
|
id: "slider_keyframe_interval", showFill: true
|
||||||
|
);
|
||||||
|
|
||||||
|
// 5. Audio Encoding Config (Collapsible Card)
|
||||||
|
var (_, audioContent) = O5Factory.Card(
|
||||||
|
ctx, scrollContent,
|
||||||
|
LocalizationManager.Get("ui.render_config.audio_encoding"),
|
||||||
|
activeValue: true,
|
||||||
|
onActiveChanged: null,
|
||||||
|
onDeleteClick: null,
|
||||||
|
showDeleteButton: false,
|
||||||
|
showActiveToggle: false
|
||||||
|
);
|
||||||
|
|
||||||
|
var (audioLeft, audioRight) = CreateTwoColumnPanel(audioContent);
|
||||||
|
_renderAudioToggle = CreateToggleField(
|
||||||
|
ctx, CreateFieldSlot(audioLeft), "",
|
||||||
|
true, config.AudioConfig.RenderAudio,
|
||||||
|
LocalizationManager.Get("ui.render_config.render_audio"),
|
||||||
|
"toggle_render_audio",
|
||||||
|
val => config.AudioConfig.RenderAudio = val,
|
||||||
|
generateLabel: false
|
||||||
|
);
|
||||||
|
|
||||||
|
_audioBitrateSlider = O5Factory.Slider(
|
||||||
|
ctx: ctx, parent: CreateFieldSlot(audioRight),
|
||||||
|
defaultValue: 256, min: 64, max: 384, value: 256,
|
||||||
|
format: "F0", clampMode: ClampMode.All,
|
||||||
|
|
||||||
|
sliderFilter: value => audioBitrateSnap.OrderBy(n => Math.Abs(n - value)).First(),
|
||||||
|
inputFilter: null, onComplete: null, onChanged: val => { config.AudioConfig.AudioBitrate = (int)Math.Round(val) * 1000; },
|
||||||
|
text: LocalizationManager.Get("ui.render_config.audio_bitrate"),
|
||||||
|
id: "slider_audio_bitrate", showFill: true
|
||||||
|
);
|
||||||
|
|
||||||
|
var channels = new[] { 1, 2 };
|
||||||
|
_channelsDropdown = CreateDropdownField(
|
||||||
|
ctx, CreateFieldSlot(audioLeft),
|
||||||
|
LocalizationManager.Get("ui.render_config.channels"),
|
||||||
|
2, config.AudioConfig.AudioChannels,
|
||||||
|
channels, c => c == 1 ? "1 (Mono)" : "2 (Stereo)",
|
||||||
|
"dd_channels",
|
||||||
|
c => config.AudioConfig.AudioChannels = c
|
||||||
|
);
|
||||||
|
|
||||||
|
_sampleRateDropdown = CreateDropdownField(
|
||||||
|
ctx, CreateFieldSlot(audioRight),
|
||||||
|
LocalizationManager.Get("ui.render_config.sample_rate"),
|
||||||
|
48000, config.AudioConfig.AudioSampleRate,
|
||||||
|
CodecUtil.AvailableSampleRate[CodecUtil.AudioCodecMatch[config.VideoConfig.Codec]], r => $"{r/1000.0} kHz",
|
||||||
|
"dd_sample_rate",
|
||||||
|
r => config.AudioConfig.AudioSampleRate = r
|
||||||
|
);
|
||||||
|
|
||||||
|
// 6. Global Settings (Collapsible Card)
|
||||||
|
var (_, globalContent) = O5Factory.Card(
|
||||||
|
ctx, scrollContent,
|
||||||
|
LocalizationManager.Get("ui.render_config.global_settings"),
|
||||||
|
activeValue: true,
|
||||||
|
onActiveChanged: null,
|
||||||
|
onDeleteClick: null,
|
||||||
|
showDeleteButton: false,
|
||||||
|
showActiveToggle: false
|
||||||
|
);
|
||||||
|
|
||||||
|
_outputDirInput = CreateFullWidthInputField(
|
||||||
|
ctx, globalContent,
|
||||||
|
LocalizationManager.Get("ui.render_config.output_dir"),
|
||||||
|
GlobalSettings.DefaultOutputDirectory,
|
||||||
|
GlobalSettings.EffectiveOutputDirectory,
|
||||||
|
"input_output_dir",
|
||||||
|
val =>
|
||||||
|
{
|
||||||
|
var trimmed = val?.Trim() ?? string.Empty;
|
||||||
|
if (string.IsNullOrWhiteSpace(trimmed) ||
|
||||||
|
string.Equals(trimmed, GlobalSettings.DefaultOutputDirectory, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
GlobalSettings.Current.OutputDirectory = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GlobalSettings.Current.OutputDirectory = trimmed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
var (globalLeft, globalRight) = CreateTwoColumnPanel(globalContent);
|
||||||
|
O5Factory.Button(
|
||||||
|
ctx, globalLeft,
|
||||||
|
() =>
|
||||||
|
{
|
||||||
|
var initial = string.IsNullOrWhiteSpace(_outputDirInput.Value)
|
||||||
|
? GlobalSettings.DefaultOutputDirectory
|
||||||
|
: _outputDirInput.Value;
|
||||||
|
FolderDialogUtil.OpenFolderBrowser(initial, selected =>
|
||||||
|
{
|
||||||
|
Melon<RenderMod>.Logger.Msg("Output Directory Selected: " + selected);
|
||||||
|
if (!string.IsNullOrWhiteSpace(selected))
|
||||||
|
{
|
||||||
|
_outputDirInput.Set(selected);
|
||||||
|
GlobalSettings.Current.OutputDirectory = selected;
|
||||||
|
GlobalSettings.Save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
LocalizationManager.Get("ui.render_config.browse"),
|
||||||
|
"btn_browse_output"
|
||||||
|
);
|
||||||
|
|
||||||
|
O5Factory.Button(
|
||||||
|
ctx, globalRight,
|
||||||
|
() =>
|
||||||
|
{
|
||||||
|
_outputDirInput.Set(GlobalSettings.DefaultOutputDirectory);
|
||||||
|
GlobalSettings.Current.OutputDirectory = null;
|
||||||
|
GlobalSettings.Save();
|
||||||
|
},
|
||||||
|
LocalizationManager.Get("ui.render_config.reset_default"),
|
||||||
|
"btn_reset_output"
|
||||||
|
);
|
||||||
|
|
||||||
|
// 7. Advanced Settings (Collapsible Card)
|
||||||
|
var (_, advContent) = O5Factory.Card(
|
||||||
|
ctx, scrollContent,
|
||||||
|
LocalizationManager.Get("ui.render_config.advanced_settings"),
|
||||||
|
activeValue: true,
|
||||||
|
onActiveChanged: null,
|
||||||
|
onDeleteClick: null,
|
||||||
|
showDeleteButton: false,
|
||||||
|
showActiveToggle: false
|
||||||
|
);
|
||||||
|
|
||||||
|
var (advLeft, advRight) = CreateTwoColumnPanel(advContent);
|
||||||
|
var extensions = new[] { "mkv", "mp4", "mov", "webm", "avi" };
|
||||||
|
_fileExtensionDropdown = CreateDropdownField(
|
||||||
|
ctx, CreateFieldSlot(advLeft),
|
||||||
|
LocalizationManager.Get("ui.render_config.file_extension"),
|
||||||
|
"mkv", config.AdvancedConfig.FileExtension,
|
||||||
|
extensions, e => e,
|
||||||
|
"dd_adv_file_extension",
|
||||||
|
e => { if (!string.IsNullOrEmpty(e)) config.AdvancedConfig.FileExtension = e; }
|
||||||
|
);
|
||||||
|
|
||||||
|
_processAudioToggle = CreateToggleField(
|
||||||
|
ctx, CreateFieldSlot(advLeft), "",
|
||||||
|
true, config.AdvancedConfig.ProcessAudio,
|
||||||
|
LocalizationManager.Get("ui.render_config.process_audio"),
|
||||||
|
"toggle_process_audio",
|
||||||
|
val => config.AdvancedConfig.ProcessAudio = val,
|
||||||
|
generateLabel: false
|
||||||
|
);
|
||||||
|
|
||||||
|
_randomSeedInput = CreateInputField(
|
||||||
|
ctx, CreateFieldSlot(advRight),
|
||||||
|
LocalizationManager.Get("ui.render_config.random_seed"),
|
||||||
|
"", config.AdvancedConfig.RandomSeed?.ToString() ?? "",
|
||||||
|
"input_random_seed",
|
||||||
|
TMPro.TMP_InputField.CharacterValidation.Integer,
|
||||||
|
val =>
|
||||||
|
{
|
||||||
|
if (int.TryParse(val, out var s)) config.AdvancedConfig.RandomSeed = s;
|
||||||
|
else if (string.IsNullOrWhiteSpace(val)) config.AdvancedConfig.RandomSeed = null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
_nonTileToggle = CreateToggleField(
|
||||||
|
ctx, CreateFieldSlot(advRight), "",
|
||||||
|
false, config.AdvancedConfig.NonTile,
|
||||||
|
LocalizationManager.Get("ui.render_config.non_tile"),
|
||||||
|
"toggle_non_tile",
|
||||||
|
val => config.AdvancedConfig.NonTile = val,
|
||||||
|
generateLabel: false
|
||||||
|
);
|
||||||
|
|
||||||
|
// TODO: Fire Planet, Ice Planet, Wind Planet Color Settings (Each Optional)
|
||||||
|
|
||||||
|
// 8. Go Render Button
|
||||||
|
O5Factory.Button(
|
||||||
|
ctx, scrollContent,
|
||||||
|
TryGoRender,
|
||||||
|
LocalizationManager.Get("ui.render_config.go_render"),
|
||||||
|
"btn_go_render",
|
||||||
|
height: 48f
|
||||||
|
);
|
||||||
|
|
||||||
|
// 9. Version Label
|
||||||
|
var versionLabel = O5Factory.ControlText(ctx, scrollContent, 12f, noPad: true);
|
||||||
|
var versionText = $"ADOFAI Renderer v{Melon<RenderMod>.Instance.Info.Version}";
|
||||||
|
if (DateTime.UtcNow >= RenderMod.ExpirationTime) versionText += " " + LocalizationManager.Get("ui.render_config.expired");
|
||||||
|
|
||||||
|
versionLabel.text = versionText;
|
||||||
|
versionLabel.alignment = TMPro.TextAlignmentOptions.Center;
|
||||||
|
versionLabel.color = ctx.Theme.TextDim;
|
||||||
|
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
|
var versionLE = versionLabel.gameObject.AddComponent<LayoutElement>();
|
||||||
|
versionLE.preferredHeight = 18f;
|
||||||
|
versionLE.minHeight = 18f;
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
void UpdateVideoCodec(Codec codec)
|
||||||
|
{
|
||||||
|
_sampleRateDropdown?.SetValues(CodecUtil.AvailableSampleRate[CodecUtil.AudioCodecMatch[codec]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void EnsureDefaultConfig(RenderConfig config)
|
||||||
|
{
|
||||||
|
if (config.RenderWidth <= 0) config.RenderWidth = 2560;
|
||||||
|
if (config.RenderHeight <= 0) config.RenderHeight = 1440;
|
||||||
|
if (config.RenderFPS <= 0) config.RenderFPS = 60.0;
|
||||||
|
if (config.VideoFPS <= 0) config.VideoFPS = 60.0;
|
||||||
|
if (config.DelayAfterEnd < 0) config.DelayAfterEnd = 15.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ApplyConfigToUI(RenderConfig config)
|
||||||
|
{
|
||||||
|
EnsureDefaultConfig(config);
|
||||||
|
|
||||||
|
_renderFpsSlider?.Set((float) config.RenderFPS, false);
|
||||||
|
_videoFPSSlider?.Set((float) config.VideoFPS, false);
|
||||||
|
_renderWidthSlider?.Set(config.RenderWidth, false);
|
||||||
|
_renderHeightSlider?.Set(config.RenderHeight, false);
|
||||||
|
_delayAfterEndSlider?.Set((float) config.DelayAfterEnd, false);
|
||||||
|
_showJudgementToggle?.Set(config.ShowJudgementText, false);
|
||||||
|
|
||||||
|
_codecDropdown?.Set(config.VideoConfig.Codec, false);
|
||||||
|
_rateControlDropdown?.Set(config.VideoConfig.RateControlMode, false);
|
||||||
|
_bitrateInput?.Set(config.VideoConfig.Bitrate.ToString(), false);
|
||||||
|
_maxBitrateInput?.Set(config.VideoConfig.MaxBitrate.ToString(), false);
|
||||||
|
_qpInput?.Set(config.VideoConfig.QP.ToString(), false);
|
||||||
|
_keyframeIntervalSlider?.Set(config.VideoConfig.KeyframeInterval, false);
|
||||||
|
_forceSoftwareToggle?.Set(config.VideoConfig.ForceSoftwareEncoder, false);
|
||||||
|
|
||||||
|
_renderAudioToggle?.Set(config.AudioConfig.RenderAudio, false);
|
||||||
|
_sampleRateDropdown?.Set(config.AudioConfig.AudioSampleRate, false);
|
||||||
|
_channelsDropdown?.Set(config.AudioConfig.AudioChannels, false);
|
||||||
|
_audioBitrateSlider?.Set(config.AudioConfig.AudioBitrate / 1000.0, false);
|
||||||
|
|
||||||
|
_outputDirInput?.Set(GlobalSettings.EffectiveOutputDirectory, false);
|
||||||
|
|
||||||
|
_fileExtensionDropdown?.Set(config.AdvancedConfig.FileExtension, false);
|
||||||
|
_randomSeedInput?.Set(config.AdvancedConfig.RandomSeed?.ToString() ?? "", false);
|
||||||
|
_processAudioToggle?.Set(config.AdvancedConfig.ProcessAudio, false);
|
||||||
|
_nonTileToggle?.Set(config.AdvancedConfig.NonTile, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void TryGoRender()
|
||||||
|
{
|
||||||
|
var config = RenderManager.Instance.Configuration;
|
||||||
|
|
||||||
|
// Sync Video Config
|
||||||
|
if (_bitrateInput != null && int.TryParse(_bitrateInput.Value, out var bitrate) && bitrate > 0)
|
||||||
|
{
|
||||||
|
config.VideoConfig.Bitrate = bitrate;
|
||||||
|
}
|
||||||
|
if (_maxBitrateInput != null && int.TryParse(_maxBitrateInput.Value, out var maxBitrate) && maxBitrate > 0)
|
||||||
|
{
|
||||||
|
config.VideoConfig.MaxBitrate = maxBitrate;
|
||||||
|
}
|
||||||
|
if (_qpInput != null && int.TryParse(_qpInput.Value, out var qp) && qp >= 0)
|
||||||
|
{
|
||||||
|
config.VideoConfig.QP = qp;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sync Advanced Config
|
||||||
|
if (_randomSeedInput != null)
|
||||||
|
{
|
||||||
|
if (int.TryParse(_randomSeedInput.Value, out var seed))
|
||||||
|
{
|
||||||
|
config.AdvancedConfig.RandomSeed = seed;
|
||||||
|
}
|
||||||
|
else if (string.IsNullOrWhiteSpace(_randomSeedInput.Value))
|
||||||
|
{
|
||||||
|
config.AdvancedConfig.RandomSeed = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sync Output Directory
|
||||||
|
if (_outputDirInput != null)
|
||||||
|
{
|
||||||
|
var path = _outputDirInput.Value.Trim();
|
||||||
|
if (string.IsNullOrWhiteSpace(path) ||
|
||||||
|
string.Equals(path, GlobalSettings.DefaultOutputDirectory, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
GlobalSettings.Current.OutputDirectory = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var fullPath = Path.GetFullPath(path);
|
||||||
|
if (!Directory.Exists(fullPath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(fullPath);
|
||||||
|
}
|
||||||
|
GlobalSettings.Current.OutputDirectory = fullPath;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ShowValidationError($"Output directory path is invalid:\n{ex.Message}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobalSettings.Save();
|
||||||
|
SetWindowActive(false);
|
||||||
|
|
||||||
|
new RenderSession().Start(config, RenderManager.Instance.levelPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ShowValidationError(string message)
|
||||||
|
{
|
||||||
|
Melon<RenderMod>.Logger.Error(message);
|
||||||
|
CommonWarningDialogUI.ShowDialog(
|
||||||
|
LocalizationManager.Get("ui.render_config.validation_title"),
|
||||||
|
message,
|
||||||
|
new DialogButton("OK", () => { })
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 카드(또는 상단 섹션)당 하나의 좌/우 컨테이너를 만들어
|
||||||
|
// 가로 한 줄 두 필드 사이 중앙이 행마다 어긋나지 않도록 한다.
|
||||||
|
// - 패널 1개 = 중앙선 1개 (행마다 HLG를 만들던 기존 방식의 P1-P2 어긋남 방지)
|
||||||
|
// - 좌/우 컬럼은 preferredWidth=0 + flexibleWidth=1 로 항상 50:50
|
||||||
|
// - 각 필드는 Field 슬롯(label 18 + 간격 3 + 컨트롤 50)으로 높이를 고정해
|
||||||
|
// 좌/우 스택을 써도 행 단위 Y 정렬이 유지되도록 한다.
|
||||||
|
private static (RectTransform left, RectTransform right) CreateTwoColumnPanel(
|
||||||
|
Transform parent, float spacing = 8f, float columnSpacing = 8f)
|
||||||
|
{
|
||||||
|
var panelObj = new GameObject("TwoColPanel");
|
||||||
|
panelObj.transform.SetParent(parent, false);
|
||||||
|
|
||||||
|
panelObj.AddComponent<RectTransform>();
|
||||||
|
|
||||||
|
var hLayout = panelObj.AddComponent<HorizontalLayoutGroup>();
|
||||||
|
hLayout.spacing = spacing;
|
||||||
|
hLayout.padding = new RectOffset(0, 0, 0, 0);
|
||||||
|
hLayout.childAlignment = TextAnchor.UpperCenter;
|
||||||
|
hLayout.childControlWidth = true;
|
||||||
|
hLayout.childControlHeight = true;
|
||||||
|
hLayout.childForceExpandWidth = true;
|
||||||
|
hLayout.childForceExpandHeight = false;
|
||||||
|
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
|
var panelLE = panelObj.AddComponent<LayoutElement>();
|
||||||
|
panelLE.flexibleWidth = 1f;
|
||||||
|
|
||||||
|
var left = CreateColumn(panelObj.transform, "LeftCol", columnSpacing);
|
||||||
|
var right = CreateColumn(panelObj.transform, "RightCol", columnSpacing);
|
||||||
|
|
||||||
|
return (left, right);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static RectTransform CreateColumn(Transform parent, string name, float spacing)
|
||||||
|
{
|
||||||
|
var colObj = new GameObject(name);
|
||||||
|
colObj.transform.SetParent(parent, false);
|
||||||
|
var colRect = colObj.AddComponent<RectTransform>();
|
||||||
|
|
||||||
|
var colLayout = colObj.AddComponent<VerticalLayoutGroup>();
|
||||||
|
colLayout.spacing = spacing;
|
||||||
|
colLayout.padding = new RectOffset(0, 0, 0, 0);
|
||||||
|
colLayout.childControlWidth = true;
|
||||||
|
colLayout.childControlHeight = true;
|
||||||
|
colLayout.childForceExpandWidth = true;
|
||||||
|
colLayout.childForceExpandHeight = false;
|
||||||
|
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
|
// 핵심: 좌/우 선호 너비를 0으로 강제해 항상 정확히 절반씩 나누도록 한다.
|
||||||
|
// (기존 행마다 HLG 방식은 라벨/값 텍스트 길이에 따라 preferred가 달라져
|
||||||
|
// 중앙이 (W + P1 - P2) / 2 로 행마다 틀어졌음)
|
||||||
|
var colLE = colObj.AddComponent<LayoutElement>();
|
||||||
|
colLE.minWidth = 0f;
|
||||||
|
colLE.preferredWidth = 0f;
|
||||||
|
colLE.flexibleWidth = 1f;
|
||||||
|
|
||||||
|
return colRect;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static RectTransform CreateFieldSlot(Transform column)
|
||||||
|
{
|
||||||
|
var slotObj = new GameObject("Field");
|
||||||
|
slotObj.transform.SetParent(column, false);
|
||||||
|
var slotRect = slotObj.AddComponent<RectTransform>();
|
||||||
|
|
||||||
|
var slotLayout = slotObj.AddComponent<VerticalLayoutGroup>();
|
||||||
|
slotLayout.spacing = 3f;
|
||||||
|
slotLayout.padding = new RectOffset(0, 0, 0, 0);
|
||||||
|
slotLayout.childControlWidth = true;
|
||||||
|
slotLayout.childControlHeight = true;
|
||||||
|
slotLayout.childForceExpandWidth = true;
|
||||||
|
slotLayout.childForceExpandHeight = false;
|
||||||
|
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
|
var slotLE = slotObj.AddComponent<LayoutElement>();
|
||||||
|
slotLE.flexibleWidth = 1f;
|
||||||
|
|
||||||
|
return slotRect;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static O5InputField CreateInputField(
|
||||||
|
O5Context ctx,
|
||||||
|
Transform colParent,
|
||||||
|
string labelText,
|
||||||
|
string? defaultValue,
|
||||||
|
string value,
|
||||||
|
string id,
|
||||||
|
TMPro.TMP_InputField.CharacterValidation characterValidation = TMPro.TMP_InputField.CharacterValidation.None,
|
||||||
|
Action<string>? onChanged = null)
|
||||||
|
{
|
||||||
|
var label = O5Factory.ControlText(ctx, colParent, 13f, noPad: true);
|
||||||
|
label.text = labelText;
|
||||||
|
label.color = ctx.Theme.TextDim;
|
||||||
|
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
|
var labelLE = label.gameObject.AddComponent<LayoutElement>();
|
||||||
|
labelLE.preferredHeight = 18f;
|
||||||
|
labelLE.minHeight = 18f;
|
||||||
|
|
||||||
|
var inputField = O5Factory.Input(
|
||||||
|
ctx: ctx,
|
||||||
|
parent: colParent,
|
||||||
|
defaultValue: defaultValue,
|
||||||
|
value: value,
|
||||||
|
onChanged: onChanged,
|
||||||
|
placeholder: labelText,
|
||||||
|
icon: null,
|
||||||
|
id: id
|
||||||
|
);
|
||||||
|
|
||||||
|
inputField.InputField.characterValidation = characterValidation;
|
||||||
|
return inputField;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static O5InputField CreateFullWidthInputField(
|
||||||
|
O5Context ctx,
|
||||||
|
Transform parent,
|
||||||
|
string labelText,
|
||||||
|
string? defaultValue,
|
||||||
|
string value,
|
||||||
|
string id,
|
||||||
|
Action<string>? onChanged = null)
|
||||||
|
{
|
||||||
|
var container = new GameObject($"FullWidth_{id}");
|
||||||
|
container.transform.SetParent(parent, false);
|
||||||
|
|
||||||
|
var containerRect = container.AddComponent<RectTransform>();
|
||||||
|
var layout = container.AddComponent<VerticalLayoutGroup>();
|
||||||
|
layout.spacing = 3f;
|
||||||
|
layout.childControlWidth = true;
|
||||||
|
layout.childControlHeight = true;
|
||||||
|
layout.childForceExpandWidth = true;
|
||||||
|
layout.childForceExpandHeight = false;
|
||||||
|
|
||||||
|
var label = O5Factory.ControlText(ctx, containerRect, 13f, noPad: true);
|
||||||
|
label.text = labelText;
|
||||||
|
label.color = ctx.Theme.TextDim;
|
||||||
|
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
|
var labelLE = label.gameObject.AddComponent<LayoutElement>();
|
||||||
|
labelLE.preferredHeight = 18f;
|
||||||
|
labelLE.minHeight = 18f;
|
||||||
|
|
||||||
|
var input = O5Factory.Input(
|
||||||
|
ctx: ctx,
|
||||||
|
parent: containerRect,
|
||||||
|
defaultValue: defaultValue,
|
||||||
|
value: value,
|
||||||
|
onChanged: onChanged,
|
||||||
|
placeholder: labelText,
|
||||||
|
icon: null,
|
||||||
|
id: id
|
||||||
|
);
|
||||||
|
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static O5Toggle CreateToggleField(
|
||||||
|
O5Context ctx,
|
||||||
|
Transform colParent,
|
||||||
|
string labelText,
|
||||||
|
bool? defaultValue,
|
||||||
|
bool value,
|
||||||
|
string toggleText,
|
||||||
|
string id,
|
||||||
|
Action<bool>? onChanged = null,
|
||||||
|
bool generateLabel = true)
|
||||||
|
{
|
||||||
|
if (generateLabel)
|
||||||
|
{
|
||||||
|
var label = O5Factory.ControlText(ctx, colParent, 13f, noPad: true);
|
||||||
|
label.text = labelText;
|
||||||
|
label.color = ctx.Theme.TextDim;
|
||||||
|
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
|
var labelLE = label.gameObject.AddComponent<LayoutElement>();
|
||||||
|
labelLE.preferredHeight = 18f;
|
||||||
|
labelLE.minHeight = 18f;
|
||||||
|
}
|
||||||
|
|
||||||
|
return O5Factory.Toggle(
|
||||||
|
ctx: ctx,
|
||||||
|
parent: colParent,
|
||||||
|
defaultValue: defaultValue,
|
||||||
|
value: value,
|
||||||
|
onChanged: onChanged,
|
||||||
|
text: toggleText,
|
||||||
|
id: id
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static O5Dropdown<T> CreateDropdownField<T>(
|
||||||
|
O5Context ctx,
|
||||||
|
Transform colParent,
|
||||||
|
string labelText,
|
||||||
|
T defaultValue,
|
||||||
|
T value,
|
||||||
|
IReadOnlyList<T> values,
|
||||||
|
Func<T, string> display,
|
||||||
|
string id,
|
||||||
|
Action<T>? onChanged = null)
|
||||||
|
{
|
||||||
|
var label = O5Factory.ControlText(ctx, colParent, 13f, noPad: true);
|
||||||
|
label.text = labelText;
|
||||||
|
label.color = ctx.Theme.TextDim;
|
||||||
|
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
|
var labelLE = label.gameObject.AddComponent<LayoutElement>();
|
||||||
|
labelLE.preferredHeight = 18f;
|
||||||
|
labelLE.minHeight = 18f;
|
||||||
|
|
||||||
|
var ddContainer = new GameObject($"DD_{id}");
|
||||||
|
ddContainer.transform.SetParent(colParent, false);
|
||||||
|
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
|
var ddLE = ddContainer.AddComponent<LayoutElement>();
|
||||||
|
ddLE.preferredHeight = 50f;
|
||||||
|
ddLE.minHeight = 0f;
|
||||||
|
|
||||||
|
return O5Factory.DropDown(
|
||||||
|
ctx: ctx,
|
||||||
|
parent: ddContainer.transform,
|
||||||
|
defaultValue: defaultValue,
|
||||||
|
value: value,
|
||||||
|
values: values,
|
||||||
|
display: display,
|
||||||
|
onChanged: val => { if (val != null) onChanged?.Invoke(val); },
|
||||||
|
id: id
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetWindowActive(bool enabled)
|
||||||
|
{
|
||||||
|
_configWindow?.Rect.gameObject.SetActive(enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
+26
-27
@@ -4,41 +4,40 @@ using System.Resources;
|
|||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace ADOFAIRenderer.Util
|
namespace ADOFAIRenderer.Util;
|
||||||
|
|
||||||
|
internal static class BundleLoader
|
||||||
{
|
{
|
||||||
internal static class BundleLoader
|
private static readonly string BundlePlatform;
|
||||||
|
private static readonly Assembly? ExecutingAssembly;
|
||||||
|
|
||||||
|
static BundleLoader()
|
||||||
{
|
{
|
||||||
private static readonly string BundlePlatform;
|
BundlePlatform = Application.platform switch
|
||||||
private static readonly Assembly? ExecutingAssembly;
|
|
||||||
|
|
||||||
static BundleLoader()
|
|
||||||
{
|
{
|
||||||
BundlePlatform = Application.platform switch
|
RuntimePlatform.WindowsPlayer => "Win64",
|
||||||
{
|
RuntimePlatform.OSXPlayer => "OSX",
|
||||||
RuntimePlatform.WindowsPlayer => "Win64",
|
_ => "Linux"
|
||||||
RuntimePlatform.OSXPlayer => "OSX",
|
};
|
||||||
_ => "Linux"
|
ExecutingAssembly = Assembly.GetExecutingAssembly();
|
||||||
};
|
}
|
||||||
ExecutingAssembly = Assembly.GetExecutingAssembly();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AssetBundle GetBundle(string resourcePath)
|
public static AssetBundle GetBundle(string resourcePath)
|
||||||
|
{
|
||||||
|
if (ExecutingAssembly != null)
|
||||||
{
|
{
|
||||||
if (ExecutingAssembly != null)
|
var bundlePath = $"ADOFAIRenderer.Bundle.{BundlePlatform}.{resourcePath}";
|
||||||
|
using var resourceStream = ExecutingAssembly.GetManifestResourceStream(bundlePath);
|
||||||
|
if (resourceStream != null)
|
||||||
{
|
{
|
||||||
var bundlePath = $"ADOFAIRenderer.Bundle.{BundlePlatform}.{resourcePath}";
|
return AssetBundle.LoadFromStream(resourceStream);
|
||||||
using var resourceStream = ExecutingAssembly.GetManifestResourceStream(bundlePath);
|
|
||||||
if (resourceStream != null)
|
|
||||||
{
|
|
||||||
return AssetBundle.LoadFromStream(resourceStream);
|
|
||||||
}
|
|
||||||
|
|
||||||
Melon<RenderMod>.Logger.Error($"Could not find bundle resource in DLL.\n{bundlePath}");
|
|
||||||
throw new MissingManifestResourceException("Could not find bundle resource in DLL.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Melon<RenderMod>.Logger.Error("Executing assembly has not been set properly.");
|
Melon<RenderMod>.Logger.Error($"Could not find bundle resource in DLL.\n{bundlePath}");
|
||||||
throw new InvalidOperationException("ExecutingAssembly has not been set.");
|
throw new MissingManifestResourceException("Could not find bundle resource in DLL.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Melon<RenderMod>.Logger.Error("Executing assembly has not been set properly.");
|
||||||
|
throw new InvalidOperationException("ExecutingAssembly has not been set.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+21
-1
@@ -1,4 +1,6 @@
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using FFmpeg.AutoGen;
|
||||||
|
|
||||||
namespace ADOFAIRenderer.Util.FFmpeg
|
namespace ADOFAIRenderer.Util.FFmpeg
|
||||||
{
|
{
|
||||||
@@ -7,4 +9,22 @@ namespace ADOFAIRenderer.Util.FFmpeg
|
|||||||
{
|
{
|
||||||
H264, H265, VP9, AV1, VVC
|
H264, H265, VP9, AV1, VVC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static class CodecUtil
|
||||||
|
{
|
||||||
|
public static readonly Dictionary<Codec, AVCodecID> AudioCodecMatch = new()
|
||||||
|
{
|
||||||
|
[Codec.H264] = AVCodecID.AV_CODEC_ID_AAC,
|
||||||
|
[Codec.H265] = AVCodecID.AV_CODEC_ID_AAC,
|
||||||
|
[Codec.VP9] = AVCodecID.AV_CODEC_ID_OPUS,
|
||||||
|
[Codec.AV1] = AVCodecID.AV_CODEC_ID_OPUS,
|
||||||
|
[Codec.VVC] = AVCodecID.AV_CODEC_ID_OPUS
|
||||||
|
};
|
||||||
|
|
||||||
|
public static readonly Dictionary<AVCodecID, List<int>> AvailableSampleRate = new()
|
||||||
|
{
|
||||||
|
[AVCodecID.AV_CODEC_ID_AAC] = new List<int> { 44100, 48000, 96000 },
|
||||||
|
[AVCodecID.AV_CODEC_ID_OPUS] = new List<int> { 48000 }
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1536,9 +1536,9 @@ namespace ADOFAIRenderer.Util.FFmpeg
|
|||||||
if (_pAudioCodecContext == null)
|
if (_pAudioCodecContext == null)
|
||||||
throw new Exception("Failed to allocate audio codec context.");
|
throw new Exception("Failed to allocate audio codec context.");
|
||||||
|
|
||||||
var sampleRate = audioSettings.SampleRate > 0 ? audioSettings.SampleRate : 44100;
|
var sampleRate = audioSettings.SampleRate > 0 ? audioSettings.SampleRate : 48000;
|
||||||
var channels = audioSettings.Channels > 0 ? audioSettings.Channels : 2;
|
var channels = audioSettings.Channels > 0 ? audioSettings.Channels : 2;
|
||||||
var bitrate = audioSettings.Bitrate > 0 ? audioSettings.Bitrate : 128000;
|
var bitrate = audioSettings.Bitrate > 0 ? audioSettings.Bitrate : 256000;
|
||||||
|
|
||||||
// Select the first sample format supported by the encoder.
|
// Select the first sample format supported by the encoder.
|
||||||
// Most encoders prefer AV_SAMPLE_FMT_FLTP (float planar).
|
// Most encoders prefer AV_SAMPLE_FMT_FLTP (float planar).
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using ADOFAIRenderer.UI;
|
||||||
using ADOFAIRenderer.Util.FFmpeg;
|
using ADOFAIRenderer.Util.FFmpeg;
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -77,7 +78,7 @@ namespace ADOFAIRenderer.Util
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
_decoder = new FFmpegNativeDecoder(videoPath);
|
_decoder = new FFmpegNativeDecoder(videoPath);
|
||||||
_computeShader = RenderMod.ColorConversionShader;
|
_computeShader = ModAssets.ColorConversionShader;
|
||||||
|
|
||||||
var w = _decoder.Width;
|
var w = _decoder.Width;
|
||||||
var h = _decoder.Height;
|
var h = _decoder.Height;
|
||||||
|
|||||||
+520
-66
@@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
@@ -10,95 +11,505 @@ namespace ADOFAIRenderer.Util;
|
|||||||
|
|
||||||
internal static class FolderDialogUtil
|
internal static class FolderDialogUtil
|
||||||
{
|
{
|
||||||
|
private static int _isDialogOpen;
|
||||||
|
|
||||||
public static void OpenFolderBrowser(string initialDirectory, Action<string?> onSelected)
|
public static void OpenFolderBrowser(string initialDirectory, Action<string?> onSelected)
|
||||||
{
|
{
|
||||||
|
if (Interlocked.CompareExchange(ref _isDialogOpen, 1, 0) != 0)
|
||||||
|
{
|
||||||
|
MelonLogger.Msg("[FolderDialogUtil] Folder dialog is already open.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var syncContext = SynchronizationContext.Current;
|
var syncContext = SynchronizationContext.Current;
|
||||||
|
|
||||||
Task.Run(() =>
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
{
|
{
|
||||||
string? selected = null;
|
var ownerHandle = GetGameWindowHandle();
|
||||||
try
|
|
||||||
{
|
|
||||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
||||||
{
|
|
||||||
selected = OpenWindowsFolderBrowser(initialDirectory);
|
|
||||||
}
|
|
||||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
|
||||||
{
|
|
||||||
selected = OpenMacFolderBrowser(initialDirectory);
|
|
||||||
}
|
|
||||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
|
||||||
{
|
|
||||||
selected = OpenLinuxFolderBrowser(initialDirectory);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MelonLogger.Warning($"[FolderDialogUtil] Failed to open folder browser: {ex.Message}");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (syncContext != null)
|
var thread = new Thread(() =>
|
||||||
{
|
{
|
||||||
syncContext.Post(_ => onSelected(selected), null);
|
string? selected = null;
|
||||||
}
|
int oleHr = -1;
|
||||||
else
|
try
|
||||||
|
{
|
||||||
|
oleHr = OleInitialize(IntPtr.Zero);
|
||||||
|
selected = OpenWindowsFolderBrowser(initialDirectory, ownerHandle);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MelonLogger.Warning($"[FolderDialogUtil] Windows folder dialog error: {ex.Message}");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (oleHr >= 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
OleUninitialize();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// Ignore uninitialize error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Interlocked.Exchange(ref _isDialogOpen, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
DispatchResult(syncContext, onSelected, selected);
|
||||||
|
})
|
||||||
|
{
|
||||||
|
IsBackground = true,
|
||||||
|
Name = "FolderDialog-Win"
|
||||||
|
};
|
||||||
|
thread.SetApartmentState(ApartmentState.STA);
|
||||||
|
thread.Start();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
string? selected = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||||
|
{
|
||||||
|
selected = OpenMacFolderBrowser(initialDirectory);
|
||||||
|
}
|
||||||
|
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||||
|
{
|
||||||
|
selected = OpenLinuxFolderBrowser(initialDirectory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MelonLogger.Warning($"[FolderDialogUtil] Failed to open folder browser: {ex.Message}");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Interlocked.Exchange(ref _isDialogOpen, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
DispatchResult(syncContext, onSelected, selected);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void DispatchResult(SynchronizationContext? syncContext, Action<string?> onSelected, string? selected)
|
||||||
|
{
|
||||||
|
if (syncContext != null)
|
||||||
|
{
|
||||||
|
syncContext.Post(_ =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
onSelected(selected);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MelonLogger.Warning($"[FolderDialogUtil] Error in folder selected callback: {ex.Message}");
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
onSelected(selected);
|
onSelected(selected);
|
||||||
}
|
}
|
||||||
});
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MelonLogger.Warning($"[FolderDialogUtil] Error in folder selected callback: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string? OpenWindowsFolderBrowser(string initialDirectory)
|
#region Windows Implementation
|
||||||
|
|
||||||
|
private static readonly Guid CLSID_FileOpenDialog = new("DC1C5A9C-E88A-4DDE-A5A1-60F82A20AEF7");
|
||||||
|
private static readonly Guid IID_IFileOpenDialog = new("d57c7288-d4ad-4768-be02-9d969532d960");
|
||||||
|
private static readonly Guid IID_IShellItem = new("43826D1E-E718-42EE-BC55-A1E261C37BFE");
|
||||||
|
private const int ERROR_CANCELLED_HR = unchecked((int)0x800704C7);
|
||||||
|
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern IntPtr GetActiveWindow();
|
||||||
|
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern IntPtr GetForegroundWindow();
|
||||||
|
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
|
||||||
|
|
||||||
|
private static IntPtr GetGameWindowHandle()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var escapedDir = initialDirectory.Replace("'", "''");
|
var active = GetActiveWindow();
|
||||||
var script = $@"
|
if (active != IntPtr.Zero) return active;
|
||||||
[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') | Out-Null
|
|
||||||
$f = New-Object System.Windows.Forms.FolderBrowserDialog
|
|
||||||
$f.Description = 'Select Output Directory'
|
|
||||||
if ([System.IO.Directory]::Exists('{escapedDir}')) {{
|
|
||||||
$f.SelectedPath = '{escapedDir}'
|
|
||||||
}}
|
|
||||||
$f.ShowNewFolderButton = $true
|
|
||||||
if ($f.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) {{
|
|
||||||
[Console]::Write($f.SelectedPath)
|
|
||||||
}}";
|
|
||||||
|
|
||||||
var bytes = System.Text.Encoding.Unicode.GetBytes(script);
|
var currentPid = (uint)Process.GetCurrentProcess().Id;
|
||||||
var base64 = Convert.ToBase64String(bytes);
|
var fg = GetForegroundWindow();
|
||||||
|
if (fg != IntPtr.Zero)
|
||||||
var startInfo = new ProcessStartInfo
|
|
||||||
{
|
{
|
||||||
FileName = "powershell.exe",
|
GetWindowThreadProcessId(fg, out var fgPid);
|
||||||
Arguments = $"-NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand {base64}",
|
if (fgPid == currentPid)
|
||||||
CreateNoWindow = true,
|
{
|
||||||
UseShellExecute = false,
|
return fg;
|
||||||
RedirectStandardOutput = true,
|
}
|
||||||
WindowStyle = ProcessWindowStyle.Hidden
|
}
|
||||||
};
|
|
||||||
|
|
||||||
using var process = Process.Start(startInfo);
|
var mainHandle = Process.GetCurrentProcess().MainWindowHandle;
|
||||||
if (process == null) return null;
|
if (mainHandle != IntPtr.Zero)
|
||||||
|
{
|
||||||
|
return mainHandle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// Ignore failure to detect window handle
|
||||||
|
}
|
||||||
|
|
||||||
var output = process.StandardOutput.ReadToEnd().Trim();
|
return IntPtr.Zero;
|
||||||
process.WaitForExit();
|
}
|
||||||
|
|
||||||
return !string.IsNullOrEmpty(output) && Directory.Exists(output) ? output : null;
|
private static string? OpenWindowsFolderBrowser(string initialDirectory, IntPtr ownerHandle)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return OpenWindowsFolderBrowserModern(initialDirectory, ownerHandle);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
MelonLogger.Warning($"[FolderDialogUtil] Windows folder dialog error: {ex.Message}");
|
MelonLogger.Warning($"[FolderDialogUtil] Modern folder dialog failed ({ex.Message}), falling back to legacy dialog.");
|
||||||
return null;
|
return OpenWindowsFolderBrowserLegacy(initialDirectory, ownerHandle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string? OpenWindowsFolderBrowserModern(string initialDirectory, IntPtr ownerHandle)
|
||||||
|
{
|
||||||
|
IFileOpenDialog? dialog = null;
|
||||||
|
|
||||||
|
// 1. Try native CoCreateInstance first (works on Mono and .NET without class registration)
|
||||||
|
var clsid = CLSID_FileOpenDialog;
|
||||||
|
var iid = IID_IFileOpenDialog;
|
||||||
|
int createHr = CoCreateInstance(ref clsid, IntPtr.Zero, 1 /* CLSCTX_INPROC_SERVER */, ref iid, out dialog);
|
||||||
|
|
||||||
|
if (createHr != 0 || dialog == null)
|
||||||
|
{
|
||||||
|
// 2. Fallback to Activator via Type.GetTypeFromCLSID
|
||||||
|
var comType = Type.GetTypeFromCLSID(CLSID_FileOpenDialog);
|
||||||
|
if (comType != null)
|
||||||
|
{
|
||||||
|
var instance = Activator.CreateInstance(comType);
|
||||||
|
dialog = instance as IFileOpenDialog;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dialog == null)
|
||||||
|
{
|
||||||
|
throw new COMException("Failed to instantiate IFileOpenDialog via COM.", createHr);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dialog.SetOptions(FOS.FOS_PICKFOLDERS | FOS.FOS_FORCEFILESYSTEM | FOS.FOS_PATHMUSTEXIST);
|
||||||
|
dialog.SetTitle("Select Output Directory");
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(initialDirectory))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var normalized = Path.GetFullPath(initialDirectory).TrimEnd('\\', '/');
|
||||||
|
if (Directory.Exists(normalized))
|
||||||
|
{
|
||||||
|
var shellItemGuid = IID_IShellItem;
|
||||||
|
int itemHr = SHCreateItemFromParsingName(normalized, IntPtr.Zero, ref shellItemGuid, out var initialItem);
|
||||||
|
if (itemHr == 0 && initialItem != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dialog.SetFolder(initialItem);
|
||||||
|
dialog.SetDefaultFolder(initialItem);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Marshal.ReleaseComObject(initialItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// Ignore failure to set initial folder
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int hr = dialog.Show(ownerHandle);
|
||||||
|
if (hr != 0 && hr != ERROR_CANCELLED_HR && ownerHandle != IntPtr.Zero)
|
||||||
|
{
|
||||||
|
// If Show failed with ownerHandle (e.g. cross-thread or invalid handle), retry without owner
|
||||||
|
MelonLogger.Msg($"[FolderDialogUtil] dialog.Show(ownerHandle) returned 0x{hr:X8}, retrying with IntPtr.Zero.");
|
||||||
|
hr = dialog.Show(IntPtr.Zero);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hr == ERROR_CANCELLED_HR)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hr != 0)
|
||||||
|
{
|
||||||
|
throw new COMException("IFileOpenDialog.Show failed", hr);
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.GetResult(out var resultItem);
|
||||||
|
if (resultItem == null) return null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (resultItem.GetDisplayName(SIGDN.SIGDN_FILESYSPATH, out var pszPath) == 0 && pszPath != IntPtr.Zero)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var path = Marshal.PtrToStringUni(pszPath);
|
||||||
|
return !string.IsNullOrEmpty(path) && Directory.Exists(path) ? path : null;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Marshal.FreeCoTaskMem(pszPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Marshal.ReleaseComObject(resultItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Marshal.ReleaseComObject(dialog);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string? OpenWindowsFolderBrowserLegacy(string initialDirectory, IntPtr ownerHandle)
|
||||||
|
{
|
||||||
|
IntPtr pszDisplayName = Marshal.AllocHGlobal(260 * sizeof(char));
|
||||||
|
IntPtr initialDirPtr = IntPtr.Zero;
|
||||||
|
BrowseCallbackProc? callback = null;
|
||||||
|
IntPtr pidl = IntPtr.Zero;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var bi = new BROWSEINFO
|
||||||
|
{
|
||||||
|
hwndOwner = ownerHandle,
|
||||||
|
pidlRoot = IntPtr.Zero,
|
||||||
|
pszDisplayName = pszDisplayName,
|
||||||
|
lpszTitle = "Select Output Directory",
|
||||||
|
ulFlags = BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE | BIF_EDITBOX
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(initialDirectory))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var normalized = Path.GetFullPath(initialDirectory).TrimEnd('\\', '/');
|
||||||
|
if (Directory.Exists(normalized))
|
||||||
|
{
|
||||||
|
initialDirPtr = Marshal.StringToHGlobalUni(normalized);
|
||||||
|
callback = (hwnd, uMsg, lParam, lpData) =>
|
||||||
|
{
|
||||||
|
if (uMsg == BFFM_INITIALIZED && lpData != IntPtr.Zero)
|
||||||
|
{
|
||||||
|
SendMessage(hwnd, BFFM_SETSELECTIONW, (IntPtr)1, lpData);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
bi.lpfn = callback;
|
||||||
|
bi.lParam = initialDirPtr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// Ignore failure to prepare initial directory
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pidl = SHBrowseForFolderW(ref bi);
|
||||||
|
if (pidl == IntPtr.Zero && ownerHandle != IntPtr.Zero)
|
||||||
|
{
|
||||||
|
// If it returned null with ownerHandle, check if retry with IntPtr.Zero is appropriate
|
||||||
|
// But note: cancelling also returns Zero. We do not redundantly re-prompt if cancelled.
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pidl != IntPtr.Zero)
|
||||||
|
{
|
||||||
|
var sb = new StringBuilder(260);
|
||||||
|
if (SHGetPathFromIDListW(pidl, sb))
|
||||||
|
{
|
||||||
|
var path = sb.ToString();
|
||||||
|
return !string.IsNullOrEmpty(path) && Directory.Exists(path) ? path : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (pidl != IntPtr.Zero)
|
||||||
|
{
|
||||||
|
Marshal.FreeCoTaskMem(pidl);
|
||||||
|
}
|
||||||
|
if (initialDirPtr != IntPtr.Zero)
|
||||||
|
{
|
||||||
|
Marshal.FreeHGlobal(initialDirPtr);
|
||||||
|
}
|
||||||
|
if (pszDisplayName != IntPtr.Zero)
|
||||||
|
{
|
||||||
|
Marshal.FreeHGlobal(pszDisplayName);
|
||||||
|
}
|
||||||
|
GC.KeepAlive(callback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region COM & Win32 Interop Definitions
|
||||||
|
|
||||||
|
[Flags]
|
||||||
|
private enum FOS : uint
|
||||||
|
{
|
||||||
|
FOS_NOCHANGEDIR = 0x00000008,
|
||||||
|
FOS_PICKFOLDERS = 0x00000020,
|
||||||
|
FOS_FORCEFILESYSTEM = 0x00000040,
|
||||||
|
FOS_PATHMUSTEXIST = 0x00000800,
|
||||||
|
FOS_FILEMUSTEXIST = 0x00001000,
|
||||||
|
}
|
||||||
|
|
||||||
|
private enum SIGDN : uint
|
||||||
|
{
|
||||||
|
SIGDN_FILESYSPATH = 0x80058000
|
||||||
|
}
|
||||||
|
|
||||||
|
[ComImport]
|
||||||
|
[Guid("43826D1E-E718-42EE-BC55-A1E261C37BFE")]
|
||||||
|
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||||
|
private interface IShellItem
|
||||||
|
{
|
||||||
|
void BindToHandler(IntPtr pbc, [In] ref Guid bhid, [In] ref Guid riid, out IntPtr ppv);
|
||||||
|
void GetParent(out IShellItem ppsi);
|
||||||
|
[PreserveSig]
|
||||||
|
int GetDisplayName(SIGDN sigdnName, out IntPtr ppszName);
|
||||||
|
void GetAttributes(uint sfgaoMask, out uint psfgaoAttribs);
|
||||||
|
void Compare(IShellItem psi, uint hint, out int piOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
[ComImport]
|
||||||
|
[Guid("d57c7288-d4ad-4768-be02-9d969532d960")]
|
||||||
|
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||||
|
private interface IFileOpenDialog
|
||||||
|
{
|
||||||
|
[PreserveSig]
|
||||||
|
int Show(IntPtr parent);
|
||||||
|
void SetFileTypes(uint cFileTypes, IntPtr rgFilterSpec);
|
||||||
|
void SetFileTypeIndex(uint iFileType);
|
||||||
|
void GetFileTypeIndex(out uint piFileType);
|
||||||
|
void Advise(IntPtr pfde, out uint pdwCookie);
|
||||||
|
void Unadvise(uint dwCookie);
|
||||||
|
void SetOptions(FOS fos);
|
||||||
|
void GetOptions(out FOS pfos);
|
||||||
|
void SetDefaultFolder(IShellItem psi);
|
||||||
|
void SetFolder(IShellItem psi);
|
||||||
|
void GetFolder(out IShellItem ppsi);
|
||||||
|
void GetCurrentSelection(out IShellItem ppsi);
|
||||||
|
void SetFileName([MarshalAs(UnmanagedType.LPWStr)] string pszName);
|
||||||
|
void GetFileName([MarshalAs(UnmanagedType.LPWStr)] out string pszName);
|
||||||
|
void SetTitle([MarshalAs(UnmanagedType.LPWStr)] string pszTitle);
|
||||||
|
void SetOkButtonLabel([MarshalAs(UnmanagedType.LPWStr)] string pszText);
|
||||||
|
void SetFileNameLabel([MarshalAs(UnmanagedType.LPWStr)] string pszLabel);
|
||||||
|
void GetResult(out IShellItem ppsi);
|
||||||
|
void AddPlace(IShellItem psi, int fdap);
|
||||||
|
void SetDefaultExtension([MarshalAs(UnmanagedType.LPWStr)] string pszDefaultExtension);
|
||||||
|
void Close(int hr);
|
||||||
|
void SetClientGuid(ref Guid guid);
|
||||||
|
void ClearClientData();
|
||||||
|
void SetFilter(IntPtr pFilter);
|
||||||
|
void GetResults(out IntPtr ppenum);
|
||||||
|
void GetSelectedItems(out IntPtr ppsai);
|
||||||
|
}
|
||||||
|
|
||||||
|
[DllImport("ole32.dll", ExactSpelling = true)]
|
||||||
|
private static extern int OleInitialize(IntPtr pvReserved);
|
||||||
|
|
||||||
|
[DllImport("ole32.dll", ExactSpelling = true)]
|
||||||
|
private static extern void OleUninitialize();
|
||||||
|
|
||||||
|
[DllImport("ole32.dll", ExactSpelling = true)]
|
||||||
|
private static extern int CoCreateInstance(
|
||||||
|
[In] ref Guid rclsid,
|
||||||
|
IntPtr pUnkOuter,
|
||||||
|
uint dwClsContext,
|
||||||
|
[In] ref Guid riid,
|
||||||
|
[Out, MarshalAs(UnmanagedType.Interface)] out IFileOpenDialog ppv);
|
||||||
|
|
||||||
|
[DllImport("shell32.dll", CharSet = CharSet.Unicode, PreserveSig = true)]
|
||||||
|
private static extern int SHCreateItemFromParsingName(
|
||||||
|
[MarshalAs(UnmanagedType.LPWStr)] string pszPath,
|
||||||
|
IntPtr pbc,
|
||||||
|
[In] ref Guid riid,
|
||||||
|
[Out, MarshalAs(UnmanagedType.Interface)] out IShellItem ppv);
|
||||||
|
|
||||||
|
private const uint BIF_RETURNONLYFSDIRS = 0x0001;
|
||||||
|
private const uint BIF_NEWDIALOGSTYLE = 0x0040;
|
||||||
|
private const uint BIF_EDITBOX = 0x0010;
|
||||||
|
private const uint BFFM_INITIALIZED = 1;
|
||||||
|
private const uint BFFM_SETSELECTIONW = 0x0400 + 103;
|
||||||
|
|
||||||
|
private delegate int BrowseCallbackProc(IntPtr hwnd, uint uMsg, IntPtr lParam, IntPtr lpData);
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||||
|
private struct BROWSEINFO
|
||||||
|
{
|
||||||
|
public IntPtr hwndOwner;
|
||||||
|
public IntPtr pidlRoot;
|
||||||
|
public IntPtr pszDisplayName;
|
||||||
|
public string lpszTitle;
|
||||||
|
public uint ulFlags;
|
||||||
|
public BrowseCallbackProc? lpfn;
|
||||||
|
public IntPtr lParam;
|
||||||
|
public int iImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
[DllImport("shell32.dll", CharSet = CharSet.Unicode)]
|
||||||
|
private static extern IntPtr SHBrowseForFolderW(ref BROWSEINFO lpbi);
|
||||||
|
|
||||||
|
[DllImport("shell32.dll", CharSet = CharSet.Unicode)]
|
||||||
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
|
private static extern bool SHGetPathFromIDListW(IntPtr pidl, StringBuilder pszPath);
|
||||||
|
|
||||||
|
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
|
||||||
|
private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region macOS Implementation
|
||||||
|
|
||||||
private static string? OpenMacFolderBrowser(string initialDirectory)
|
private static string? OpenMacFolderBrowser(string initialDirectory)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var escaped = initialDirectory.Replace("\"", "\\\"");
|
string script;
|
||||||
var script = $"POSIX path of (choose folder with prompt \"Select Output Directory\" default location \"{escaped}\")";
|
if (!string.IsNullOrEmpty(initialDirectory) && Directory.Exists(initialDirectory))
|
||||||
|
{
|
||||||
|
var escaped = initialDirectory.Replace("\\", "\\\\").Replace("\"", "\\\"");
|
||||||
|
script = $"POSIX path of (choose folder with prompt \"Select Output Directory\" default location (POSIX file \"{escaped}\"))";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
script = "POSIX path of (choose folder with prompt \"Select Output Directory\")";
|
||||||
|
}
|
||||||
|
|
||||||
var startInfo = new ProcessStartInfo
|
var startInfo = new ProcessStartInfo
|
||||||
{
|
{
|
||||||
@@ -119,12 +530,17 @@ if ($f.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) {{
|
|||||||
|
|
||||||
return !string.IsNullOrEmpty(output) && Directory.Exists(output) ? output : null;
|
return !string.IsNullOrEmpty(output) && Directory.Exists(output) ? output : null;
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
MelonLogger.Warning($"[FolderDialogUtil] Mac folder dialog error: {ex.Message}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Linux Implementation
|
||||||
|
|
||||||
private static string? OpenLinuxFolderBrowser(string initialDirectory)
|
private static string? OpenLinuxFolderBrowser(string initialDirectory)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -145,17 +561,55 @@ if ($f.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) {{
|
|||||||
startInfo.ArgumentList.Add($"--filename={initialDirectory}");
|
startInfo.ArgumentList.Add($"--filename={initialDirectory}");
|
||||||
}
|
}
|
||||||
|
|
||||||
using var process = Process.Start(startInfo);
|
try
|
||||||
if (process == null) return null;
|
{
|
||||||
|
using var process = Process.Start(startInfo);
|
||||||
|
if (process != null)
|
||||||
|
{
|
||||||
|
var output = process.StandardOutput.ReadToEnd().Trim();
|
||||||
|
process.WaitForExit();
|
||||||
|
|
||||||
var output = process.StandardOutput.ReadToEnd().Trim();
|
if (process.ExitCode == 0 && !string.IsNullOrEmpty(output) && Directory.Exists(output))
|
||||||
process.WaitForExit();
|
{
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// Fallback to kdialog if zenity fails to start
|
||||||
|
}
|
||||||
|
|
||||||
return !string.IsNullOrEmpty(output) && Directory.Exists(output) ? output : null;
|
var kdialogInfo = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = "kdialog",
|
||||||
|
CreateNoWindow = true,
|
||||||
|
UseShellExecute = false,
|
||||||
|
RedirectStandardOutput = true,
|
||||||
|
WindowStyle = ProcessWindowStyle.Hidden
|
||||||
|
};
|
||||||
|
kdialogInfo.ArgumentList.Add("--getexistingdirectory");
|
||||||
|
if (!string.IsNullOrEmpty(initialDirectory) && Directory.Exists(initialDirectory))
|
||||||
|
{
|
||||||
|
kdialogInfo.ArgumentList.Add(initialDirectory);
|
||||||
|
}
|
||||||
|
kdialogInfo.ArgumentList.Add("--title");
|
||||||
|
kdialogInfo.ArgumentList.Add("Select Output Directory");
|
||||||
|
|
||||||
|
using var kdialogProcess = Process.Start(kdialogInfo);
|
||||||
|
if (kdialogProcess == null) return null;
|
||||||
|
|
||||||
|
var koutput = kdialogProcess.StandardOutput.ReadToEnd().Trim();
|
||||||
|
kdialogProcess.WaitForExit();
|
||||||
|
|
||||||
|
return !string.IsNullOrEmpty(koutput) && Directory.Exists(koutput) ? koutput : null;
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
MelonLogger.Warning($"[FolderDialogUtil] Linux folder dialog error: {ex.Message}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
+10
-9
@@ -3,6 +3,7 @@ using System.Buffers;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using ADOFAIRenderer.Core;
|
using ADOFAIRenderer.Core;
|
||||||
|
using ADOFAIRenderer.UI;
|
||||||
using FFmpeg.AutoGen;
|
using FFmpeg.AutoGen;
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
using Unity.Collections;
|
using Unity.Collections;
|
||||||
@@ -71,7 +72,7 @@ namespace ADOFAIRenderer.Util
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if GPU color conversion is enabled
|
// Check if GPU color conversion is enabled
|
||||||
bool useGPUConversion = RenderMod.ColorConversionShader;
|
bool useGPUConversion = ModAssets.ColorConversionShader;
|
||||||
AVPixelFormat expectedFmt = AVPixelFormat.AV_PIX_FMT_RGBA;
|
AVPixelFormat expectedFmt = AVPixelFormat.AV_PIX_FMT_RGBA;
|
||||||
|
|
||||||
if (useGPUConversion)
|
if (useGPUConversion)
|
||||||
@@ -87,31 +88,31 @@ namespace ADOFAIRenderer.Util
|
|||||||
var bufferSize = texture.width * texture.height * 4; // RGBA = 4 channel
|
var bufferSize = texture.width * texture.height * 4; // RGBA = 4 channel
|
||||||
state.Setup(currentFrame, bufferSize, useGPUConversion, expectedFmt, texture.width, texture.height);
|
state.Setup(currentFrame, bufferSize, useGPUConversion, expectedFmt, texture.width, texture.height);
|
||||||
|
|
||||||
if (useGPUConversion && state.GPUBuffer != null && RenderMod.ColorConversionShader)
|
if (useGPUConversion && state.GPUBuffer != null && ModAssets.ColorConversionShader)
|
||||||
{
|
{
|
||||||
int kernelIndex = -1;
|
int kernelIndex = -1;
|
||||||
if (expectedFmt == AVPixelFormat.AV_PIX_FMT_NV12)
|
if (expectedFmt == AVPixelFormat.AV_PIX_FMT_NV12)
|
||||||
{
|
{
|
||||||
kernelIndex = RenderMod.ColorConversionShader.FindKernel("CSMain_NV12");
|
kernelIndex = ModAssets.ColorConversionShader.FindKernel("CSMain_NV12");
|
||||||
}
|
}
|
||||||
else if (expectedFmt == AVPixelFormat.AV_PIX_FMT_YUV420P)
|
else if (expectedFmt == AVPixelFormat.AV_PIX_FMT_YUV420P)
|
||||||
{
|
{
|
||||||
kernelIndex = RenderMod.ColorConversionShader.FindKernel("CSMain_YUV420P");
|
kernelIndex = ModAssets.ColorConversionShader.FindKernel("CSMain_YUV420P");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kernelIndex >= 0)
|
if (kernelIndex >= 0)
|
||||||
{
|
{
|
||||||
RenderMod.ColorConversionShader.SetTexture(kernelIndex, SourceTexture, texture);
|
ModAssets.ColorConversionShader.SetTexture(kernelIndex, SourceTexture, texture);
|
||||||
RenderMod.ColorConversionShader.SetBuffer(kernelIndex, DestinationBuffer, state.GPUBuffer);
|
ModAssets.ColorConversionShader.SetBuffer(kernelIndex, DestinationBuffer, state.GPUBuffer);
|
||||||
RenderMod.ColorConversionShader.SetInt(Width, texture.width);
|
ModAssets.ColorConversionShader.SetInt(Width, texture.width);
|
||||||
RenderMod.ColorConversionShader.SetInt(Height, texture.height);
|
ModAssets.ColorConversionShader.SetInt(Height, texture.height);
|
||||||
|
|
||||||
var threadGroupsX = expectedFmt == AVPixelFormat.AV_PIX_FMT_NV12
|
var threadGroupsX = expectedFmt == AVPixelFormat.AV_PIX_FMT_NV12
|
||||||
? (texture.width + 31) / 32
|
? (texture.width + 31) / 32
|
||||||
: (texture.width + 63) / 64;
|
: (texture.width + 63) / 64;
|
||||||
var threadGroupsY = (texture.height + 15) / 16;
|
var threadGroupsY = (texture.height + 15) / 16;
|
||||||
|
|
||||||
RenderMod.ColorConversionShader.Dispatch(kernelIndex, threadGroupsX, threadGroupsY, 1);
|
ModAssets.ColorConversionShader.Dispatch(kernelIndex, threadGroupsX, threadGroupsY, 1);
|
||||||
|
|
||||||
AsyncGPUReadback.Request(
|
AsyncGPUReadback.Request(
|
||||||
state.GPUBuffer,
|
state.GPUBuffer,
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ namespace ADOFAIRenderer.Util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
public static string[]? GetHKLMSubKeyNames(string parentKeyPath)
|
public static string[]? GetHKLMSubKeyNames(string parentKeyPath)
|
||||||
{
|
{
|
||||||
if (RegistryKeyType == null || OpenBaseKeyMethod == null || OpenSubKeyMethod == null || GetSubKeyNamesMethod == null)
|
if (RegistryKeyType == null || OpenBaseKeyMethod == null || OpenSubKeyMethod == null || GetSubKeyNamesMethod == null)
|
||||||
@@ -94,6 +95,7 @@ namespace ADOFAIRenderer.Util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
public static string? GetHKLMValue(string keyPath, string valueName)
|
public static string? GetHKLMValue(string keyPath, string valueName)
|
||||||
{
|
{
|
||||||
if (RegistryKeyType == null || OpenBaseKeyMethod == null || OpenSubKeyMethod == null || GetValueMethod == null)
|
if (RegistryKeyType == null || OpenBaseKeyMethod == null || OpenSubKeyMethod == null || GetValueMethod == null)
|
||||||
|
|||||||
Reference in new issue
Block a user