mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-01 05:13:40 +01:00
Easier SingleFontChooserDialog ctor, window pos/size/flags, and more docs (#1704)
* Make SingleFontChooserDialog ctor less confusing The current constructor expects a new fresh instance of IFontAtlas, which can be easy to miss, resulting in wasted time troubleshooting without enough clues. New constructor is added that directly takes an instance of UiBuilder, and the old constructor has been obsoleted and should be changed to private on api 10. * Add position, size, and window flags conf to SFCD * Improve documentations * Add test for PopupPosition/Size --------- Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
This commit is contained in:
parent
a26bb58fdb
commit
cf4a9e3055
6 changed files with 327 additions and 60 deletions
|
|
@ -136,13 +136,18 @@ internal abstract class FontHandle : IFontHandle
|
|||
/// An instance of <see cref="ILockedImFont"/> that <b>must</b> be disposed after use on success;
|
||||
/// <c>null</c> with <paramref name="errorMessage"/> populated on failure.
|
||||
/// </returns>
|
||||
/// <exception cref="ObjectDisposedException">Still may be thrown.</exception>
|
||||
public ILockedImFont? TryLock(out string? errorMessage)
|
||||
{
|
||||
IFontHandleSubstance? prevSubstance = default;
|
||||
while (true)
|
||||
{
|
||||
var substance = this.Manager.Substance;
|
||||
if (this.manager is not { } nonDisposedManager)
|
||||
{
|
||||
errorMessage = "The font handle has been disposed.";
|
||||
return null;
|
||||
}
|
||||
|
||||
var substance = nonDisposedManager.Substance;
|
||||
|
||||
// Does the associated IFontAtlas have a built substance?
|
||||
if (substance is null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue