SHA256
Normalize Comment Terminology
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0fc01a84de
commit
961f78a332
25 files changed
+70
-70
No files matched your search
@@ -25,9 +25,9 @@ namespace ADOFAIRenderer.UI;
|
||||
/// <c>RenderMod.OnInitializeMelon</c>).
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Threads: UI construction and all Unity object access happen on the Unity main thread. The download and extraction
|
||||
/// Threads: UI construction and all Unity object access happen on the main Unity thread. The download and extraction
|
||||
/// run on thread-pool threads (<see cref="Task.Run(Func{Task})"/>); they post UI updates to
|
||||
/// <see cref="_mainThreadQueue"/>, which <see cref="Update"/> drains on the main thread.
|
||||
/// <see cref="_mainThreadQueue"/>, which <see cref="Update"/> drains on the main Unity thread.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Flow: buttons -> (Download) progress bar + status text -> download to a temporary archive in UserLibs -> extract
|
||||
@@ -70,7 +70,7 @@ internal class FFmpegDownloadUI : MonoBehaviour
|
||||
|
||||
/// <summary>Cancellation for the running download; created per download, cancelled by Cancel, disposed in OnDestroy.</summary>
|
||||
private System.Threading.CancellationTokenSource? _cts;
|
||||
/// <summary>Actions posted from background threads, run in order on the main thread by <see cref="Update"/>.</summary>
|
||||
/// <summary>Actions posted from background threads, run in order on the main Unity thread by <see cref="Update"/>.</summary>
|
||||
private readonly System.Collections.Concurrent.ConcurrentQueue<Action> _mainThreadQueue = new();
|
||||
|
||||
/// <summary>
|
||||
@@ -376,7 +376,7 @@ internal class FFmpegDownloadUI : MonoBehaviour
|
||||
/// <summary>Runs every action posted by the background download task, in posting order.</summary>
|
||||
private void Update()
|
||||
{
|
||||
// Execute queued actions on main thread
|
||||
// Execute queued actions on main Unity thread
|
||||
while (_mainThreadQueue.TryDequeue(out var action))
|
||||
{
|
||||
action?.Invoke();
|
||||
@@ -384,7 +384,7 @@ internal class FFmpegDownloadUI : MonoBehaviour
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Posts an action to run on the main thread during the next <see cref="Update"/>. Safe to call from any thread.
|
||||
/// Posts an action to run on the main Unity thread during the next <see cref="Update"/>. Safe to call from any thread.
|
||||
/// Actions posted after the dialog is destroyed are never run.
|
||||
/// </summary>
|
||||
private void ExecuteOnMainThread(Action action)
|
||||
@@ -458,7 +458,7 @@ internal class FFmpegDownloadUI : MonoBehaviour
|
||||
// Keep the "complete" message visible for 1000 ms before closing
|
||||
await Task.Delay(1000);
|
||||
|
||||
// Destroy UI on main thread. FirstUpdateHook then sees Instance == null and checks the libraries again.
|
||||
// Destroy UI on main Unity thread. FirstUpdateHook then sees Instance == null and checks the libraries again.
|
||||
ExecuteOnMainThread(() =>
|
||||
{
|
||||
Destroy(gameObject);
|
||||
@@ -513,7 +513,7 @@ internal class FFmpegDownloadUI : MonoBehaviour
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
/// <summary>Posts a status text and color change to the main thread. Callable from any thread.</summary>
|
||||
/// <summary>Posts a status text and color change to the main Unity thread. Callable from any thread.</summary>
|
||||
private void UpdateStatus(string message, Color color)
|
||||
{
|
||||
ExecuteOnMainThread(() =>
|
||||
@@ -526,7 +526,7 @@ internal class FFmpegDownloadUI : MonoBehaviour
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Posts a progress bar update to the main thread. Callable from any thread.</summary>
|
||||
/// <summary>Posts a progress bar update to the main Unity thread. Callable from any thread.</summary>
|
||||
/// <param name="percent">Filled fraction 0..1 (not 0..100); becomes the fill's <c>anchorMax.x</c>.</param>
|
||||
/// <param name="text">Text shown on the bar.</param>
|
||||
private void UpdateProgress(float percent, string text)
|
||||
|
||||
Reference in new issue
Block a user