Add error handlings for UldWidget (#2011)

* Add error handlings for UldWidget

* fixes
This commit is contained in:
srkizer 2024-08-14 00:45:00 +09:00 committed by GitHub
parent 7e0c97f59e
commit cddad72066
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 444 additions and 213 deletions

View file

@ -1,3 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using Dalamud.Game;
using Lumina;
@ -61,6 +64,16 @@ public interface IDataManager
/// <returns>The <see cref="FileResource"/> of the file.</returns>
public T? GetFile<T>(string path) where T : FileResource;
/// <summary>
/// Get a <see cref="FileResource"/> with the given path, of the given type.
/// </summary>
/// <typeparam name="T">The type of resource.</typeparam>
/// <param name="path">The path inside of the game files.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>A <see cref="Task{TResult}"/> containing the <see cref="FileResource"/> of the file on success.
/// </returns>
public Task<T> GetFileAsync<T>(string path, CancellationToken cancellationToken) where T : FileResource;
/// <summary>
/// Check if the file with the given path exists within the game's index files.
/// </summary>

View file

@ -1,4 +1,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
namespace Dalamud.Game;
@ -153,4 +155,12 @@ public interface ISigScanner
/// <param name="signature">The Signature.</param>
/// <returns>The list of real offsets of the found elements based on signature.</returns>
public nint[] ScanAllText(string signature);
/// <summary>
/// Scan for all matching byte signatures in the .text section.
/// </summary>
/// <param name="signature">The Signature.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>Enumerable yielding the real offsets of the found elements based on signature.</returns>
public IEnumerable<nint> ScanAllText(string signature, CancellationToken cancellationToken);
}