mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Remove ImGui.NET entirely
This commit is contained in:
parent
95ec633cc5
commit
90e426b325
29 changed files with 32 additions and 173 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -19,6 +19,3 @@
|
||||||
[submodule "lib/Hexa.NET.ImGui"]
|
[submodule "lib/Hexa.NET.ImGui"]
|
||||||
path = lib/Hexa.NET.ImGui
|
path = lib/Hexa.NET.ImGui
|
||||||
url = https://github.com/goatcorp/Hexa.NET.ImGui.git
|
url = https://github.com/goatcorp/Hexa.NET.ImGui.git
|
||||||
[submodule "lib/ImGui.NET"]
|
|
||||||
path = lib/ImGui.NET
|
|
||||||
url = https://github.com/goatcorp/ImGui.NET.git
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Dalamud.CorePlugin
|
||||||
this.IsOpen = true;
|
this.IsOpen = true;
|
||||||
|
|
||||||
this.Size = new Vector2(810, 520);
|
this.Size = new Vector2(810, 520);
|
||||||
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
this.SizeCondition = ImGuiCond.FirstUseEver;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,6 @@
|
||||||
<ProjectReference Include="..\imgui\ImGuiScene\ImGuiScene.csproj" />
|
<ProjectReference Include="..\imgui\ImGuiScene\ImGuiScene.csproj" />
|
||||||
<ProjectReference Include="..\lib\FFXIVClientStructs\FFXIVClientStructs\FFXIVClientStructs.csproj" />
|
<ProjectReference Include="..\lib\FFXIVClientStructs\FFXIVClientStructs\FFXIVClientStructs.csproj" />
|
||||||
<ProjectReference Include="..\lib\FFXIVClientStructs\InteropGenerator.Runtime\InteropGenerator.Runtime.csproj" />
|
<ProjectReference Include="..\lib\FFXIVClientStructs\InteropGenerator.Runtime\InteropGenerator.Runtime.csproj" />
|
||||||
<ProjectReference Include="..\lib\ImGui.NET\src\ImGui.NET-472\ImGui.NET-472.csproj" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -493,7 +493,7 @@ internal partial class InterfaceManager : IInternalDisposableService
|
||||||
|
|
||||||
var value = enabled ? 1u : 0u;
|
var value = enabled ? 1u : 0u;
|
||||||
global::Windows.Win32.PInvoke.DwmSetWindowAttribute(
|
global::Windows.Win32.PInvoke.DwmSetWindowAttribute(
|
||||||
new(this.GameWindowHandle.Value),
|
new(new IntPtr(this.GameWindowHandle.Value)),
|
||||||
DWMWINDOWATTRIBUTE.DWMWA_USE_IMMERSIVE_DARK_MODE,
|
DWMWINDOWATTRIBUTE.DWMWA_USE_IMMERSIVE_DARK_MODE,
|
||||||
&value,
|
&value,
|
||||||
sizeof(uint)).ThrowOnFailure();
|
sizeof(uint)).ThrowOnFailure();
|
||||||
|
|
@ -723,7 +723,7 @@ internal partial class InterfaceManager : IInternalDisposableService
|
||||||
// NOTE (Chiv) Explicitly deactivate on dalamud boot
|
// NOTE (Chiv) Explicitly deactivate on dalamud boot
|
||||||
ImGui.GetIO().ConfigFlags &= ~ImGuiConfigFlags.NavEnableGamepad;
|
ImGui.GetIO().ConfigFlags &= ~ImGuiConfigFlags.NavEnableGamepad;
|
||||||
|
|
||||||
ImGuiHelpers.MainViewportNew = ImGui.GetMainViewport();
|
ImGuiHelpers.MainViewport = ImGui.GetMainViewport();
|
||||||
|
|
||||||
Log.Information("[IM] Scene & ImGui setup OK!");
|
Log.Information("[IM] Scene & ImGui setup OK!");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -672,6 +672,6 @@ internal unsafe class UiDebug
|
||||||
|
|
||||||
position += ImGuiHelpers.MainViewport.Pos;
|
position += ImGuiHelpers.MainViewport.Pos;
|
||||||
|
|
||||||
ImGui.GetForegroundDrawList(ImGuiHelpers.MainViewportNew).AddRect(position, position + size, nodeVisible ? 0xFF00FF00 : 0xFF0000FF);
|
ImGui.GetForegroundDrawList(ImGuiHelpers.MainViewport).AddRect(position, position + size, nodeVisible ? 0xFF00FF00 : 0xFF0000FF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,14 @@ internal class AddonPopoutWindow : Window, IDisposable
|
||||||
: base(name)
|
: base(name)
|
||||||
{
|
{
|
||||||
this.addonTree = tree;
|
this.addonTree = tree;
|
||||||
this.PositionConditionNew = ImGuiCond.Once;
|
this.PositionCondition = ImGuiCond.Once;
|
||||||
|
|
||||||
var pos = ImGui.GetMousePos() + new Vector2(50, -50);
|
var pos = ImGui.GetMousePos() + new Vector2(50, -50);
|
||||||
var workSize = ImGui.GetMainViewport().WorkSize;
|
var workSize = ImGui.GetMainViewport().WorkSize;
|
||||||
var pos2 = new Vector2(Math.Min(workSize.X - 750, pos.X), Math.Min(workSize.Y - 250, pos.Y));
|
var pos2 = new Vector2(Math.Min(workSize.X - 750, pos.X), Math.Min(workSize.Y - 250, pos.Y));
|
||||||
|
|
||||||
this.Position = pos2;
|
this.Position = pos2;
|
||||||
this.SizeConditionNew = ImGuiCond.Once;
|
this.SizeCondition = ImGuiCond.Once;
|
||||||
this.Size = new(700, 200);
|
this.Size = new(700, 200);
|
||||||
this.IsOpen = true;
|
this.IsOpen = true;
|
||||||
this.SizeConstraints = new() { MinimumSize = new(100, 100) };
|
this.SizeConstraints = new() { MinimumSize = new(100, 100) };
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,8 @@ internal unsafe class NodePopoutWindow : Window, IDisposable
|
||||||
|
|
||||||
this.Position = pos2;
|
this.Position = pos2;
|
||||||
this.IsOpen = true;
|
this.IsOpen = true;
|
||||||
this.PositionConditionNew = ImGuiCond.Once;
|
this.PositionCondition = ImGuiCond.Once;
|
||||||
this.SizeConditionNew = ImGuiCond.Once;
|
this.SizeCondition = ImGuiCond.Once;
|
||||||
this.Size = new(700, 200);
|
this.Size = new(700, 200);
|
||||||
this.SizeConstraints = new() { MinimumSize = new(100, 100) };
|
this.SizeConstraints = new() { MinimumSize = new(100, 100) };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
|
||||||
ImGui.SetNextWindowBgAlpha(Math.Clamp(this.windowFade.EasedPoint.X, 0, 0.9f));
|
ImGui.SetNextWindowBgAlpha(Math.Clamp(this.windowFade.EasedPoint.X, 0, 0.9f));
|
||||||
|
|
||||||
this.Size = new Vector2(900, 400);
|
this.Size = new Vector2(900, 400);
|
||||||
this.SizeConditionNew = ImGuiCond.Always;
|
this.SizeCondition = ImGuiCond.Always;
|
||||||
|
|
||||||
// Center the window on the main viewport
|
// Center the window on the main viewport
|
||||||
var viewportPos = ImGuiHelpers.MainViewport.Pos;
|
var viewportPos = ImGuiHelpers.MainViewport.Pos;
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ internal sealed class ColorDemoWindow : Window
|
||||||
: base("Dalamud Colors Demo")
|
: base("Dalamud Colors Demo")
|
||||||
{
|
{
|
||||||
this.Size = new Vector2(600, 500);
|
this.Size = new Vector2(600, 500);
|
||||||
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
this.SizeCondition = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.colors = new List<(string Name, Vector4 Color)>()
|
this.colors = new List<(string Name, Vector4 Color)>()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ internal sealed class ComponentDemoWindow : Window
|
||||||
: base("Dalamud Components Demo")
|
: base("Dalamud Components Demo")
|
||||||
{
|
{
|
||||||
this.Size = new Vector2(600, 500);
|
this.Size = new Vector2(600, 500);
|
||||||
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
this.SizeCondition = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ internal class ConsoleWindow : Window, IDisposable
|
||||||
cm.AddAlias("clear", "cls");
|
cm.AddAlias("clear", "cls");
|
||||||
|
|
||||||
this.Size = new Vector2(500, 400);
|
this.Size = new Vector2(500, 400);
|
||||||
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
this.SizeCondition = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ internal class DataWindow : Window, IDisposable
|
||||||
: base("Dalamud Data", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse)
|
: base("Dalamud Data", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse)
|
||||||
{
|
{
|
||||||
this.Size = new Vector2(400, 300);
|
this.Size = new Vector2(400, 300);
|
||||||
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
this.SizeCondition = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
this.orderedModules = this.modules.OrderBy(module => module.DisplayName);
|
this.orderedModules = this.modules.OrderBy(module => module.DisplayName);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ internal class GamepadModeNotifierWindow : Window
|
||||||
true)
|
true)
|
||||||
{
|
{
|
||||||
this.Size = Vector2.Zero;
|
this.Size = Vector2.Zero;
|
||||||
this.SizeConditionNew = ImGuiCond.Always;
|
this.SizeCondition = ImGuiCond.Always;
|
||||||
this.IsOpen = false;
|
this.IsOpen = false;
|
||||||
|
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
this.imageCache = imageCache;
|
this.imageCache = imageCache;
|
||||||
|
|
||||||
this.Size = new Vector2(830, 570);
|
this.Size = new Vector2(830, 570);
|
||||||
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
this.SizeCondition = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.SizeConstraints = new WindowSizeConstraints
|
this.SizeConstraints = new WindowSizeConstraints
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ internal class PluginStatWindow : Window
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
|
|
||||||
this.Size = new Vector2(810, 520);
|
this.Size = new Vector2(810, 520);
|
||||||
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
this.SizeCondition = ImGuiCond.FirstUseEver;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ internal class SelfTestWindow : Window
|
||||||
: base("Dalamud Self-Test", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse)
|
: base("Dalamud Self-Test", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse)
|
||||||
{
|
{
|
||||||
this.Size = new Vector2(800, 800);
|
this.Size = new Vector2(800, 800);
|
||||||
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
this.SizeCondition = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Game.Command;
|
using Dalamud.Game.Command;
|
||||||
using Dalamud.Game.Gui;
|
|
||||||
using Dalamud.Game.Text;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
|
||||||
|
|
||||||
using ImGuiNET;
|
|
||||||
|
|
||||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;
|
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ internal class SettingsWindow : Window
|
||||||
MaximumSize = new Vector2(1780, 940),
|
MaximumSize = new Vector2(1780, 940),
|
||||||
};
|
};
|
||||||
|
|
||||||
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
this.SizeCondition = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.tabs =
|
this.tabs =
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ public class SettingsTabDtr : SettingsTab
|
||||||
// TODO: Maybe we can also resort the rest of the bar in the future?
|
// TODO: Maybe we can also resort the rest of the bar in the future?
|
||||||
// var isRequired = search is Configuration.SearchSetting.Internal or Configuration.SearchSetting.MacroLinks;
|
// var isRequired = search is Configuration.SearchSetting.Internal or Configuration.SearchSetting.MacroLinks;
|
||||||
|
|
||||||
ImGui.PushFont(UiBuilder.IconFontNew);
|
ImGui.PushFont(UiBuilder.IconFont);
|
||||||
|
|
||||||
var arrowUpText = $"{FontAwesomeIcon.ArrowUp.ToIconString()}##{title}";
|
var arrowUpText = $"{FontAwesomeIcon.ArrowUp.ToIconString()}##{title}";
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ internal class TitleScreenMenuWindow : Window, IDisposable
|
||||||
this.ForceMainWindow = true;
|
this.ForceMainWindow = true;
|
||||||
|
|
||||||
this.Position = new Vector2(0, 200);
|
this.Position = new Vector2(0, 200);
|
||||||
this.PositionConditionNew = ImGuiCond.Always;
|
this.PositionCondition = ImGuiCond.Always;
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
|
|
||||||
this.shadeTexture = new(() => dalamudAssetManager.GetDalamudTextureWrap(DalamudAsset.TitleScreenMenuShade));
|
this.shadeTexture = new(() => dalamudAssetManager.GetDalamudTextureWrap(DalamudAsset.TitleScreenMenuShade));
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
using ImGuiNET;
|
|
||||||
|
|
||||||
using TerraFX.Interop.DirectX;
|
using TerraFX.Interop.DirectX;
|
||||||
using TerraFX.Interop.Windows;
|
using TerraFX.Interop.Windows;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -333,67 +333,19 @@ public sealed class UiBuilder : IDisposable, IUiBuilder
|
||||||
/// Gets the default Dalamud font - supporting all game languages and icons.<br />
|
/// Gets the default Dalamud font - supporting all game languages and icons.<br />
|
||||||
/// <strong>Accessing this static property outside of <see cref="Draw"/> is dangerous and not supported.</strong>
|
/// <strong>Accessing this static property outside of <see cref="Draw"/> is dangerous and not supported.</strong>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static ImFontPtr DefaultFontNew => InterfaceManager.DefaultFont;
|
public static ImFontPtr DefaultFont => InterfaceManager.DefaultFont;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the default Dalamud icon font based on FontAwesome 5 Free solid.<br />
|
/// Gets the default Dalamud icon font based on FontAwesome 5 Free solid.<br />
|
||||||
/// <strong>Accessing this static property outside of <see cref="Draw"/> is dangerous and not supported.</strong>
|
/// <strong>Accessing this static property outside of <see cref="Draw"/> is dangerous and not supported.</strong>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static ImFontPtr IconFontNew => InterfaceManager.IconFont;
|
public static ImFontPtr IconFont => InterfaceManager.IconFont;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the default Dalamud monospaced font based on Inconsolata Regular.<br />
|
/// Gets the default Dalamud monospaced font based on Inconsolata Regular.<br />
|
||||||
/// <strong>Accessing this static property outside of <see cref="Draw"/> is dangerous and not supported.</strong>
|
/// <strong>Accessing this static property outside of <see cref="Draw"/> is dangerous and not supported.</strong>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static ImFontPtr MonoFontNew => InterfaceManager.MonoFont;
|
public static ImFontPtr MonoFont => InterfaceManager.MonoFont;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the default Dalamud font - supporting all game languages and icons.<br />
|
|
||||||
/// <strong>Accessing this static property outside of <see cref="Draw"/> is dangerous and not supported.</strong>
|
|
||||||
/// </summary>
|
|
||||||
[ImGuiBindingsToDo("Remove, rename New variant.")]
|
|
||||||
public static ImGuiNET.ImFontPtr DefaultFont
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
return new ImGuiNET.ImFontPtr((nint)InterfaceManager.DefaultFont.Handle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the default Dalamud icon font based on FontAwesome 5 Free solid.<br />
|
|
||||||
/// <strong>Accessing this static property outside of <see cref="Draw"/> is dangerous and not supported.</strong>
|
|
||||||
/// </summary>
|
|
||||||
[ImGuiBindingsToDo("Remove, rename New variant.")]
|
|
||||||
public static ImGuiNET.ImFontPtr IconFont
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
return new ImGuiNET.ImFontPtr((nint)InterfaceManager.IconFont.Handle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the default Dalamud monospaced font based on Inconsolata Regular.<br />
|
|
||||||
/// <strong>Accessing this static property outside of <see cref="Draw"/> is dangerous and not supported.</strong>
|
|
||||||
/// </summary>
|
|
||||||
[ImGuiBindingsToDo("Remove, rename New variant.")]
|
|
||||||
public static ImGuiNET.ImFontPtr MonoFont
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
return new ImGuiNET.ImFontPtr((nint)InterfaceManager.MonoFont.Handle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the default font specifications.
|
/// Gets the default font specifications.
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ using System.Text.Unicode;
|
||||||
|
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Configuration.Internal;
|
using Dalamud.Configuration.Internal;
|
||||||
using Dalamud.Game.ClientState.Keys;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
||||||
using Dalamud.Interface.ImGuiBackend.InputHandler;
|
using Dalamud.Interface.ImGuiBackend.InputHandler;
|
||||||
using Dalamud.Interface.ImGuiSeStringRenderer;
|
using Dalamud.Interface.ImGuiSeStringRenderer;
|
||||||
|
|
@ -18,9 +17,7 @@ using Dalamud.Interface.ImGuiSeStringRenderer.Internal;
|
||||||
using Dalamud.Interface.ManagedFontAtlas;
|
using Dalamud.Interface.ManagedFontAtlas;
|
||||||
using Dalamud.Interface.ManagedFontAtlas.Internals;
|
using Dalamud.Interface.ManagedFontAtlas.Internals;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Utility;
|
|
||||||
|
|
||||||
using ImGuiViewport = ImGuiNET.ImGuiViewport;
|
|
||||||
using VirtualKey = Dalamud.Game.ClientState.Keys.VirtualKey;
|
using VirtualKey = Dalamud.Game.ClientState.Keys.VirtualKey;
|
||||||
|
|
||||||
namespace Dalamud.Interface.Utility;
|
namespace Dalamud.Interface.Utility;
|
||||||
|
|
@ -33,22 +30,7 @@ public static partial class ImGuiHelpers
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the main viewport.
|
/// Gets the main viewport.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static ImGuiViewportPtr MainViewportNew { get; internal set; }
|
public static ImGuiViewportPtr MainViewport { get; internal set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the main viewport.
|
|
||||||
/// </summary>
|
|
||||||
[ImGuiBindingsToDo("Remove and rename MainViewportNew to MainViewport")]
|
|
||||||
public static ImGuiNET.ImGuiViewportPtr MainViewport
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
return new ImGuiNET.ImGuiViewportPtr((nint)MainViewportNew.Handle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the global Dalamud scale.
|
/// Gets the global Dalamud scale.
|
||||||
|
|
|
||||||
|
|
@ -17,14 +17,6 @@ public static partial class ImRaii
|
||||||
public static Color PushColor(ImGuiCol idx, Vector4 color, bool condition = true)
|
public static Color PushColor(ImGuiCol idx, Vector4 color, bool condition = true)
|
||||||
=> new Color().Push(idx, color, condition);
|
=> new Color().Push(idx, color, condition);
|
||||||
|
|
||||||
[ImGuiBindingsToDo("Remove.")]
|
|
||||||
public static Color PushColor(ImGuiNET.ImGuiCol idx, uint color, bool condition = true)
|
|
||||||
=> new Color().Push(idx, color, condition);
|
|
||||||
|
|
||||||
[ImGuiBindingsToDo("Remove.")]
|
|
||||||
public static Color PushColor(ImGuiNET.ImGuiCol idx, Vector4 color, bool condition = true)
|
|
||||||
=> new Color().Push(idx, color, condition);
|
|
||||||
|
|
||||||
// Push colors that revert all current color changes made temporarily.
|
// Push colors that revert all current color changes made temporarily.
|
||||||
public static Color DefaultColors()
|
public static Color DefaultColors()
|
||||||
{
|
{
|
||||||
|
|
@ -40,7 +32,6 @@ public static partial class ImRaii
|
||||||
internal static readonly List<(ImGuiCol, uint)> Stack = new();
|
internal static readonly List<(ImGuiCol, uint)> Stack = new();
|
||||||
private int count;
|
private int count;
|
||||||
|
|
||||||
[ImGuiBindingsToDo("Remove.")]
|
|
||||||
public Color Push(ImGuiCol idx, uint color, bool condition = true)
|
public Color Push(ImGuiCol idx, uint color, bool condition = true)
|
||||||
{
|
{
|
||||||
if (condition)
|
if (condition)
|
||||||
|
|
@ -53,7 +44,6 @@ public static partial class ImRaii
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
[ImGuiBindingsToDo("Remove.")]
|
|
||||||
public Color Push(ImGuiCol idx, Vector4 color, bool condition = true)
|
public Color Push(ImGuiCol idx, Vector4 color, bool condition = true)
|
||||||
{
|
{
|
||||||
if (condition)
|
if (condition)
|
||||||
|
|
@ -66,12 +56,6 @@ public static partial class ImRaii
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Color Push(ImGuiNET.ImGuiCol idx, uint color, bool condition = true)
|
|
||||||
=> this.Push((ImGuiCol)idx, color, condition);
|
|
||||||
|
|
||||||
public Color Push(ImGuiNET.ImGuiCol idx, Vector4 color, bool condition = true)
|
|
||||||
=> this.Push((ImGuiCol)idx, color, condition);
|
|
||||||
|
|
||||||
public void Pop(int num = 1)
|
public void Pop(int num = 1)
|
||||||
{
|
{
|
||||||
num = Math.Min(num, this.count);
|
num = Math.Min(num, this.count);
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,6 @@ public static partial class ImRaii
|
||||||
public static Font PushFont(ImFontPtr font, bool condition = true)
|
public static Font PushFont(ImFontPtr font, bool condition = true)
|
||||||
=> condition ? new Font().Push(font) : new Font();
|
=> condition ? new Font().Push(font) : new Font();
|
||||||
|
|
||||||
[ImGuiBindingsToDo("Remove.")]
|
|
||||||
public static Font PushFont(ImGuiNET.ImFontPtr font, bool condition = true)
|
|
||||||
=> condition ? new Font().Push(font) : new Font();
|
|
||||||
|
|
||||||
// Push the default font if any other font is currently pushed.
|
// Push the default font if any other font is currently pushed.
|
||||||
public static Font DefaultFont()
|
public static Font DefaultFont()
|
||||||
=> new Font().Push(Font.DefaultPushed, Font.FontPushCounter > 0);
|
=> new Font().Push(Font.DefaultPushed, Font.FontPushCounter > 0);
|
||||||
|
|
@ -41,12 +37,6 @@ public static partial class ImRaii
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
[ImGuiBindingsToDo("Remove.")]
|
|
||||||
public unsafe Font Push(ImGuiNET.ImFontPtr font, bool condition = true)
|
|
||||||
{
|
|
||||||
return this.Push(new ImFontPtr((ImFont*)font.NativePtr), condition);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Pop(int num = 1)
|
public void Pop(int num = 1)
|
||||||
{
|
{
|
||||||
num = Math.Min(num, this.count);
|
num = Math.Min(num, this.count);
|
||||||
|
|
|
||||||
|
|
@ -71,22 +71,6 @@ public abstract class Window
|
||||||
this.ForceMainWindow = forceMainWindow;
|
this.ForceMainWindow = forceMainWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of the <see cref="Window"/> class.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="name">The name/ID of this window.
|
|
||||||
/// If you have multiple windows with the same name, you will need to
|
|
||||||
/// append a unique ID to it by specifying it after "###" behind the window title.
|
|
||||||
/// </param>
|
|
||||||
/// <param name="flags">The <see cref="ImGuiWindowFlags"/> of this window.</param>
|
|
||||||
/// <param name="forceMainWindow">Whether this window should be limited to the main game window.</param>
|
|
||||||
[ImGuiBindingsToDo("Remove.")]
|
|
||||||
protected Window(
|
|
||||||
string name, ImGuiNET.ImGuiWindowFlags flags = ImGuiNET.ImGuiWindowFlags.None, bool forceMainWindow = false)
|
|
||||||
: this(name, (ImGuiWindowFlags)flags, forceMainWindow)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Window"/> class.
|
/// Initializes a new instance of the <see cref="Window"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -182,17 +166,7 @@ public abstract class Window
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the condition that defines when the position of this window is set.
|
/// Gets or sets the condition that defines when the position of this window is set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ImGuiCond PositionConditionNew
|
public ImGuiCond PositionCondition { get; set; }
|
||||||
{
|
|
||||||
get => (ImGuiCond)this.PositionCondition;
|
|
||||||
set => this.PositionCondition = (ImGuiNET.ImGuiCond)value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the condition that defines when the position of this window is set.
|
|
||||||
/// </summary>
|
|
||||||
[ImGuiBindingsToDo("Remove. Rename New.")]
|
|
||||||
public ImGuiNET.ImGuiCond PositionCondition { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the size of the window. The size provided will be scaled by the global scale.
|
/// Gets or sets the size of the window. The size provided will be scaled by the global scale.
|
||||||
|
|
@ -202,17 +176,7 @@ public abstract class Window
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the condition that defines when the size of this window is set.
|
/// Gets or sets the condition that defines when the size of this window is set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ImGuiCond SizeConditionNew
|
public ImGuiCond SizeCondition { get; set; }
|
||||||
{
|
|
||||||
get => (ImGuiCond)this.SizeCondition;
|
|
||||||
set => this.SizeCondition = (ImGuiNET.ImGuiCond)value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the condition that defines when the size of this window is set.
|
|
||||||
/// </summary>
|
|
||||||
[ImGuiBindingsToDo("Remove. Rename New.")]
|
|
||||||
public ImGuiNET.ImGuiCond SizeCondition { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the size constraints of the window. The size constraints provided will be scaled by the global scale.
|
/// Gets or sets the size constraints of the window. The size constraints provided will be scaled by the global scale.
|
||||||
|
|
@ -700,12 +664,12 @@ public abstract class Window
|
||||||
if (this.ForceMainWindow)
|
if (this.ForceMainWindow)
|
||||||
pos += ImGuiHelpers.MainViewport.Pos;
|
pos += ImGuiHelpers.MainViewport.Pos;
|
||||||
|
|
||||||
ImGui.SetNextWindowPos(pos, this.PositionConditionNew);
|
ImGui.SetNextWindowPos(pos, this.PositionCondition);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.Size.HasValue)
|
if (this.Size.HasValue)
|
||||||
{
|
{
|
||||||
ImGui.SetNextWindowSize(this.Size.Value * ImGuiHelpers.GlobalScale, this.SizeConditionNew);
|
ImGui.SetNextWindowSize(this.Size.Value * ImGuiHelpers.GlobalScale, this.SizeCondition);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.Collapsed.HasValue)
|
if (this.Collapsed.HasValue)
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
|
|
||||||
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
using Dalamud.Interface.ImGuiNotification.Internal;
|
using Dalamud.Interface.ImGuiNotification.Internal;
|
||||||
using Dalamud.Interface.Internal;
|
using Dalamud.Interface.Internal;
|
||||||
using Dalamud.Plugin.Internal.Types;
|
using Dalamud.Plugin.Internal.Types;
|
||||||
|
|
||||||
using ImGuiNET;
|
|
||||||
|
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Dalamud.Plugin.Internal;
|
namespace Dalamud.Plugin.Internal;
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,11 @@ using System.Reflection;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface.Internal.Windows.Data.Widgets;
|
using Dalamud.Interface.Internal.Windows.Data.Widgets;
|
||||||
using Dalamud.Interface.Textures;
|
using Dalamud.Interface.Textures;
|
||||||
using Dalamud.Interface.Textures.TextureWraps;
|
using Dalamud.Interface.Textures.TextureWraps;
|
||||||
|
|
||||||
using ImGuiNET;
|
|
||||||
|
|
||||||
using Lumina.Data.Files;
|
using Lumina.Data.Files;
|
||||||
|
|
||||||
namespace Dalamud.Plugin.Services;
|
namespace Dalamud.Plugin.Services;
|
||||||
|
|
@ -214,7 +213,7 @@ public interface ITextureProvider
|
||||||
/// to read using <see cref="CreateFromClipboardAsync"/>.</summary>
|
/// to read using <see cref="CreateFromClipboardAsync"/>.</summary>
|
||||||
/// <returns><c>true</c> if it is the case.</returns>
|
/// <returns><c>true</c> if it is the case.</returns>
|
||||||
bool HasClipboardImage();
|
bool HasClipboardImage();
|
||||||
|
|
||||||
/// <summary>Gets a shared texture corresponding to the given game resource icon specifier.</summary>
|
/// <summary>Gets a shared texture corresponding to the given game resource icon specifier.</summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// <para>This function does not throw exceptions.</para>
|
/// <para>This function does not throw exceptions.</para>
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 98304cfd0bf86cf176732d60eb5dba6fc351f737
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue