mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Fix FontHandleWrapper and some docs
This commit is contained in:
parent
e20daed848
commit
d1291364e0
2 changed files with 15 additions and 13 deletions
|
|
@ -744,10 +744,12 @@ public sealed class UiBuilder : IDisposable
|
|||
|
||||
public event Action<IFontHandle>? ImFontChanged;
|
||||
|
||||
public Exception? LoadException =>
|
||||
this.wrapped!.LoadException ?? new ObjectDisposedException(nameof(FontHandleWrapper));
|
||||
public Exception? LoadException => this.WrappedNotDisposed.LoadException;
|
||||
|
||||
public bool Available => this.wrapped?.Available ?? false;
|
||||
public bool Available => this.WrappedNotDisposed.Available;
|
||||
|
||||
private IFontHandle WrappedNotDisposed =>
|
||||
this.wrapped ?? throw new ObjectDisposedException(nameof(FontHandleWrapper));
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
|
@ -759,19 +761,17 @@ public sealed class UiBuilder : IDisposable
|
|||
// Note: do not dispose w; we do not own it
|
||||
}
|
||||
|
||||
public IFontHandle.ImFontLocked Lock() =>
|
||||
this.wrapped?.Lock() ?? throw new ObjectDisposedException(nameof(FontHandleWrapper));
|
||||
public IFontHandle.ImFontLocked Lock() => this.WrappedNotDisposed.Lock();
|
||||
|
||||
public IDisposable Push() =>
|
||||
this.wrapped?.Push() ?? throw new ObjectDisposedException(nameof(FontHandleWrapper));
|
||||
public IDisposable Push() => this.WrappedNotDisposed.Push();
|
||||
|
||||
public void Pop() => this.wrapped?.Pop();
|
||||
public void Pop() => this.WrappedNotDisposed.Pop();
|
||||
|
||||
public Task<IFontHandle> WaitAsync() =>
|
||||
this.wrapped?.WaitAsync().ContinueWith(_ => (IFontHandle)this) ??
|
||||
throw new ObjectDisposedException(nameof(FontHandleWrapper));
|
||||
this.WrappedNotDisposed.WaitAsync().ContinueWith(_ => (IFontHandle)this);
|
||||
|
||||
public override string ToString() => $"{nameof(FontHandleWrapper)}({this.wrapped})";
|
||||
public override string ToString() =>
|
||||
$"{nameof(FontHandleWrapper)}({this.wrapped?.ToString() ?? "disposed"})";
|
||||
|
||||
private void WrappedOnImFontChanged(IFontHandle obj) => this.ImFontChanged.InvokeSafely(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Diagnostics.Contracts;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
|
@ -64,8 +65,9 @@ internal interface IDalamudAssetManager
|
|||
/// </summary>
|
||||
/// <param name="asset">The texture asset.</param>
|
||||
/// <param name="defaultWrap">The default return value, if the asset is not ready for whatever reason.</param>
|
||||
/// <returns>The texture wrap.</returns>
|
||||
/// <returns>The texture wrap. Can be <c>null</c> only if <paramref name="defaultWrap"/> is <c>null</c>.</returns>
|
||||
[Pure]
|
||||
[return: NotNullIfNotNull(nameof(defaultWrap))]
|
||||
IDalamudTextureWrap? GetDalamudTextureWrap(DalamudAsset asset, IDalamudTextureWrap? defaultWrap);
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue