mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-16 21:07:43 +01:00
Merge branch 'master' into imgui-bindings
This commit is contained in:
commit
f63ee5cb76
27 changed files with 399 additions and 290 deletions
|
|
@ -278,7 +278,7 @@ internal sealed partial class ActiveNotification : IActiveNotification
|
|||
if (@delegate is null)
|
||||
return null;
|
||||
|
||||
foreach (var il in @delegate.GetInvocationList())
|
||||
foreach (var il in Delegate.EnumerateInvocationList(@delegate))
|
||||
{
|
||||
if (il.Target is { } target && !IsOwnedByDalamud(target.GetType()))
|
||||
@delegate = (T)Delegate.Remove(@delegate, il);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using Dalamud.Bindings.ImGui;
|
|||
using Dalamud.Configuration.Internal;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Utility;
|
||||
|
||||
namespace Dalamud.Interface.ImGuiNotification.Internal;
|
||||
|
||||
|
|
@ -68,14 +69,14 @@ internal class NotificationPositionChooser
|
|||
|
||||
if (ImGui.IsMouseClicked(ImGuiMouseButton.Right))
|
||||
{
|
||||
this.SelectionMade?.Invoke();
|
||||
this.SelectionMade.InvokeSafely();
|
||||
}
|
||||
else if (ImGui.IsMouseClicked(ImGuiMouseButton.Left))
|
||||
{
|
||||
this.configuration.NotificationAnchorPosition = this.currentAnchorPosition;
|
||||
this.configuration.QueueSave();
|
||||
|
||||
this.SelectionMade?.Invoke();
|
||||
this.SelectionMade.InvokeSafely();
|
||||
}
|
||||
|
||||
// In the middle of the screen, draw some instructions
|
||||
|
|
|
|||
|
|
@ -834,7 +834,7 @@ internal partial class InterfaceManager : IInternalDisposableService
|
|||
this.defaultFontResourceLock = fontLocked;
|
||||
|
||||
// Broadcast to auto-rebuilding instances.
|
||||
this.AfterBuildFonts?.Invoke();
|
||||
this.AfterBuildFonts.InvokeSafely();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ internal sealed class DelegateFontHandle : FontHandle
|
|||
var key = new DelegateFontHandle(this, buildStepDelegate);
|
||||
lock (this.syncRoot)
|
||||
this.handles.Add(key);
|
||||
this.RebuildRecommend?.Invoke();
|
||||
this.RebuildRecommend.InvokeSafely();
|
||||
return key;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ internal sealed partial class FontAtlasFactory
|
|||
if (this.disposed)
|
||||
return;
|
||||
|
||||
this.BeforeDispose?.InvokeSafely(this);
|
||||
this.BeforeDispose.InvokeSafely(this);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -398,25 +398,11 @@ internal sealed partial class FontAtlasFactory
|
|||
this.disposables.Dispose();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
this.AfterDispose?.Invoke(this, null);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
this.AfterDispose.InvokeSafely(this, null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.AfterDispose?.Invoke(this, e);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
this.AfterDispose.InvokeSafely(this, e);
|
||||
}
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
|
|
@ -826,7 +812,7 @@ internal sealed partial class FontAtlasFactory
|
|||
this.factory.Framework.RunOnFrameworkThread(
|
||||
() =>
|
||||
{
|
||||
this.RebuildRecommend?.InvokeSafely();
|
||||
this.RebuildRecommend.InvokeSafely();
|
||||
|
||||
switch (this.AutoRebuildMode)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -77,13 +77,16 @@ internal abstract class FontHandle : IFontHandle
|
|||
/// <param name="font">The font, locked during the call of <see cref="ImFontChanged"/>.</param>
|
||||
public void InvokeImFontChanged(ILockedImFont font)
|
||||
{
|
||||
try
|
||||
foreach (var d in Delegate.EnumerateInvocationList(this.ImFontChanged))
|
||||
{
|
||||
this.ImFontChanged?.Invoke(this, font);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(e, $"{nameof(this.InvokeImFontChanged)}: error");
|
||||
try
|
||||
{
|
||||
d(this, font);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(e, $"{nameof(this.InvokeImFontChanged)}: error calling {d.Method.Name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ internal class GamePrebakedFontHandle : FontHandle
|
|||
}
|
||||
|
||||
if (suggestRebuild)
|
||||
this.RebuildRecommend?.Invoke();
|
||||
this.RebuildRecommend.InvokeSafely();
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ namespace Dalamud.Interface.Textures.Internal;
|
|||
[ResolveVia<ITextureProvider>]
|
||||
[ResolveVia<ITextureSubstitutionProvider>]
|
||||
[ResolveVia<ITextureReadbackProvider>]
|
||||
[InherentDependency<TextureManager>]
|
||||
#pragma warning restore SA1015
|
||||
internal sealed class TextureManagerPluginScoped
|
||||
: IInternalDisposableService,
|
||||
|
|
@ -310,7 +311,7 @@ internal sealed class TextureManagerPluginScoped
|
|||
texture = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ISharedImmediateTexture GetFromGame(string path)
|
||||
{
|
||||
|
|
@ -326,7 +327,7 @@ internal sealed class TextureManagerPluginScoped
|
|||
shared.AddOwnerPlugin(this.plugin);
|
||||
return shared;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ISharedImmediateTexture GetFromFile(FileInfo file)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue