mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
refactor: OnDraw, OnBuildUi -> Draw,
This commit is contained in:
parent
9214e17577
commit
3c65cc95ee
4 changed files with 11 additions and 11 deletions
|
|
@ -35,7 +35,7 @@ namespace Dalamud.CorePlugin
|
||||||
|
|
||||||
this.windowSystem.AddWindow(new PluginWindow(Dalamud.Instance));
|
this.windowSystem.AddWindow(new PluginWindow(Dalamud.Instance));
|
||||||
|
|
||||||
this.Interface.UiBuilder.OnBuildUi += this.OnDraw;
|
this.Interface.UiBuilder.Draw += this.OnDraw;
|
||||||
this.Interface.UiBuilder.OnOpenConfigUi += this.OnOpenConfigUi;
|
this.Interface.UiBuilder.OnOpenConfigUi += this.OnOpenConfigUi;
|
||||||
|
|
||||||
this.Interface.CommandManager.AddHandler("/di", new(this.OnCommand) { HelpMessage = $"Access the {this.Name} plugin." });
|
this.Interface.CommandManager.AddHandler("/di", new(this.OnCommand) { HelpMessage = $"Access the {this.Name} plugin." });
|
||||||
|
|
@ -51,7 +51,7 @@ namespace Dalamud.CorePlugin
|
||||||
{
|
{
|
||||||
this.Interface.CommandManager.RemoveHandler("/di");
|
this.Interface.CommandManager.RemoveHandler("/di");
|
||||||
|
|
||||||
this.Interface.UiBuilder.OnBuildUi -= this.OnDraw;
|
this.Interface.UiBuilder.Draw -= this.OnDraw;
|
||||||
|
|
||||||
this.windowSystem.RemoveAllWindows();
|
this.windowSystem.RemoveAllWindows();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ namespace Dalamud.Interface.Internal
|
||||||
this.windowSystem.AddWindow(this.settingsWindow);
|
this.windowSystem.AddWindow(this.settingsWindow);
|
||||||
this.windowSystem.AddWindow(this.selfTestWindow);
|
this.windowSystem.AddWindow(this.selfTestWindow);
|
||||||
|
|
||||||
this.dalamud.InterfaceManager.OnDraw += this.OnDraw;
|
this.dalamud.InterfaceManager.Draw += this.OnDraw;
|
||||||
|
|
||||||
Log.Information("Windows added");
|
Log.Information("Windows added");
|
||||||
}
|
}
|
||||||
|
|
@ -106,7 +106,7 @@ namespace Dalamud.Interface.Internal
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
this.dalamud.InterfaceManager.OnDraw -= this.OnDraw;
|
this.dalamud.InterfaceManager.Draw -= this.OnDraw;
|
||||||
|
|
||||||
this.windowSystem.RemoveAllWindows();
|
this.windowSystem.RemoveAllWindows();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ namespace Dalamud.Interface.Internal
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This event gets called by a plugin UiBuilder when read
|
/// This event gets called by a plugin UiBuilder when read
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event RawDX11Scene.BuildUIDelegate OnDraw;
|
public event RawDX11Scene.BuildUIDelegate Draw;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the default ImGui font.
|
/// Gets the default ImGui font.
|
||||||
|
|
@ -620,7 +620,7 @@ namespace Dalamud.Interface.Internal
|
||||||
this.LastImGuiIoPtr = ImGui.GetIO();
|
this.LastImGuiIoPtr = ImGui.GetIO();
|
||||||
this.lastWantCapture = this.LastImGuiIoPtr.WantCaptureMouse;
|
this.lastWantCapture = this.LastImGuiIoPtr.WantCaptureMouse;
|
||||||
|
|
||||||
this.OnDraw?.Invoke();
|
this.Draw?.Invoke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,14 +35,14 @@ namespace Dalamud.Interface
|
||||||
this.stopwatch = new Stopwatch();
|
this.stopwatch = new Stopwatch();
|
||||||
this.namespaceName = namespaceName;
|
this.namespaceName = namespaceName;
|
||||||
|
|
||||||
this.dalamud.InterfaceManager.OnDraw += this.OnDraw;
|
this.dalamud.InterfaceManager.Draw += this.OnDraw;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The delegate that gets called when Dalamud is ready to draw your windows or overlays.
|
/// The delegate that gets called when Dalamud is ready to draw your windows or overlays.
|
||||||
/// When it is called, you can use static ImGui calls.
|
/// When it is called, you can use static ImGui calls.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event RawDX11Scene.BuildUIDelegate OnBuildUi;
|
public event RawDX11Scene.BuildUIDelegate Draw;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event that is fired when the plugin should open its configuration interface.
|
/// Event that is fired when the plugin should open its configuration interface.
|
||||||
|
|
@ -195,7 +195,7 @@ namespace Dalamud.Interface
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
this.dalamud.InterfaceManager.OnDraw -= this.OnDraw;
|
this.dalamud.InterfaceManager.Draw -= this.OnDraw;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -237,12 +237,12 @@ namespace Dalamud.Interface
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.OnBuildUi?.Invoke();
|
this.Draw?.Invoke();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Error(ex, "[{0}] UiBuilder OnBuildUi caught exception", this.namespaceName);
|
Log.Error(ex, "[{0}] UiBuilder OnBuildUi caught exception", this.namespaceName);
|
||||||
this.OnBuildUi = null;
|
this.Draw = null;
|
||||||
this.OnOpenConfigUi = null;
|
this.OnOpenConfigUi = null;
|
||||||
|
|
||||||
this.hasErrorWindow = true;
|
this.hasErrorWindow = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue