From 777779e393174b3111b0b9323ea2b52fb887d0e9 Mon Sep 17 00:00:00 2001 From: liam Date: Thu, 30 Jun 2022 00:08:31 -0400 Subject: [PATCH 01/22] Update ImGuiScene to 1.88 fork and fix compilation issues. --- Dalamud/Interface/GameFonts/GameFontManager.cs | 2 +- Dalamud/Interface/ImGuiFileDialog/FileDialog.UI.cs | 4 ++-- Dalamud/Interface/ImGuiHelpers.cs | 1 + Dalamud/Interface/Internal/InterfaceManager.cs | 2 +- lib/ImGuiScene | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Dalamud/Interface/GameFonts/GameFontManager.cs b/Dalamud/Interface/GameFonts/GameFontManager.cs index a9bdd73f8..ae44f4278 100644 --- a/Dalamud/Interface/GameFonts/GameFontManager.cs +++ b/Dalamud/Interface/GameFonts/GameFontManager.cs @@ -279,7 +279,7 @@ namespace Dalamud.Interface.GameFonts { var interfaceManager = Service.Get(); var ioFonts = ImGui.GetIO().Fonts; - ioFonts.GetTexDataAsRGBA32(out byte* pixels8, out var width, out var height); + ioFonts.GetTexDataAsRGBA32(0, out byte* pixels8, out var width, out var height); var pixels32 = (uint*)pixels8; var fontGamma = interfaceManager.FontGamma; diff --git a/Dalamud/Interface/ImGuiFileDialog/FileDialog.UI.cs b/Dalamud/Interface/ImGuiFileDialog/FileDialog.UI.cs index 9c54c46ef..f56963960 100644 --- a/Dalamud/Interface/ImGuiFileDialog/FileDialog.UI.cs +++ b/Dalamud/Interface/ImGuiFileDialog/FileDialog.UI.cs @@ -462,13 +462,13 @@ namespace Dalamud.Interface.ImGuiFileDialog if (this.pathInputActivated) { - if (ImGui.IsKeyReleased(ImGui.GetKeyIndex(ImGuiKey.Enter))) + if (ImGui.IsKeyReleased(ImGuiKey.Enter)) { if (Directory.Exists(this.pathInputBuffer)) this.SetPath(this.pathInputBuffer); this.pathInputActivated = false; } - if (ImGui.IsKeyReleased(ImGui.GetKeyIndex(ImGuiKey.Escape))) + if (ImGui.IsKeyReleased(ImGuiKey.Escape)) { this.pathInputActivated = false; } diff --git a/Dalamud/Interface/ImGuiHelpers.cs b/Dalamud/Interface/ImGuiHelpers.cs index c873210c1..d949a06ea 100644 --- a/Dalamud/Interface/ImGuiHelpers.cs +++ b/Dalamud/Interface/ImGuiHelpers.cs @@ -171,6 +171,7 @@ namespace Dalamud.Interface target.Value!.AddGlyph( target.Value!.ConfigData, (ushort)glyph->Codepoint, + 0, glyph->X0 * scale, ((glyph->Y0 - source.Value!.Ascent) * scale) + target.Value!.Ascent, glyph->X1 * scale, diff --git a/Dalamud/Interface/Internal/InterfaceManager.cs b/Dalamud/Interface/Internal/InterfaceManager.cs index 20bb86e3c..2869005da 100644 --- a/Dalamud/Interface/Internal/InterfaceManager.cs +++ b/Dalamud/Interface/Internal/InterfaceManager.cs @@ -884,7 +884,7 @@ namespace Dalamud.Interface.Internal if (Math.Abs(fontGamma - 1.0f) >= 0.001) { // Gamma correction (stbtt/FreeType would output in linear space whereas most real world usages will apply 1.4 or 1.8 gamma; Windows/XIV prebaked uses 1.4) - ioFonts.GetTexDataAsRGBA32(out byte* texPixels, out var texWidth, out var texHeight); + ioFonts.GetTexDataAsRGBA32(0, out byte* texPixels, out var texWidth, out var texHeight); for (int i = 3, i_ = texWidth * texHeight * 4; i < i_; i += 4) texPixels[i] = (byte)(Math.Pow(texPixels[i] / 255.0f, 1.0f / fontGamma) * 255.0f); } diff --git a/lib/ImGuiScene b/lib/ImGuiScene index 5da5fb742..d48cf7ffb 160000 --- a/lib/ImGuiScene +++ b/lib/ImGuiScene @@ -1 +1 @@ -Subproject commit 5da5fb742375aba55026f3beeef05dfe876a21bd +Subproject commit d48cf7ffbbb7c545a02e8dee7705d4f302217d81 From 40f20687be3d1384b05f73943a8cc6e78876492d Mon Sep 17 00:00:00 2001 From: liam Date: Thu, 30 Jun 2022 00:27:53 -0400 Subject: [PATCH 02/22] Update ImGuiScene --- lib/ImGuiScene | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ImGuiScene b/lib/ImGuiScene index d48cf7ffb..4a58aef66 160000 --- a/lib/ImGuiScene +++ b/lib/ImGuiScene @@ -1 +1 @@ -Subproject commit d48cf7ffbbb7c545a02e8dee7705d4f302217d81 +Subproject commit 4a58aef6683b12685ed064df286a6aa77fd04521 From 47a130b32c03b8406c1f2f3480087dc7f32f394c Mon Sep 17 00:00:00 2001 From: goaaats Date: Thu, 30 Jun 2022 12:17:57 +0200 Subject: [PATCH 03/22] build: 6.4.0.32 --- Dalamud/Dalamud.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dalamud/Dalamud.csproj b/Dalamud/Dalamud.csproj index 046edd7c3..2cb982ab9 100644 --- a/Dalamud/Dalamud.csproj +++ b/Dalamud/Dalamud.csproj @@ -8,7 +8,7 @@ - 6.4.0.31 + 6.4.0.32 XIV Launcher addon framework $(DalamudVersion) $(DalamudVersion) From 28ff6d9f00ec3de494954021325f69d8b3ebdea9 Mon Sep 17 00:00:00 2001 From: Soreepeong Date: Thu, 30 Jun 2022 23:16:17 +0900 Subject: [PATCH 04/22] wip --- Dalamud/EntryPoint.cs | 1 + .../Interface/GameFonts/GameFontManager.cs | 64 +++++++--- Dalamud/Interface/ImGuiHelpers.cs | 116 ++++++++++++++++-- .../Interface/Internal/InterfaceManager.cs | 14 +-- .../Internal/Windows/TitleScreenMenuWindow.cs | 2 - lib/ImGuiScene | 2 +- 6 files changed, 163 insertions(+), 36 deletions(-) diff --git a/Dalamud/EntryPoint.cs b/Dalamud/EntryPoint.cs index 029e8dd55..5fef315d5 100644 --- a/Dalamud/EntryPoint.cs +++ b/Dalamud/EntryPoint.cs @@ -10,6 +10,7 @@ using Dalamud.Configuration.Internal; using Dalamud.Logging.Internal; using Dalamud.Support; using Dalamud.Utility; +using ImGuiNET; using Newtonsoft.Json; using PInvoke; using Serilog; diff --git a/Dalamud/Interface/GameFonts/GameFontManager.cs b/Dalamud/Interface/GameFonts/GameFontManager.cs index ae44f4278..398785912 100644 --- a/Dalamud/Interface/GameFonts/GameFontManager.cs +++ b/Dalamud/Interface/GameFonts/GameFontManager.cs @@ -11,6 +11,7 @@ using Dalamud.Utility.Timing; using ImGuiNET; using Lumina.Data.Files; using Serilog; +using static Dalamud.Interface.ImGuiHelpers; namespace Dalamud.Interface.GameFonts { @@ -134,15 +135,18 @@ namespace Dalamud.Interface.GameFonts unsafe { var font = fontPtr.NativePtr; - for (int i = 0, i_ = font->IndexAdvanceX.Size; i < i_; ++i) - ((float*)font->IndexAdvanceX.Data)[i] /= fontScale; - font->FallbackAdvanceX /= fontScale; + for (int i = 0, i_ = font->IndexedHotData.Size; i < i_; ++i) + { + font->IndexedHotData.Ref(i).AdvanceX /= fontScale; + font->IndexedHotData.Ref(i).OccupiedWidth /= fontScale; + } + font->FontSize /= fontScale; font->Ascent /= fontScale; font->Descent /= fontScale; if (font->ConfigData != null) font->ConfigData->SizePixels /= fontScale; - var glyphs = (ImGuiHelpers.ImFontGlyphReal*)font->Glyphs.Data; + var glyphs = (ImFontGlyphReal*)font->Glyphs.Data; for (int i = 0, i_ = font->Glyphs.Size; i < i_; i++) { var glyph = &glyphs[i]; @@ -152,6 +156,11 @@ namespace Dalamud.Interface.GameFonts glyph->Y1 /= fontScale; glyph->AdvanceX /= fontScale; } + + for (int i = 0, i_ = font->KerningPairs.Size; i < i_; i++) + font->KerningPairs.Ref(i).AdvanceXAdjustment /= fontScale; + for (int i = 0, i_ = font->FrequentKerningPairs.Size; i < i_; i++) + font->FrequentKerningPairs.Ref(i) /= fontScale; } if (rebuildLookupTable) @@ -253,8 +262,11 @@ namespace Dalamud.Interface.GameFonts this.glyphRectIds.Clear(); this.fonts.Clear(); - foreach (var style in this.fontUseCounter.Keys) - this.EnsureFont(style); + lock (this.syncRoot) + { + foreach (var style in this.fontUseCounter.Keys) + this.EnsureFont(style); + } } /// @@ -279,10 +291,18 @@ namespace Dalamud.Interface.GameFonts { var interfaceManager = Service.Get(); var ioFonts = ImGui.GetIO().Fonts; - ioFonts.GetTexDataAsRGBA32(0, out byte* pixels8, out var width, out var height); - var pixels32 = (uint*)pixels8; var fontGamma = interfaceManager.FontGamma; + var pixels8s = new byte*[ioFonts.Textures.Size]; + var pixels32s = new uint*[ioFonts.Textures.Size]; + var widths = new int[ioFonts.Textures.Size]; + var heights = new int[ioFonts.Textures.Size]; + for (var i = 0; i < pixels8s.Length; i++) + { + ioFonts.GetTexDataAsRGBA32(i, out pixels8s[i], out widths[i], out heights[i]); + pixels32s[i] = (uint*)pixels8s[i]; + } + foreach (var (style, font) in this.fonts) { var fdt = this.fdts[(int)(this.isBuildingAsFallbackFontMode ? style.FamilyWithMinimumSize : style.FamilyAndSize)]; @@ -302,7 +322,10 @@ namespace Dalamud.Interface.GameFonts var glyph = font.FindGlyphNoFallback(fallbackCharCandidate); if ((IntPtr)glyph.NativePtr != IntPtr.Zero) { - font.SetFallbackChar(fallbackCharCandidate); + var ptr = font.NativePtr; + ptr->FallbackChar = fallbackCharCandidate; + ptr->FallbackGlyph = glyph.NativePtr; + ptr->FallbackHotData = (ImFontGlyphHotData*)ptr->IndexedHotData.Address(fallbackCharCandidate); break; } } @@ -323,7 +346,11 @@ namespace Dalamud.Interface.GameFonts foreach (var (c, (rectId, glyph)) in this.glyphRectIds[style]) { - var rc = ioFonts.GetCustomRectByIndex(rectId); + var rc = (ImFontAtlasCustomRectReal*)ioFonts.GetCustomRectByIndex(rectId).NativePtr; + var pixels8 = pixels8s[rc->TextureIndex]; + var pixels32 = pixels32s[rc->TextureIndex]; + var width = widths[rc->TextureIndex]; + var height = heights[rc->TextureIndex]; var sourceBuffer = this.texturePixels[glyph.TextureFileIndex]; var sourceBufferDelta = glyph.TextureChannelByteIndex; var widthAdjustment = style.CalculateBaseWidthAdjustment(fdt, glyph); @@ -334,7 +361,7 @@ namespace Dalamud.Interface.GameFonts for (var x = 0; x < glyph.BoundingWidth; x++) { var a = sourceBuffer[sourceBufferDelta + (4 * (((glyph.TextureOffsetY + y) * fdt.FontHeader.TextureWidth) + glyph.TextureOffsetX + x))]; - pixels32[((rc.Y + y) * width) + rc.X + x] = (uint)(a << 24) | 0xFFFFFFu; + pixels32[((rc->Y + y) * width) + rc->X + x] = (uint)(a << 24) | 0xFFFFFFu; } } } @@ -343,7 +370,7 @@ namespace Dalamud.Interface.GameFonts for (var y = 0; y < glyph.BoundingHeight; y++) { for (var x = 0; x < glyph.BoundingWidth + widthAdjustment; x++) - pixels32[((rc.Y + y) * width) + rc.X + x] = 0xFFFFFFu; + pixels32[((rc->Y + y) * width) + rc->X + x] = 0xFFFFFFu; } for (int xbold = 0, xbold_ = Math.Max(1, (int)Math.Ceiling(style.Weight + 1)); xbold < xbold_; xbold++) @@ -364,7 +391,7 @@ namespace Dalamud.Interface.GameFonts var a1 = sourceBuffer[sourceBufferDelta + (4 * sourcePixelIndex)]; var a2 = x == glyph.BoundingWidth - 1 ? 0 : sourceBuffer[sourceBufferDelta + (4 * (sourcePixelIndex + 1))]; var n = (a1 * xness) + (a2 * (1 - xness)); - var targetOffset = ((rc.Y + y) * width) + rc.X + x + xDeltaInt; + var targetOffset = ((rc->Y + y) * width) + rc->X + x + xDeltaInt; pixels8[(targetOffset * 4) + 3] = Math.Max(pixels8[(targetOffset * 4) + 3], (byte)(boldStrength * n)); } } @@ -374,9 +401,9 @@ namespace Dalamud.Interface.GameFonts if (Math.Abs(fontGamma - 1.4f) >= 0.001) { // Gamma correction (stbtt/FreeType would output in linear space whereas most real world usages will apply 1.4 or 1.8 gamma; Windows/XIV prebaked uses 1.4) - for (int y = rc.Y, y_ = rc.Y + rc.Height; y < y_; y++) + for (int y = rc->Y, y_ = rc->Y + rc->Height; y < y_; y++) { - for (int x = rc.X, x_ = rc.X + rc.Width; x < x_; x++) + for (int x = rc->X, x_ = rc->X + rc->Width; x < x_; x++) { var i = (((y * width) + x) * 4) + 3; pixels8[i] = (byte)(Math.Pow(pixels8[i] / 255.0f, 1.4f / fontGamma) * 255.0f); @@ -435,12 +462,15 @@ namespace Dalamud.Interface.GameFonts io.Fonts.AddCustomRectFontGlyph( font, c, - glyph.BoundingWidth + widthAdjustment + 1, - glyph.BoundingHeight + 1, + glyph.BoundingWidth + widthAdjustment, + glyph.BoundingHeight, glyph.AdvanceWidth, new Vector2(0, glyph.CurrentOffsetY)), glyph); } + + foreach (var kernPair in fdt.Distances) + font.AddKerningPair(kernPair.Left, kernPair.Right, kernPair.RightOffset); } } } diff --git a/Dalamud/Interface/ImGuiHelpers.cs b/Dalamud/Interface/ImGuiHelpers.cs index d949a06ea..324a45323 100644 --- a/Dalamud/Interface/ImGuiHelpers.cs +++ b/Dalamud/Interface/ImGuiHelpers.cs @@ -154,6 +154,7 @@ namespace Dalamud.Interface return; var scale = target.Value!.FontSize / source.Value!.FontSize; + var addedCodepoints = new HashSet(); unsafe { var glyphs = (ImFontGlyphReal*)source.Value!.Glyphs.Data; @@ -168,10 +169,11 @@ namespace Dalamud.Interface var prevGlyphPtr = (ImFontGlyphReal*)target.Value!.FindGlyphNoFallback((ushort)glyph->Codepoint).NativePtr; if ((IntPtr)prevGlyphPtr == IntPtr.Zero) { + addedCodepoints.Add(glyph->Codepoint); target.Value!.AddGlyph( target.Value!.ConfigData, (ushort)glyph->Codepoint, - 0, + glyph->TextureIndex, glyph->X0 * scale, ((glyph->Y0 - source.Value!.Ascent) * scale) + target.Value!.Ascent, glyph->X1 * scale, @@ -184,6 +186,7 @@ namespace Dalamud.Interface } else if (!missingOnly) { + addedCodepoints.Add(glyph->Codepoint); prevGlyphPtr->X0 = glyph->X0 * scale; prevGlyphPtr->Y0 = ((glyph->Y0 - source.Value!.Ascent) * scale) + target.Value!.Ascent; prevGlyphPtr->X1 = glyph->X1 * scale; @@ -195,6 +198,16 @@ namespace Dalamud.Interface prevGlyphPtr->AdvanceX = glyph->AdvanceX * scale; } } + + var kernPairs = source.Value!.KerningPairs; + for (int j = 0, k = kernPairs.Size; j < k; j++) + { + if (!addedCodepoints.Contains(kernPairs[j].Left)) + continue; + if (!addedCodepoints.Contains(kernPairs[j].Right)) + continue; + target.Value.AddKerningPair(kernPairs[j].Left, kernPairs[j].Right, kernPairs[j].AdvanceXAdjustment); + } } if (rebuildLookupTable) @@ -215,7 +228,7 @@ namespace Dalamud.Interface [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "ImGui internals")] public struct ImFontGlyphReal { - public uint ColoredVisibleCodepoint; + public uint ColoredVisibleTextureIndexCodepoint; public float AdvanceX; public float X0; public float Y0; @@ -226,23 +239,110 @@ namespace Dalamud.Interface public float U1; public float V1; + private const uint ColoredMask /*****/ = 0b_00000000_00000000_00000000_00000001u; + private const uint VisibleMask /*****/ = 0b_00000000_00000000_00000000_00000010u; + private const uint TextureMask /*****/ = 0b_00000000_00000000_00000111_11111100u; + private const uint CodepointMask /***/ = 0b_11111111_11111111_11111000_00000000u; + + private const int ColoredShift = 0; + private const int VisibleShift = 1; + private const int TextureShift = 2; + private const int CodepointShift = 11; + public bool Colored { - get => ((this.ColoredVisibleCodepoint >> 0) & 1) != 0; - set => this.ColoredVisibleCodepoint = (this.ColoredVisibleCodepoint & 0xFFFFFFFEu) | (value ? 1u : 0u); + get => (int)((this.ColoredVisibleTextureIndexCodepoint & ColoredMask) >> ColoredShift) != 0; + set => this.ColoredVisibleTextureIndexCodepoint = (this.ColoredVisibleTextureIndexCodepoint & ~ColoredMask) | (value ? 1u << ColoredShift : 0u); } public bool Visible { - get => ((this.ColoredVisibleCodepoint >> 1) & 1) != 0; - set => this.ColoredVisibleCodepoint = (this.ColoredVisibleCodepoint & 0xFFFFFFFDu) | (value ? 2u : 0u); + get => (int)((this.ColoredVisibleTextureIndexCodepoint & VisibleMask) >> VisibleShift) != 0; + set => this.ColoredVisibleTextureIndexCodepoint = (this.ColoredVisibleTextureIndexCodepoint & ~VisibleMask) | (value ? 1u << VisibleShift : 0u); + } + + public int TextureIndex + { + get => (int)(this.ColoredVisibleTextureIndexCodepoint & TextureMask) >> TextureShift; + set => this.ColoredVisibleTextureIndexCodepoint = (this.ColoredVisibleTextureIndexCodepoint & ~TextureMask) | ((uint)value << TextureShift); } public int Codepoint { - get => (int)(this.ColoredVisibleCodepoint >> 2); - set => this.ColoredVisibleCodepoint = (this.ColoredVisibleCodepoint & 3u) | ((uint)value << 2); + get => (int)(this.ColoredVisibleTextureIndexCodepoint & CodepointMask) >> CodepointShift; + set => this.ColoredVisibleTextureIndexCodepoint = (this.ColoredVisibleTextureIndexCodepoint & ~CodepointMask) | ((uint)value << CodepointShift); } } + + /// + /// ImFontGlyphHotData the correct version. + /// + [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "ImGui internals")] + public struct ImFontGlyphHotDataReal + { + public float AdvanceX; + public float OccupiedWidth; + public uint KerningPairInfo; + + private const uint UseBisectMask /***/ = 0b_00000000_00000000_00000000_00000001u; + private const uint OffsetMask /******/ = 0b_00000000_00001111_11111111_11111110u; + private const uint CountMask /*******/ = 0b_11111111_11110000_00000111_11111100u; + + private const int UseBisectShift = 0; + private const int OffsetShift = 1; + private const int CountShift = 20; + + public bool UseBisect + { + get => (int)((this.KerningPairInfo & UseBisectMask) >> UseBisectShift) != 0; + set => this.KerningPairInfo = (this.KerningPairInfo & ~UseBisectMask) | (value ? 1u << UseBisectShift : 0u); + } + + public bool Offset + { + get => (int)((this.KerningPairInfo & OffsetMask) >> OffsetShift) != 0; + set => this.KerningPairInfo = (this.KerningPairInfo & ~OffsetMask) | (value ? 1u << OffsetShift : 0u); + } + + public int Count + { + get => (int)(this.KerningPairInfo & CountMask) >> CountShift; + set => this.KerningPairInfo = (this.KerningPairInfo & ~CountMask) | ((uint)value << CountShift); + } + } + + /// + /// ImFontAtlasCustomRect the correct version. + /// + [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "ImGui internals")] + public unsafe struct ImFontAtlasCustomRectReal + { + public ushort Width; + public ushort Height; + public ushort X; + public ushort Y; + public uint TextureIndexAndGlyphID; + public float GlyphAdvanceX; + public Vector2 GlyphOffset; + public ImFont* Font; + + private const uint TextureIndexMask /***/ = 0b_00000000_00000000_00000111_11111100u; + private const uint GlyphIDMask /********/ = 0b_11111111_11111111_11111000_00000000u; + + private const int TextureIndexShift = 2; + private const int GlyphIDShift = 11; + + public int TextureIndex + { + get => (int)(this.TextureIndexAndGlyphID & TextureIndexMask) >> TextureIndexShift; + set => this.TextureIndexAndGlyphID = (this.TextureIndexAndGlyphID & ~TextureIndexMask) | ((uint)value << TextureIndexShift); + } + + public int GlyphID + { + get => (int)(this.TextureIndexAndGlyphID & GlyphIDMask) >> GlyphIDShift; + set => this.TextureIndexAndGlyphID = (this.TextureIndexAndGlyphID & ~GlyphIDMask) | ((uint)value << GlyphIDShift); + } + }; } } diff --git a/Dalamud/Interface/Internal/InterfaceManager.cs b/Dalamud/Interface/Internal/InterfaceManager.cs index 2869005da..924584b70 100644 --- a/Dalamud/Interface/Internal/InterfaceManager.cs +++ b/Dalamud/Interface/Internal/InterfaceManager.cs @@ -848,6 +848,12 @@ namespace Dalamud.Interface.Internal } } + for (int i = 0, i_ = ioFonts.ConfigData.Size; i < i_; i++) + { + var config = ioFonts.ConfigData[i]; + config.RasterizerGamma = config.RasterizerGamma * fontGamma; + } + Log.Verbose("[FONT] ImGui.IO.Build will be called."); ioFonts.Build(); gameFontManager.AfterIoFontsBuild(); @@ -881,14 +887,6 @@ namespace Dalamud.Interface.Internal if (!disableBigFonts) this.IsFallbackFontMode = false; - if (Math.Abs(fontGamma - 1.0f) >= 0.001) - { - // Gamma correction (stbtt/FreeType would output in linear space whereas most real world usages will apply 1.4 or 1.8 gamma; Windows/XIV prebaked uses 1.4) - ioFonts.GetTexDataAsRGBA32(0, out byte* texPixels, out var texWidth, out var texHeight); - for (int i = 3, i_ = texWidth * texHeight * 4; i < i_; i += 4) - texPixels[i] = (byte)(Math.Pow(texPixels[i] / 255.0f, 1.0f / fontGamma) * 255.0f); - } - gameFontManager.AfterBuildFonts(); foreach (var (font, mod) in this.loadedFontInfo) diff --git a/Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs b/Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs index 628f52f2f..78581e624 100644 --- a/Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs +++ b/Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs @@ -142,7 +142,6 @@ namespace Dalamud.Interface.Internal.Windows } if (!ImGui.IsWindowHovered(ImGuiHoveredFlags.RootAndChildWindows | - ImGuiHoveredFlags.AllowWhenOverlapped | ImGuiHoveredFlags.AllowWhenBlockedByActiveItem)) { this.state = State.FadeOut; @@ -188,7 +187,6 @@ namespace Dalamud.Interface.Internal.Windows ImGui.PopStyleVar(); var isHover = ImGui.IsWindowHovered(ImGuiHoveredFlags.RootAndChildWindows | - ImGuiHoveredFlags.AllowWhenOverlapped | ImGuiHoveredFlags.AllowWhenBlockedByActiveItem); if (!isHover && this.fadeOutEasing!.IsDone) diff --git a/lib/ImGuiScene b/lib/ImGuiScene index 4a58aef66..cd6300cd7 160000 --- a/lib/ImGuiScene +++ b/lib/ImGuiScene @@ -1 +1 @@ -Subproject commit 4a58aef6683b12685ed064df286a6aa77fd04521 +Subproject commit cd6300cd7944b24643ed7381fbe5ae15efc10448 From b6747827f4706f69eaebdd1084597af0ff2491cc Mon Sep 17 00:00:00 2001 From: Soreepeong Date: Fri, 1 Jul 2022 01:07:07 +0900 Subject: [PATCH 05/22] fix --- Dalamud/Interface/ImGuiHelpers.cs | 1 + lib/ImGuiScene | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dalamud/Interface/ImGuiHelpers.cs b/Dalamud/Interface/ImGuiHelpers.cs index 324a45323..3e39e9429 100644 --- a/Dalamud/Interface/ImGuiHelpers.cs +++ b/Dalamud/Interface/ImGuiHelpers.cs @@ -187,6 +187,7 @@ namespace Dalamud.Interface else if (!missingOnly) { addedCodepoints.Add(glyph->Codepoint); + prevGlyphPtr->TextureIndex = glyph->TextureIndex; prevGlyphPtr->X0 = glyph->X0 * scale; prevGlyphPtr->Y0 = ((glyph->Y0 - source.Value!.Ascent) * scale) + target.Value!.Ascent; prevGlyphPtr->X1 = glyph->X1 * scale; diff --git a/lib/ImGuiScene b/lib/ImGuiScene index cd6300cd7..65c26d024 160000 --- a/lib/ImGuiScene +++ b/lib/ImGuiScene @@ -1 +1 @@ -Subproject commit cd6300cd7944b24643ed7381fbe5ae15efc10448 +Subproject commit 65c26d024c814fda8154022e615073210bb62b3b From c6174233b39f6fb621d469c9a8d166369faae2e0 Mon Sep 17 00:00:00 2001 From: Soreepeong Date: Fri, 1 Jul 2022 01:21:55 +0900 Subject: [PATCH 06/22] Remove fallback font bs --- .../Internal/DalamudConfiguration.cs | 11 -- .../Interface/GameFonts/GameFontManager.cs | 9 +- .../Interface/Internal/DalamudInterface.cs | 8 -- .../Interface/Internal/InterfaceManager.cs | 134 ++---------------- .../Windows/FallbackFontNoticeWindow.cs | 95 ------------- .../Internal/Windows/SettingsWindow.cs | 49 ------- 6 files changed, 18 insertions(+), 288 deletions(-) delete mode 100644 Dalamud/Interface/Internal/Windows/FallbackFontNoticeWindow.cs diff --git a/Dalamud/Configuration/Internal/DalamudConfiguration.cs b/Dalamud/Configuration/Internal/DalamudConfiguration.cs index ccbfc17dc..0af3b5ebf 100644 --- a/Dalamud/Configuration/Internal/DalamudConfiguration.cs +++ b/Dalamud/Configuration/Internal/DalamudConfiguration.cs @@ -144,17 +144,6 @@ namespace Dalamud.Configuration.Internal /// public float FontGammaLevel { get; set; } = 1.4f; - /// - /// Gets or sets a value indicating the level of font resolution between 1 to 5. - /// 0(1024x1024), 1(2048x2048), 2(4096x4096), 3(8192x8192), 4(16384x16384). - /// - public int FontResolutionLevel { get; set; } = 2; - - /// - /// Gets or sets a value indicating whether to disable font fallback notice. - /// - public bool DisableFontFallbackNotice { get; set; } = false; - /// /// Gets or sets a value indicating whether or not plugin UI should be hidden. /// diff --git a/Dalamud/Interface/GameFonts/GameFontManager.cs b/Dalamud/Interface/GameFonts/GameFontManager.cs index 398785912..fa1098be7 100644 --- a/Dalamud/Interface/GameFonts/GameFontManager.cs +++ b/Dalamud/Interface/GameFonts/GameFontManager.cs @@ -40,7 +40,6 @@ namespace Dalamud.Interface.GameFonts private readonly Dictionary>> glyphRectIds = new(); private bool isBetweenBuildFontsAndRightAfterImGuiIoFontsBuild = false; - private bool isBuildingAsFallbackFontMode = false; [ServiceManager.ServiceConstructor] private GameFontManager(DataManager dataManager) @@ -253,10 +252,8 @@ namespace Dalamud.Interface.GameFonts /// /// Build fonts before plugins do something more. To be called from InterfaceManager. /// - /// Whether to load fonts in minimum sizes. - public void BuildFonts(bool forceMinSize) + public void BuildFonts() { - this.isBuildingAsFallbackFontMode = forceMinSize; this.isBetweenBuildFontsAndRightAfterImGuiIoFontsBuild = true; this.glyphRectIds.Clear(); @@ -305,7 +302,7 @@ namespace Dalamud.Interface.GameFonts foreach (var (style, font) in this.fonts) { - var fdt = this.fdts[(int)(this.isBuildingAsFallbackFontMode ? style.FamilyWithMinimumSize : style.FamilyAndSize)]; + var fdt = this.fdts[(int)style.FamilyAndSize]; var scale = style.SizePt / fdt.FontHeader.Size; var fontPtr = font.NativePtr; @@ -436,7 +433,7 @@ namespace Dalamud.Interface.GameFonts { var rectIds = this.glyphRectIds[style] = new(); - var fdt = this.fdts[(int)(this.isBuildingAsFallbackFontMode ? style.FamilyWithMinimumSize : style.FamilyAndSize)]; + var fdt = this.fdts[(int)style.FamilyAndSize]; if (fdt == null) return; diff --git a/Dalamud/Interface/Internal/DalamudInterface.cs b/Dalamud/Interface/Internal/DalamudInterface.cs index 5a6bae722..c9e13b8b5 100644 --- a/Dalamud/Interface/Internal/DalamudInterface.cs +++ b/Dalamud/Interface/Internal/DalamudInterface.cs @@ -54,7 +54,6 @@ namespace Dalamud.Interface.Internal private readonly SelfTestWindow selfTestWindow; private readonly StyleEditorWindow styleEditorWindow; private readonly TitleScreenMenuWindow titleScreenMenuWindow; - private readonly FallbackFontNoticeWindow fallbackFontNoticeWindow; private readonly ProfilerWindow profilerWindow; private readonly TextureWrap logoTexture; @@ -98,7 +97,6 @@ namespace Dalamud.Interface.Internal this.selfTestWindow = new SelfTestWindow() { IsOpen = false }; this.styleEditorWindow = new StyleEditorWindow() { IsOpen = false }; this.titleScreenMenuWindow = new TitleScreenMenuWindow() { IsOpen = false }; - this.fallbackFontNoticeWindow = new FallbackFontNoticeWindow() { IsOpen = interfaceManager.IsFallbackFontMode && !configuration.DisableFontFallbackNotice }; this.profilerWindow = new ProfilerWindow() { IsOpen = false }; this.WindowSystem.AddWindow(this.changelogWindow); @@ -115,7 +113,6 @@ namespace Dalamud.Interface.Internal this.WindowSystem.AddWindow(this.selfTestWindow); this.WindowSystem.AddWindow(this.styleEditorWindow); this.WindowSystem.AddWindow(this.titleScreenMenuWindow); - this.WindowSystem.AddWindow(this.fallbackFontNoticeWindow); this.WindowSystem.AddWindow(this.profilerWindow); ImGuiManagedAsserts.AssertsEnabled = configuration.AssertsEnabledAtStartup; @@ -222,11 +219,6 @@ namespace Dalamud.Interface.Internal /// public void OpenDevMenu() => this.isImGuiDrawDevMenu = true; - /// - /// Opens the fallback font notice window. - /// - public void OpenFallbackFontNoticeWindow() => this.fallbackFontNoticeWindow.IsOpen = true; - /// /// Opens the . /// diff --git a/Dalamud/Interface/Internal/InterfaceManager.cs b/Dalamud/Interface/Internal/InterfaceManager.cs index 924584b70..3f7ce9a4a 100644 --- a/Dalamud/Interface/Internal/InterfaceManager.cs +++ b/Dalamud/Interface/Internal/InterfaceManager.cs @@ -47,8 +47,6 @@ namespace Dalamud.Interface.Internal [ServiceManager.BlockingEarlyLoadedService] internal class InterfaceManager : IDisposable, IServiceType { - private const float MinimumFallbackFontSizePt = 9.6f; // Game's minimum AXIS font size - private const float MinimumFallbackFontSizePx = MinimumFallbackFontSizePt * 4.0f / 3.0f; private const float DefaultFontSizePt = 12.0f; private const float DefaultFontSizePx = DefaultFontSizePt * 4.0f / 3.0f; private const ushort Fallback1Codepoint = 0x3013; // Geta mark; FFXIV uses this to indicate that a glyph is missing. @@ -72,7 +70,6 @@ namespace Dalamud.Interface.Internal // can't access imgui IO before first present call private bool lastWantCapture = false; private bool isRebuildingFonts = false; - private bool isFallbackFontMode = false; private bool isOverrideGameCursor = true; [ServiceManager.ServiceConstructor] @@ -120,11 +117,6 @@ namespace Dalamud.Interface.Internal /// public event Action AfterBuildFonts; - /// - /// Gets or sets an action that is executed right after font fallback mode has been changed. - /// - public event Action FallbackFontModeChange; - /// /// Gets the default ImGui font. /// @@ -184,22 +176,6 @@ namespace Dalamud.Interface.Internal /// public bool IsDispatchingEvents { get; set; } = true; - /// - /// Gets or sets a value indicating whether the font has been loaded in fallback mode. - /// - public bool IsFallbackFontMode - { - get => this.isFallbackFontMode; - internal set - { - if (value == this.isFallbackFontMode) - return; - - this.isFallbackFontMode = value; - this.FallbackFontModeChange?.Invoke(value); - } - } - /// /// Gets or sets a value indicating whether to override configuration for UseAxis. /// @@ -220,16 +196,6 @@ namespace Dalamud.Interface.Internal /// public float FontGamma => Math.Max(0.1f, this.FontGammaOverride.GetValueOrDefault(Service.Get().FontGammaLevel)); - /// - /// Gets or sets a value indicating whether to override configuration for FontResolutionLevel. - /// - public int? FontResolutionLevelOverride { get; set; } = null; - - /// - /// Gets a value indicating the level of font resolution. - /// - public int FontResolutionLevel => this.FontResolutionLevelOverride ?? Service.Get().FontResolutionLevel; - /// /// Gets a value indicating whether we're building fonts but haven't generated atlas yet. /// @@ -599,8 +565,7 @@ namespace Dalamud.Interface.Internal /// /// Loads font for use in ImGui text functions. /// - /// If set, then glyphs will be loaded in smaller resolution to make all glyphs fit into given constraints. - private unsafe void SetupFonts(bool disableBigFonts = false) + private unsafe void SetupFonts() { using var setupFontsTimings = Timings.Start("IM SetupFonts"); @@ -609,12 +574,11 @@ namespace Dalamud.Interface.Internal var io = ImGui.GetIO(); var ioFonts = io.Fonts; - var maxTexDimension = 1 << (10 + Math.Max(0, Math.Min(4, this.FontResolutionLevel))); var fontGamma = this.FontGamma; this.fontBuildSignal.Reset(); ioFonts.Clear(); - ioFonts.TexDesiredWidth = maxTexDimension; + ioFonts.TexDesiredWidth = 4096; Log.Verbose("[FONT] SetupFonts - 1"); @@ -657,10 +621,9 @@ namespace Dalamud.Interface.Internal "Default", this.UseAxis ? TargetFontModification.AxisMode.Overwrite : TargetFontModification.AxisMode.GameGlyphsOnly, this.UseAxis ? DefaultFontSizePx : DefaultFontSizePx + 1, - io.FontGlobalScale, - disableBigFonts); + io.FontGlobalScale); Log.Verbose("[FONT] SetupFonts - Default corresponding AXIS size: {0}pt ({1}px)", fontInfo.SourceAxis.Style.BaseSizePt, fontInfo.SourceAxis.Style.BaseSizePx); - fontConfig.SizePixels = disableBigFonts ? Math.Min(MinimumFallbackFontSizePx, fontInfo.TargetSizePx) : fontInfo.TargetSizePx * io.FontGlobalScale; + fontConfig.SizePixels = fontInfo.TargetSizePx * io.FontGlobalScale; if (this.UseAxis) { fontConfig.GlyphRanges = dummyRangeHandle.AddrOfPinnedObject(); @@ -700,8 +663,8 @@ namespace Dalamud.Interface.Internal fontConfig.GlyphRanges = iconRangeHandle.AddrOfPinnedObject(); fontConfig.PixelSnapH = true; - IconFont = ioFonts.AddFontFromFileTTF(fontPathIcon, disableBigFonts ? Math.Min(MinimumFallbackFontSizePx, DefaultFontSizePx) : DefaultFontSizePx * io.FontGlobalScale, fontConfig); - this.loadedFontInfo[IconFont] = new("Icon", TargetFontModification.AxisMode.GameGlyphsOnly, DefaultFontSizePx, io.FontGlobalScale, disableBigFonts); + IconFont = ioFonts.AddFontFromFileTTF(fontPathIcon, DefaultFontSizePx * io.FontGlobalScale, fontConfig); + this.loadedFontInfo[IconFont] = new("Icon", TargetFontModification.AxisMode.GameGlyphsOnly, DefaultFontSizePx, io.FontGlobalScale); } // Monospace font @@ -713,8 +676,8 @@ namespace Dalamud.Interface.Internal fontConfig.GlyphRanges = IntPtr.Zero; fontConfig.PixelSnapH = true; - MonoFont = ioFonts.AddFontFromFileTTF(fontPathMono, disableBigFonts ? Math.Min(MinimumFallbackFontSizePx, DefaultFontSizePx) : DefaultFontSizePx * io.FontGlobalScale, fontConfig); - this.loadedFontInfo[MonoFont] = new("Mono", TargetFontModification.AxisMode.GameGlyphsOnly, DefaultFontSizePx, io.FontGlobalScale, disableBigFonts); + MonoFont = ioFonts.AddFontFromFileTTF(fontPathMono, DefaultFontSizePx * io.FontGlobalScale, fontConfig); + this.loadedFontInfo[MonoFont] = new("Mono", TargetFontModification.AxisMode.GameGlyphsOnly, DefaultFontSizePx, io.FontGlobalScale); } // Default font but in requested size for requested glyphs @@ -766,8 +729,7 @@ namespace Dalamud.Interface.Internal $"Requested({fontSize}px)", this.UseAxis ? TargetFontModification.AxisMode.Overwrite : TargetFontModification.AxisMode.GameGlyphsOnly, fontSize, - io.FontGlobalScale, - disableBigFonts); + io.FontGlobalScale); if (this.UseAxis) { fontConfig.GlyphRanges = dummyRangeHandle.AddrOfPinnedObject(); @@ -785,7 +747,7 @@ namespace Dalamud.Interface.Internal garbageList.Add(rangeHandle); fontConfig.PixelSnapH = true; - var sizedFont = ioFonts.AddFontFromFileTTF(fontPathJp, disableBigFonts ? Math.Min(MinimumFallbackFontSizePx, fontSize) : fontSize * io.FontGlobalScale, fontConfig, rangeHandle.AddrOfPinnedObject()); + var sizedFont = ioFonts.AddFontFromFileTTF(fontPathJp, fontSize * io.FontGlobalScale, fontConfig, rangeHandle.AddrOfPinnedObject()); this.loadedFontInfo[sizedFont] = fontInfo; foreach (var request in requests) request.FontInternal = sizedFont; @@ -793,7 +755,7 @@ namespace Dalamud.Interface.Internal } } - gameFontManager.BuildFonts(disableBigFonts); + gameFontManager.BuildFonts(); var customFontFirstConfigIndex = ioFonts.ConfigData.Size; @@ -835,17 +797,7 @@ namespace Dalamud.Interface.Internal this.loadedFontInfo[config.DstFont.NativePtr] = new($"PlReq({name})", config.SizePixels); } - if (disableBigFonts) - { - // If a plugin has requested a font size that is bigger than current restrictions, load it scaled down. - // After loading glyphs onto font atlas, font information will be modified to make it look like the font of original size has been loaded. - if (config.SizePixels > MinimumFallbackFontSizePx) - config.SizePixels = MinimumFallbackFontSizePx; - } - else - { - config.SizePixels = config.SizePixels * io.FontGlobalScale; - } + config.SizePixels = config.SizePixels * io.FontGlobalScale; } for (int i = 0, i_ = ioFonts.ConfigData.Size; i < i_; i++) @@ -859,34 +811,6 @@ namespace Dalamud.Interface.Internal gameFontManager.AfterIoFontsBuild(); Log.Verbose("[FONT] ImGui.IO.Build OK!"); - if (ioFonts.TexHeight > maxTexDimension) - { - var possibilityForScaling = false; - foreach (var x in this.loadedFontInfo.Values) - { - if (x.TargetSizePx * x.Scale > MinimumFallbackFontSizePx) - { - possibilityForScaling = true; - break; - } - } - - if (possibilityForScaling && !disableBigFonts) - { - Log.Information("[FONT] Atlas size is {0}x{1} which is bigger than allowed {2}x{3}. Retrying with minimized font sizes.", ioFonts.TexWidth, ioFonts.TexHeight, maxTexDimension, maxTexDimension); - this.IsFallbackFontMode = true; - this.SetupFonts(true); - return; - } - else - { - Log.Warning("[FONT] Atlas size is {0}x{1} which is bigger than allowed {2}x{3} even when font sizes are minimized up to {4}px. This may result in crash.", ioFonts.TexWidth, ioFonts.TexHeight, maxTexDimension, maxTexDimension, MinimumFallbackFontSizePx); - } - } - - if (!disableBigFonts) - this.IsFallbackFontMode = false; - gameFontManager.AfterBuildFonts(); foreach (var (font, mod) in this.loadedFontInfo) @@ -1004,34 +928,7 @@ namespace Dalamud.Interface.Internal this.scene!.OnNewRenderFrame -= this.RebuildFontsInternal; Log.Verbose("[FONT] Calling InvalidateFonts"); - try - { - this.scene.InvalidateFonts(); - } - catch (Exception ex) - { - if (this.FontResolutionLevel > 2) - { - Log.Error(ex, "[FONT] Failed to create font textures; setting font resolution level to 2 and retrying"); - this.FontResolutionLevelOverride = 2; - this.SetupFonts(); - } - else - { - Log.Error(ex, "[FONT] Failed to create font textures; forcing fallback font mode"); - this.SetupFonts(true); - } - - Log.Verbose("[FONT] Calling InvalidateFonts again"); - try - { - this.scene.InvalidateFonts(); - } - catch (Exception ex2) - { - Log.Error(ex2, "[FONT] Giving up"); - } - } + this.scene.InvalidateFonts(); Log.Verbose("[FONT] Font Rebuild OK!"); @@ -1279,13 +1176,12 @@ namespace Dalamud.Interface.Internal /// Whether and how to use AXIS fonts. /// Target font size in pixels, which will not be considered for further scaling. /// Font scale to be referred for loading AXIS font of appropriate size. - /// Whether to enable loading big AXIS fonts. - internal TargetFontModification(string name, AxisMode axis, float sizePx, float globalFontScale, bool disableBigFonts) + internal TargetFontModification(string name, AxisMode axis, float sizePx, float globalFontScale) { this.Name = name; this.Axis = axis; this.TargetSizePx = sizePx; - this.Scale = disableBigFonts ? MinimumFallbackFontSizePx / sizePx : globalFontScale; + this.Scale = globalFontScale; this.SourceAxis = Service.Get().NewFontRef(new(GameFontFamily.Axis, this.TargetSizePx * this.Scale)); } diff --git a/Dalamud/Interface/Internal/Windows/FallbackFontNoticeWindow.cs b/Dalamud/Interface/Internal/Windows/FallbackFontNoticeWindow.cs deleted file mode 100644 index fc83f2138..000000000 --- a/Dalamud/Interface/Internal/Windows/FallbackFontNoticeWindow.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Numerics; - -using CheapLoc; -using Dalamud.Configuration.Internal; -using Dalamud.Interface.Windowing; -using ImGuiNET; -using Serilog; - -namespace Dalamud.Interface.Internal.Windows -{ - /// - /// For major updates, an in-game Changelog window. - /// - internal sealed class FallbackFontNoticeWindow : Window, IDisposable - { - /// - /// Initializes a new instance of the class. - /// - public FallbackFontNoticeWindow() - : base(Title, ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoFocusOnAppearing | ImGuiWindowFlags.NoNavFocus) - { - this.Namespace = "FallbackFontNoticeWindow"; - this.RespectCloseHotkey = false; - - this.Size = new Vector2(885, 463); - this.SizeCondition = ImGuiCond.Appearing; - - var interfaceManager = Service.Get(); - var dalamud = Service.Get(); - - Service.Get().FallbackFontModeChange += this.OnFallbackFontModeChange; - } - - private static string Title => Loc.Localize("FallbackFontNoticeWindowTitle", "Fallback Font Mode Active"); - - /// - public override void Draw() - { - ImGui.Text(Title); - ImGuiHelpers.ScaledDummy(10); - - ImGui.Text(Loc.Localize("FallbackFontNoticeWindowBody", "The text used by Dalamud and plugins has been made blurry in order to prevent possible crash.")); - ImGuiHelpers.ScaledDummy(10); - - ImGui.Text(Loc.Localize("FallbackFontNoticeWindowSolution1", "* You may attempt to increase the limits on text quality. This may result in a crash.")); - ImGuiHelpers.ScaledDummy(10); - ImGui.SameLine(); - if (ImGui.Button(Loc.Localize("FallbackFontNoticeWindowOpenDalamudSettings", "Open Dalamud Settings"))) - Service.Get().OpenSettings(); - ImGuiHelpers.ScaledDummy(10); - ImGui.SameLine(); - ImGui.Text(string.Format( - Loc.Localize( - "FallbackFontNoticeWindowSolution1Instructions", - "In \"{0}\" tab, choose a better option for \"{1}\"."), - Loc.Localize("DalamudSettingsVisual", "Look & Feel"), - Loc.Localize("DalamudSettingsFontResolutionLevel", "Font resolution level"))); - - ImGuiHelpers.ScaledDummy(10); - - ImGui.Text(Loc.Localize("FallbackFontNoticeWindowSolution2", "* You may disable custom fonts, or make fonts smaller, from individual plugin settings.")); - ImGuiHelpers.ScaledDummy(10); - ImGui.SameLine(); - if (ImGui.Button(Loc.Localize("FallbackFontNoticeWindowOpenDalamudPlugins", "Open Plugin Installer"))) - Service.Get().OpenPluginInstaller(); - - ImGuiHelpers.ScaledDummy(10); - - if (ImGui.Button(Loc.Localize("FallbackFontNoticeWindowDoNotShowAgain", "Do not show again"))) - { - this.IsOpen = false; - Service.Get().DisableFontFallbackNotice = true; - Service.Get().Save(); - } - } - - /// - /// Dispose this window. - /// - public void Dispose() - { - Service.Get().FallbackFontModeChange -= this.OnFallbackFontModeChange; - } - - private void OnFallbackFontModeChange(bool mode) - { - Log.Verbose("[{0}] OnFallbackFontModeChange called: {1} (disable={2})", this.Namespace, mode, Service.Get().DisableFontFallbackNotice); - if (!mode) - this.IsOpen = false; - else if (!Service.Get().DisableFontFallbackNotice) - this.IsOpen = true; - } - } -} diff --git a/Dalamud/Interface/Internal/Windows/SettingsWindow.cs b/Dalamud/Interface/Internal/Windows/SettingsWindow.cs index b24504889..c589a55eb 100644 --- a/Dalamud/Interface/Internal/Windows/SettingsWindow.cs +++ b/Dalamud/Interface/Internal/Windows/SettingsWindow.cs @@ -27,8 +27,6 @@ namespace Dalamud.Interface.Internal.Windows private readonly string[] languages; private readonly string[] locLanguages; - private readonly string[] fontResolutionLevelStrings; - private int langIndex; private XivChatType dalamudMessagesChatType; @@ -38,8 +36,6 @@ namespace Dalamud.Interface.Internal.Windows private bool doCfChatMessage; private bool doMbCollect; - private int fontResolutionLevel; - private float globalUiScale; private bool doUseAxisFontsFromGame; private float fontGamma; @@ -101,7 +97,6 @@ namespace Dalamud.Interface.Internal.Windows this.globalUiScale = configuration.GlobalUiScale; this.fontGamma = configuration.FontGammaLevel; this.doUseAxisFontsFromGame = configuration.UseAxisFontsFromGame; - this.fontResolutionLevel = configuration.FontResolutionLevel; this.doToggleUiHide = configuration.ToggleUiHide; this.doToggleUiHideDuringCutscenes = configuration.ToggleUiHideDuringCutscenes; this.doToggleUiHideDuringGpose = configuration.ToggleUiHideDuringGpose; @@ -126,15 +121,6 @@ namespace Dalamud.Interface.Internal.Windows this.doButtonsSystemMenu = configuration.DoButtonsSystemMenu; this.disableRmtFiltering = configuration.DisableRmtFiltering; - this.fontResolutionLevelStrings = new[] - { - Loc.Localize("DalamudSettingsFontResolutionLevel0", "Least (1k x 1k texture)"), - Loc.Localize("DalamudSettingsFontResolutionLevel1", "Lesser (2k x 2k texture)"), - Loc.Localize("DalamudSettingsFontResolutionLevel2", "Normal (4k x 4k texture)"), - Loc.Localize("DalamudSettingsFontResolutionLevel3", "Better (8k x 8k texture, may crash your game)"), - Loc.Localize("DalamudSettingsFontResolutionLevel4", "Best (16k x 16k texture, may crash your game)"), - }; - this.languages = Localization.ApplicableLangCodes.Prepend("en").ToArray(); this.langIndex = Array.IndexOf(this.languages, configuration.EffectiveLanguage); if (this.langIndex == -1) @@ -184,12 +170,10 @@ namespace Dalamud.Interface.Internal.Windows var rebuildFont = ImGui.GetIO().FontGlobalScale != configuration.GlobalUiScale || interfaceManager.FontGamma != configuration.FontGammaLevel - || interfaceManager.FontResolutionLevel != configuration.FontResolutionLevel || interfaceManager.UseAxis != configuration.UseAxisFontsFromGame; ImGui.GetIO().FontGlobalScale = configuration.GlobalUiScale; interfaceManager.FontGammaOverride = null; - interfaceManager.FontResolutionLevelOverride = null; interfaceManager.UseAxisOverride = null; this.thirdRepoList = configuration.ThirdRepoList.Select(x => x.Clone()).ToList(); this.devPluginLocations = configuration.DevPluginLoadLocations.Select(x => x.Clone()).ToList(); @@ -373,38 +357,6 @@ namespace Dalamud.Interface.Internal.Windows ImGui.TextColored(ImGuiColors.DalamudGrey, Loc.Localize("DalamudSettingToggleUiAxisFontsHint", "Use AXIS fonts (the game's main UI fonts) as default Dalamud font.")); - ImGuiHelpers.ScaledDummy(3); - - ImGui.Text(Loc.Localize("DalamudSettingsFontResolutionLevel", "Font resolution level")); - if (interfaceManager.FontResolutionLevelOverride != null) - this.fontResolutionLevel = interfaceManager.FontResolutionLevelOverride.Value; - if (ImGui.Combo("##DalamudSettingsFontResolutionLevelCombo", ref this.fontResolutionLevel, this.fontResolutionLevelStrings, this.fontResolutionLevelStrings.Length)) - { - interfaceManager.FontResolutionLevelOverride = this.fontResolutionLevel; - interfaceManager.RebuildFonts(); - } - - ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudGrey); - ImGui.TextWrapped(string.Format( - Loc.Localize( - "DalamudSettingsFontResolutionLevelHint", - "This option allows Dalamud fonts to look better.\n* If your game crashes right away, or the option reverts, when changing this option, your PC does not support high font resolutions in Dalamud - you will have to use a lower one.\n* If it doesn't crash or revert immediately, then you can keep the new choice indefinitely as it's not going to crash your game once it worked.\n* Either choose the 3rd or 5th option. Use other options only when neither works well.\n* Current font atlas size is {0}px * {1}px."), - ImGui.GetIO().Fonts.TexWidth, - ImGui.GetIO().Fonts.TexHeight)); - ImGui.PopStyleColor(); - - if (Service.Get().DisableFontFallbackNotice) - { - ImGui.Text(Loc.Localize("DalamudSettingsFontResolutionLevelWarningDisabled", "Warning will not be displayed even when the limits are enforced and fonts become blurry.")); - if (ImGui.Button(Loc.Localize("DalamudSettingsFontResolutionLevelWarningReset", "Show warnings") + "##DalamudSettingsFontResolutionLevelWarningReset")) - { - Service.Get().DisableFontFallbackNotice = false; - Service.Get().Save(); - if (Service.Get().IsFallbackFontMode) - Service.Get().OpenFallbackFontNoticeWindow(); - } - } - ImGuiHelpers.ScaledDummy(10); ImGui.TextColored(ImGuiColors.DalamudGrey, Loc.Localize("DalamudSettingToggleUiHideOptOutNote", "Plugins may independently opt out of the settings below.")); @@ -969,7 +921,6 @@ namespace Dalamud.Interface.Internal.Windows configuration.ShowTsm = this.doTsm; configuration.UseAxisFontsFromGame = this.doUseAxisFontsFromGame; - configuration.FontResolutionLevel = this.fontResolutionLevel; configuration.FontGammaLevel = this.fontGamma; // This is applied every frame in InterfaceManager::CheckViewportState() From 6118cfa148d984b8e3f3e5b80dd974d6614f6fdb Mon Sep 17 00:00:00 2001 From: liam Date: Fri, 1 Jul 2022 00:17:55 -0400 Subject: [PATCH 07/22] Update ImGuiScene and add ImPlot demo to GUI menu bar element. --- Dalamud/Interface/Internal/DalamudInterface.cs | 6 ++++++ lib/ImGuiScene | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dalamud/Interface/Internal/DalamudInterface.cs b/Dalamud/Interface/Internal/DalamudInterface.cs index c9e13b8b5..0dd8e7812 100644 --- a/Dalamud/Interface/Internal/DalamudInterface.cs +++ b/Dalamud/Interface/Internal/DalamudInterface.cs @@ -27,6 +27,7 @@ using FFXIVClientStructs.FFXIV.Client.System.Framework; using FFXIVClientStructs.FFXIV.Client.UI; using ImGuiNET; using ImGuiScene; +using ImPlotNET; using PInvoke; using Serilog.Events; @@ -70,6 +71,7 @@ namespace Dalamud.Interface.Internal #endif private bool isImGuiDrawDemoWindow = false; + private bool isImPlotDrawDemoWindow = false; private bool isImGuiTestWindowsInMonospace = false; private bool isImGuiDrawMetricsWindow = false; @@ -400,6 +402,9 @@ namespace Dalamud.Interface.Internal if (this.isImGuiDrawDemoWindow) ImGui.ShowDemoWindow(ref this.isImGuiDrawDemoWindow); + if (this.isImPlotDrawDemoWindow) + ImPlot.ShowDemoWindow(ref this.isImPlotDrawDemoWindow); + if (this.isImGuiDrawMetricsWindow) ImGui.ShowMetricsWindow(ref this.isImGuiDrawMetricsWindow); @@ -632,6 +637,7 @@ namespace Dalamud.Interface.Internal { ImGui.MenuItem("Use Monospace font for following windows", string.Empty, ref this.isImGuiTestWindowsInMonospace); ImGui.MenuItem("Draw ImGui demo", string.Empty, ref this.isImGuiDrawDemoWindow); + ImGui.MenuItem("Draw ImPlot demo", string.Empty, ref this.isImPlotDrawDemoWindow); ImGui.MenuItem("Draw metrics", string.Empty, ref this.isImGuiDrawMetricsWindow); ImGui.Separator(); diff --git a/lib/ImGuiScene b/lib/ImGuiScene index 65c26d024..f9540e420 160000 --- a/lib/ImGuiScene +++ b/lib/ImGuiScene @@ -1 +1 @@ -Subproject commit 65c26d024c814fda8154022e615073210bb62b3b +Subproject commit f9540e4202dfb1d50e3ab11456b894c0cb0ad186 From 2045aa922898a7364a4b4b4af331a704205fbbe4 Mon Sep 17 00:00:00 2001 From: Cara Date: Fri, 1 Jul 2022 14:25:39 +0930 Subject: [PATCH 08/22] Add `ShowCloseButton` property to `Window` to allow hiding the close button. (#906) --- Dalamud/Interface/Windowing/Window.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dalamud/Interface/Windowing/Window.cs b/Dalamud/Interface/Windowing/Window.cs index 3b8b903c8..fc7777d42 100644 --- a/Dalamud/Interface/Windowing/Window.cs +++ b/Dalamud/Interface/Windowing/Window.cs @@ -104,6 +104,11 @@ namespace Dalamud.Interface.Windowing /// public float? BgAlpha { get; set; } + /// + /// Gets or sets a value indicating whether or not this ImGui window should display a close button in the title bar. + /// + public bool ShowCloseButton { get; set; } = true; + /// /// Gets or sets a value indicating whether or not this window will stay open. /// @@ -236,7 +241,7 @@ namespace Dalamud.Interface.Windowing ImGui.PushStyleColor(ImGuiCol.TitleBgCollapsed, focusedHeaderColor); } - if (ImGui.Begin(this.WindowName, ref this.internalIsOpen, this.Flags)) + if (this.ShowCloseButton ? ImGui.Begin(this.WindowName, ref this.internalIsOpen, this.Flags) : ImGui.Begin(this.WindowName, this.Flags)) { // Draw the actual window contents this.Draw(); From 12c3876d7b5ab9b3a100910bdb4eaa04e2e15b41 Mon Sep 17 00:00:00 2001 From: liam Date: Fri, 1 Jul 2022 16:54:04 -0400 Subject: [PATCH 09/22] Update ImGuiScene for text input and natives. --- lib/ImGuiScene | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ImGuiScene b/lib/ImGuiScene index f9540e420..730219306 160000 --- a/lib/ImGuiScene +++ b/lib/ImGuiScene @@ -1 +1 @@ -Subproject commit f9540e4202dfb1d50e3ab11456b894c0cb0ad186 +Subproject commit 7302193065a75cdc87a0fc56183182a15c175447 From ba5f3eae3b3aed23a93aca04be1fc3b5085132b7 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sun, 3 Jul 2022 17:09:52 +0200 Subject: [PATCH 10/22] refactor: remove unused usings --- Dalamud/Game/ChatHandlers.cs | 1 - Dalamud/Game/Gui/GameGui.cs | 6 ------ Dalamud/Game/Internal/AntiDebug.cs | 2 +- Dalamud/Game/Network/Internal/WinSockHandlers.cs | 1 - Dalamud/Hooking/Hook.cs | 5 +---- Dalamud/Hooking/Internal/PeHeader.cs | 4 ---- .../Windows/PluginInstaller/PluginChangelogEntry.cs | 1 - Dalamud/IoC/Internal/ServiceContainer.cs | 2 +- Dalamud/Plugin/DalamudPluginInterface.cs | 1 - 9 files changed, 3 insertions(+), 20 deletions(-) diff --git a/Dalamud/Game/ChatHandlers.cs b/Dalamud/Game/ChatHandlers.cs index e0bd38d55..7215568aa 100644 --- a/Dalamud/Game/ChatHandlers.cs +++ b/Dalamud/Game/ChatHandlers.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; using CheapLoc; using Dalamud.Configuration.Internal; -using Dalamud.Data; using Dalamud.Game.Gui; using Dalamud.Game.Text; using Dalamud.Game.Text.SeStringHandling; diff --git a/Dalamud/Game/Gui/GameGui.cs b/Dalamud/Game/Gui/GameGui.cs index 74f07f85d..e8b36ecf9 100644 --- a/Dalamud/Game/Gui/GameGui.cs +++ b/Dalamud/Game/Gui/GameGui.cs @@ -2,12 +2,6 @@ using System; using System.Numerics; using System.Runtime.InteropServices; -using Dalamud.Configuration.Internal; -using Dalamud.Game.Gui.ContextMenus; -using Dalamud.Game.Gui.Dtr; -using Dalamud.Game.Gui.FlyText; -using Dalamud.Game.Gui.PartyFinder; -using Dalamud.Game.Gui.Toast; using Dalamud.Game.Text.SeStringHandling.Payloads; using Dalamud.Hooking; using Dalamud.Interface; diff --git a/Dalamud/Game/Internal/AntiDebug.cs b/Dalamud/Game/Internal/AntiDebug.cs index 99797f4df..fd7569aed 100644 --- a/Dalamud/Game/Internal/AntiDebug.cs +++ b/Dalamud/Game/Internal/AntiDebug.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using Dalamud.Configuration.Internal; + using Serilog; namespace Dalamud.Game.Internal diff --git a/Dalamud/Game/Network/Internal/WinSockHandlers.cs b/Dalamud/Game/Network/Internal/WinSockHandlers.cs index ed90b90de..d3334ae96 100644 --- a/Dalamud/Game/Network/Internal/WinSockHandlers.cs +++ b/Dalamud/Game/Network/Internal/WinSockHandlers.cs @@ -1,5 +1,4 @@ using System; -using System.Diagnostics; using System.Net.Sockets; using System.Runtime.InteropServices; diff --git a/Dalamud/Hooking/Hook.cs b/Dalamud/Hooking/Hook.cs index cfe388ef6..9f56b8b31 100644 --- a/Dalamud/Hooking/Hook.cs +++ b/Dalamud/Hooking/Hook.cs @@ -1,12 +1,9 @@ using System; using System.Diagnostics; -using System.IO; using System.Reflection; using System.Runtime.InteropServices; -using Dalamud.Configuration.Internal; + using Dalamud.Hooking.Internal; -using Dalamud.Memory; -using Reloaded.Hooks; namespace Dalamud.Hooking { diff --git a/Dalamud/Hooking/Internal/PeHeader.cs b/Dalamud/Hooking/Internal/PeHeader.cs index 4e2987273..89898ccb9 100644 --- a/Dalamud/Hooking/Internal/PeHeader.cs +++ b/Dalamud/Hooking/Internal/PeHeader.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; #pragma warning disable namespace Dalamud.Hooking.Internal diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginChangelogEntry.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginChangelogEntry.cs index 3e955e389..0326081f5 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginChangelogEntry.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginChangelogEntry.cs @@ -1,6 +1,5 @@ using System; -using Dalamud.Plugin.Internal; using Dalamud.Plugin.Internal.Types; using Dalamud.Utility; diff --git a/Dalamud/IoC/Internal/ServiceContainer.cs b/Dalamud/IoC/Internal/ServiceContainer.cs index 9edd1479c..a04756851 100644 --- a/Dalamud/IoC/Internal/ServiceContainer.cs +++ b/Dalamud/IoC/Internal/ServiceContainer.cs @@ -4,8 +4,8 @@ using System.Linq; using System.Reflection; using System.Runtime.Serialization; using System.Threading.Tasks; + using Dalamud.Logging.Internal; -using Dalamud.Utility.Timing; namespace Dalamud.IoC.Internal { diff --git a/Dalamud/Plugin/DalamudPluginInterface.cs b/Dalamud/Plugin/DalamudPluginInterface.cs index 2a04cd2f6..e0fa641cc 100644 --- a/Dalamud/Plugin/DalamudPluginInterface.cs +++ b/Dalamud/Plugin/DalamudPluginInterface.cs @@ -15,7 +15,6 @@ using Dalamud.Game.Text.Sanitizer; using Dalamud.Game.Text.SeStringHandling; using Dalamud.Game.Text.SeStringHandling.Payloads; using Dalamud.Interface; -using Dalamud.Interface.GameFonts; using Dalamud.Interface.Internal; using Dalamud.Plugin.Internal; using Dalamud.Plugin.Ipc; From 12722c776da5d26177a51ba797e12cc9d190cd57 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sun, 3 Jul 2022 18:01:50 +0200 Subject: [PATCH 11/22] feat: add "orphaned plugin" status when the plugin has no associated repo --- Dalamud/Plugin/Internal/Types/LocalPlugin.cs | 9 +++++++++ Dalamud/Plugin/Internal/Types/LocalPluginManifest.cs | 3 ++- Dalamud/Plugin/Internal/Types/PluginRepository.cs | 9 ++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Dalamud/Plugin/Internal/Types/LocalPlugin.cs b/Dalamud/Plugin/Internal/Types/LocalPlugin.cs index f9fe09b68..344ba3c28 100644 --- a/Dalamud/Plugin/Internal/Types/LocalPlugin.cs +++ b/Dalamud/Plugin/Internal/Types/LocalPlugin.cs @@ -209,6 +209,12 @@ internal class LocalPlugin : IDisposable /// public bool IsTesting => this.Manifest.IsTestingExclusive || this.Manifest.Testing; + /// + /// Gets a value indicating whether or not this plugin is orphaned(belongs to a repo) or not. + /// + public bool IsOrphaned => !this.IsDev && !this.Manifest.InstalledFromUrl.IsNullOrEmpty() && + Service.Get().Repos.All(x => x.PluginMasterUrl != this.Manifest.InstalledFromUrl); + /// /// Gets a value indicating whether this plugin has been banned. /// @@ -302,6 +308,9 @@ internal class LocalPlugin : IDisposable if (this.Manifest.Disabled) throw new InvalidPluginOperationException($"Unable to load {this.Name}, disabled"); + if (this.IsOrphaned) + throw new InvalidPluginOperationException($"Plugin {this.Name} had no associated repo."); + this.State = PluginState.Loading; Log.Information($"Loading {this.DllFile.Name}"); diff --git a/Dalamud/Plugin/Internal/Types/LocalPluginManifest.cs b/Dalamud/Plugin/Internal/Types/LocalPluginManifest.cs index 261f28b0e..0853b19be 100644 --- a/Dalamud/Plugin/Internal/Types/LocalPluginManifest.cs +++ b/Dalamud/Plugin/Internal/Types/LocalPluginManifest.cs @@ -1,5 +1,6 @@ using System.IO; +using Dalamud.Utility; using Newtonsoft.Json; namespace Dalamud.Plugin.Internal.Types; @@ -33,7 +34,7 @@ internal record LocalPluginManifest : PluginManifest /// Gets a value indicating whether this manifest is associated with a plugin that was installed from a third party /// repo. Unless the manifest has been manually modified, this is determined by the InstalledFromUrl being null. /// - public bool IsThirdParty => !string.IsNullOrEmpty(this.InstalledFromUrl); + public bool IsThirdParty => !this.InstalledFromUrl.IsNullOrEmpty() && this.InstalledFromUrl != PluginRepository.MainRepoUrl; /// /// Save a plugin manifest to file. diff --git a/Dalamud/Plugin/Internal/Types/PluginRepository.cs b/Dalamud/Plugin/Internal/Types/PluginRepository.cs index 63ea5c5d4..82e4fb13d 100644 --- a/Dalamud/Plugin/Internal/Types/PluginRepository.cs +++ b/Dalamud/Plugin/Internal/Types/PluginRepository.cs @@ -15,7 +15,10 @@ namespace Dalamud.Plugin.Internal.Types; /// internal class PluginRepository { - private const string DalamudPluginsMasterUrl = "https://kamori.goats.dev/Plugin/PluginMaster"; + /// + /// The URL of the official main repository. + /// + public const string MainRepoUrl = "https://kamori.goats.dev/Plugin/PluginMaster"; private static readonly ModuleLog Log = new("PLUGINR"); @@ -38,14 +41,14 @@ internal class PluginRepository public PluginRepository(string pluginMasterUrl, bool isEnabled) { this.PluginMasterUrl = pluginMasterUrl; - this.IsThirdParty = pluginMasterUrl != DalamudPluginsMasterUrl; + this.IsThirdParty = pluginMasterUrl != MainRepoUrl; this.IsEnabled = isEnabled; } /// /// Gets a new instance of the class for the main repo. /// - public static PluginRepository MainRepo => new(DalamudPluginsMasterUrl, true); + public static PluginRepository MainRepo => new(MainRepoUrl, true); /// /// Gets the pluginmaster.json URL. From ce8e0880442b54d70a6a0f65767c4fd7155d2be8 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sun, 3 Jul 2022 18:02:46 +0200 Subject: [PATCH 12/22] feat: add orphaned plugins regardless, inform users in installer --- .../PluginInstaller/PluginInstallerWindow.cs | 22 ++++++++++++++++++- Dalamud/Plugin/Internal/PluginManager.cs | 14 +++++++----- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs index ac5d1f98a..ffb05e170 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs @@ -1180,6 +1180,12 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller ImGui.PopStyleColor(); } + else if (plugin is { IsOrphaned: true }) + { + ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed); + ImGui.TextWrapped(Locs.PluginBody_Orphaned); + ImGui.PopStyleColor(); + } else if (plugin is { State: PluginState.LoadError or PluginState.DependencyResolutionFailed }) // Load failed warning { ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed); @@ -1517,6 +1523,13 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller trouble = true; } + // Orphaned + if (plugin.IsOrphaned) + { + label += Locs.PluginTitleMod_OrphanedError; + trouble = true; + } + ImGui.PushID($"installed{index}{plugin.Manifest.InternalName}"); var hasChangelog = !plugin.Manifest.Changelog.IsNullOrEmpty(); @@ -1691,6 +1704,9 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller // Disable everything if the plugin is outdated disabled = disabled || (plugin.IsOutdated && !configuration.LoadAllApiLevels) || plugin.IsBanned; + // Disable everything if the plugin is orphaned + disabled = disabled || plugin.IsOrphaned; + // Disable everything if the plugin failed to load disabled = disabled || plugin.State == PluginState.LoadError || plugin.State == PluginState.DependencyResolutionFailed; @@ -1904,7 +1920,7 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller private void DrawDeletePluginButton(LocalPlugin plugin) { var unloaded = plugin.State == PluginState.Unloaded; - var showButton = unloaded && (plugin.IsDev || plugin.IsOutdated || plugin.IsBanned); + var showButton = unloaded && (plugin.IsDev || plugin.IsOutdated || plugin.IsBanned || plugin.IsOrphaned); if (!showButton) return; @@ -2264,6 +2280,8 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller public static string PluginTitleMod_OutdatedError => Loc.Localize("InstallerOutdatedError", " (outdated)"); public static string PluginTitleMod_BannedError => Loc.Localize("InstallerBannedError", " (automatically disabled)"); + + public static string PluginTitleMod_OrphanedError => Loc.Localize("InstallerOrphanedError", " (unknown repository)"); public static string PluginTitleMod_New => Loc.Localize("InstallerNewPlugin ", " New!"); @@ -2299,6 +2317,8 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller public static string PluginBody_Outdated => Loc.Localize("InstallerOutdatedPluginBody ", "This plugin is outdated and incompatible at the moment. Please wait for it to be updated by its author."); + public static string PluginBody_Orphaned => Loc.Localize("InstallerOrphanedPluginBody ", "This plugin's source repository is no longer available. You may need to reinstall it from its repository, or re-add the repository."); + public static string PluginBody_LoadFailed => Loc.Localize("InstallerLoadFailedPluginBody ", "This plugin failed to load. Please contact the author for more information."); public static string PluginBody_Banned => Loc.Localize("InstallerBannedPluginBody ", "This plugin was automatically disabled due to incompatibilities and is not available at the moment. Please wait for it to be updated by its author."); diff --git a/Dalamud/Plugin/Internal/PluginManager.cs b/Dalamud/Plugin/Internal/PluginManager.cs index 8879ce4f2..533b2acd9 100644 --- a/Dalamud/Plugin/Internal/PluginManager.cs +++ b/Dalamud/Plugin/Internal/PluginManager.cs @@ -658,11 +658,8 @@ internal partial class PluginManager : IDisposable, IServiceType manifest.Testing = true; } - if (repoManifest.SourceRepo.IsThirdParty) - { - // Only document the url if it came from a third party repo. - manifest.InstalledFromUrl = repoManifest.SourceRepo.PluginMasterUrl; - } + // Document the url the plugin was installed from + manifest.InstalledFromUrl = repoManifest.SourceRepo.PluginMasterUrl; manifest.Save(manifestFile); @@ -740,9 +737,14 @@ internal partial class PluginManager : IDisposable, IServiceType } else if (plugin.IsOutdated) { - // Out of date plugins get added so they can be updated. + // Out of date plugins get added, so they can be updated. Log.Information(ex, $"Plugin was outdated, adding anyways: {dllFile.Name}"); } + else if (plugin.IsOrphaned) + { + // Orphaned plugins get added, so that users aren't confused. + Log.Information(ex, $"Plugin was orphaned, adding anyways: {dllFile.Name}"); + } else if (isBoot) { // During boot load, plugins always get added to the list so they can be fiddled with in the UI From 94998b65e4edf52bdf0e9793ad62bdbc29e0934f Mon Sep 17 00:00:00 2001 From: pot0to Date: Sun, 3 Jul 2022 12:51:51 -0700 Subject: [PATCH 13/22] adding pf condition "duty complete (weekly reward unclaimed)" (#907) --- Dalamud/Game/Gui/PartyFinder/Types/ConditionFlags.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Dalamud/Game/Gui/PartyFinder/Types/ConditionFlags.cs b/Dalamud/Game/Gui/PartyFinder/Types/ConditionFlags.cs index 3eb5ec1b6..50f59426e 100644 --- a/Dalamud/Game/Gui/PartyFinder/Types/ConditionFlags.cs +++ b/Dalamud/Game/Gui/PartyFinder/Types/ConditionFlags.cs @@ -11,16 +11,22 @@ namespace Dalamud.Game.Gui.PartyFinder.Types /// /// No duty condition. /// - None = 1, + None = 1 << 0, /// /// The duty complete condition. /// - DutyComplete = 2, + DutyComplete = 1 << 1, + + /// + /// The duty complete (weekly reward unclaimed) condition. This condition is + /// only available for savage fights prior to echo release. + /// + DutyCompleteWeeklyRewardUnclaimed = 1 << 3, /// /// The duty incomplete condition. /// - DutyIncomplete = 4, + DutyIncomplete = 1 << 2, } } From c07780c5ffb937cf6f4dcf5c5b8d0c3e1029d949 Mon Sep 17 00:00:00 2001 From: Aireil <33433913+Aireil@users.noreply.github.com> Date: Tue, 5 Jul 2022 21:25:56 +0200 Subject: [PATCH 14/22] fix: add using back to AntiDebug (#908) --- Dalamud/Game/Internal/AntiDebug.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Dalamud/Game/Internal/AntiDebug.cs b/Dalamud/Game/Internal/AntiDebug.cs index fd7569aed..aaecfe4b1 100644 --- a/Dalamud/Game/Internal/AntiDebug.cs +++ b/Dalamud/Game/Internal/AntiDebug.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; +using Dalamud.Configuration.Internal; using Serilog; namespace Dalamud.Game.Internal From 21c47cb7f19c1a4604c285ab804d2099ed7f9e4b Mon Sep 17 00:00:00 2001 From: liam Date: Fri, 8 Jul 2022 14:05:55 -0400 Subject: [PATCH 15/22] Update ImGuiScene. --- lib/ImGuiScene | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ImGuiScene b/lib/ImGuiScene index 730219306..d6b66ce78 160000 --- a/lib/ImGuiScene +++ b/lib/ImGuiScene @@ -1 +1 @@ -Subproject commit 7302193065a75cdc87a0fc56183182a15c175447 +Subproject commit d6b66ce78a3d9fe2e39f9023489c836ed2146401 From 50c812f5516d4e10932848e1e0dade34a0c95220 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sat, 9 Jul 2022 03:14:29 +0200 Subject: [PATCH 16/22] fix: use correct indexer for ClientState.LocalPlayer --- Dalamud/Game/ClientState/ClientState.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dalamud/Game/ClientState/ClientState.cs b/Dalamud/Game/ClientState/ClientState.cs index bc2939f8b..940973ad8 100644 --- a/Dalamud/Game/ClientState/ClientState.cs +++ b/Dalamud/Game/ClientState/ClientState.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; using System.Runtime.InteropServices; using Dalamud.Data; @@ -105,7 +104,7 @@ namespace Dalamud.Game.ClientState /// /// Gets the local player character, if one is present. /// - public PlayerCharacter? LocalPlayer => Service.GetNullable()?.FirstOrDefault() as PlayerCharacter; + public PlayerCharacter? LocalPlayer => Service.GetNullable()?[0] as PlayerCharacter; /// /// Gets the content ID of the local character. From eb98a52e1476911be200a600bc4515c32e9675db Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sat, 9 Jul 2022 03:14:56 +0200 Subject: [PATCH 17/22] chore: don't use a default game path when config read fails --- Dalamud.Injector/EntryPoint.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dalamud.Injector/EntryPoint.cs b/Dalamud.Injector/EntryPoint.cs index 30976357d..381598b08 100644 --- a/Dalamud.Injector/EntryPoint.cs +++ b/Dalamud.Injector/EntryPoint.cs @@ -546,8 +546,8 @@ namespace Dalamud.Injector } catch (Exception) { - gamePath = @"C:\Program Files (x86)\SquareEnix\FINAL FANTASY XIV - A Realm Reborn\game\ffxiv_dx11.exe"; - Log.Warning("Failed to read launcherConfigV3.json. Using default game installation path: {0}", gamePath); + Log.Error("Failed to read launcherConfigV3.json to get the set-up game path, please specify one using -g"); + return -1; } if (!File.Exists(gamePath)) From abe59b71e694918ecd39d7db01df13695b2e9cbb Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sat, 9 Jul 2022 03:34:52 +0200 Subject: [PATCH 18/22] build: 6.4.0.33 --- Dalamud/Dalamud.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dalamud/Dalamud.csproj b/Dalamud/Dalamud.csproj index 2cb982ab9..b57449a54 100644 --- a/Dalamud/Dalamud.csproj +++ b/Dalamud/Dalamud.csproj @@ -8,7 +8,7 @@ - 6.4.0.32 + 6.4.0.33 XIV Launcher addon framework $(DalamudVersion) $(DalamudVersion) From c5ce1815e03485bc94b53cf3a2dfb22d6a7e97bd Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sun, 10 Jul 2022 17:26:41 +0200 Subject: [PATCH 19/22] ci: save git hash separately on version meta --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d270429e..0edf6b413 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,6 +82,7 @@ jobs: } else { Move-Item -Force ".\canary.zip" ".\${branchName}\latest.zip" $versionData.AssemblyVersion = $newVersion + $versionData.GitSha = $newVersion $versionData | ConvertTo-Json -Compress | Out-File ".\${branchName}\version" } From 190ef494c5383e2c9cf65ad4f510c9128ba5d448 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sun, 10 Jul 2022 17:31:52 +0200 Subject: [PATCH 20/22] feat: add visual branch switcher --- .../Internal/DalamudConfiguration.cs | 11 -- .../Interface/Internal/DalamudInterface.cs | 18 ++- .../Internal/Windows/BranchSwitcherWindow.cs | 144 ++++++++++++++++++ 3 files changed, 156 insertions(+), 17 deletions(-) create mode 100644 Dalamud/Interface/Internal/Windows/BranchSwitcherWindow.cs diff --git a/Dalamud/Configuration/Internal/DalamudConfiguration.cs b/Dalamud/Configuration/Internal/DalamudConfiguration.cs index ccbfc17dc..c201f96e0 100644 --- a/Dalamud/Configuration/Internal/DalamudConfiguration.cs +++ b/Dalamud/Configuration/Internal/DalamudConfiguration.cs @@ -18,11 +18,6 @@ namespace Dalamud.Configuration.Internal [Serializable] internal sealed class DalamudConfiguration : IServiceType { - /// - /// Currently used beta key for Dalamud staging builds. - /// - public const string DalamudCurrentBetaKey = "proof of context"; - private static readonly JsonSerializerSettings SerializerSettings = new() { TypeNameHandling = TypeNameHandling.All, @@ -44,12 +39,6 @@ namespace Dalamud.Configuration.Internal /// public event DalamudConfigurationSavedDelegate DalamudConfigurationSaved; - /// - /// Gets a value indicating whether or not Dalamud staging is enabled. - /// - [JsonIgnore] - public bool IsConventionalStaging => this.DalamudBetaKey == DalamudCurrentBetaKey; - /// /// Gets or sets a list of muted works. /// diff --git a/Dalamud/Interface/Internal/DalamudInterface.cs b/Dalamud/Interface/Internal/DalamudInterface.cs index 5a6bae722..66579e0ae 100644 --- a/Dalamud/Interface/Internal/DalamudInterface.cs +++ b/Dalamud/Interface/Internal/DalamudInterface.cs @@ -56,6 +56,7 @@ namespace Dalamud.Interface.Internal private readonly TitleScreenMenuWindow titleScreenMenuWindow; private readonly FallbackFontNoticeWindow fallbackFontNoticeWindow; private readonly ProfilerWindow profilerWindow; + private readonly BranchSwitcherWindow branchSwitcherWindow; private readonly TextureWrap logoTexture; private readonly TextureWrap tsmLogoTexture; @@ -100,6 +101,7 @@ namespace Dalamud.Interface.Internal this.titleScreenMenuWindow = new TitleScreenMenuWindow() { IsOpen = false }; this.fallbackFontNoticeWindow = new FallbackFontNoticeWindow() { IsOpen = interfaceManager.IsFallbackFontMode && !configuration.DisableFontFallbackNotice }; this.profilerWindow = new ProfilerWindow() { IsOpen = false }; + this.branchSwitcherWindow = new BranchSwitcherWindow() { IsOpen = false }; this.WindowSystem.AddWindow(this.changelogWindow); this.WindowSystem.AddWindow(this.colorDemoWindow); @@ -117,6 +119,7 @@ namespace Dalamud.Interface.Internal this.WindowSystem.AddWindow(this.titleScreenMenuWindow); this.WindowSystem.AddWindow(this.fallbackFontNoticeWindow); this.WindowSystem.AddWindow(this.profilerWindow); + this.WindowSystem.AddWindow(this.branchSwitcherWindow); ImGuiManagedAsserts.AssertsEnabled = configuration.AssertsEnabledAtStartup; this.isImGuiDrawDevMenu = this.isImGuiDrawDevMenu || configuration.DevBarOpenAtStartup; @@ -140,7 +143,7 @@ namespace Dalamud.Interface.Internal tsm.AddEntryCore(Loc.Localize("TSMDalamudPlugins", "Plugin Installer"), this.tsmLogoTexture, () => this.pluginWindow.IsOpen = true); tsm.AddEntryCore(Loc.Localize("TSMDalamudSettings", "Dalamud Settings"), this.tsmLogoTexture, () => this.settingsWindow.IsOpen = true); - if (configuration.IsConventionalStaging) + if (!configuration.DalamudBetaKind.IsNullOrEmpty()) { tsm.AddEntryCore(Loc.Localize("TSMDalamudDevMenu", "Developer Menu"), this.tsmLogoTexture, () => this.isImGuiDrawDevMenu = true); } @@ -272,6 +275,11 @@ namespace Dalamud.Interface.Internal /// public void OpenProfiler() => this.profilerWindow.IsOpen = true; + /// + /// Opens the + /// + public void OpenBranchSwitcher() => this.branchSwitcherWindow.IsOpen = true; + #endregion #region Close @@ -621,17 +629,15 @@ namespace Dalamud.Interface.Internal ImGui.Separator(); - var isBeta = configuration.DalamudBetaKey == DalamudConfiguration.DalamudCurrentBetaKey; - if (ImGui.MenuItem("Enable Dalamud testing", string.Empty, isBeta)) + if (ImGui.MenuItem("Open Dalamud branch switcher")) { - configuration.DalamudBetaKey = isBeta ? null : DalamudConfiguration.DalamudCurrentBetaKey; - configuration.Save(); + this.OpenBranchSwitcher(); } var startInfo = Service.Get(); ImGui.MenuItem(Util.AssemblyVersion, false); ImGui.MenuItem(startInfo.GameVersion.ToString(), false); - ImGui.MenuItem($"CS: {Util.GetGitHashClientStructs()}", false); + ImGui.MenuItem($"D: {Util.GetGitHash()} CS: {Util.GetGitHashClientStructs()}", false); ImGui.EndMenu(); } diff --git a/Dalamud/Interface/Internal/Windows/BranchSwitcherWindow.cs b/Dalamud/Interface/Internal/Windows/BranchSwitcherWindow.cs new file mode 100644 index 000000000..bdff07e3e --- /dev/null +++ b/Dalamud/Interface/Internal/Windows/BranchSwitcherWindow.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net.Http; +using System.Net.Http.Json; +using System.Threading.Tasks; + +using Dalamud.Configuration.Internal; +using Dalamud.Interface.Colors; +using Dalamud.Interface.Windowing; +using ImGuiNET; +using Newtonsoft.Json; + +namespace Dalamud.Interface.Internal.Windows; + +/// +/// Window responsible for switching Dalamud beta branches. +/// +public class BranchSwitcherWindow : Window +{ + private const string BranchInfoUrl = "https://kamori.goats.dev/Dalamud/Release/Meta"; + + private Dictionary? branches; + private int selectedBranchIndex; + + /// + /// Initializes a new instance of the class. + /// + public BranchSwitcherWindow() + : base("Branch Switcher", ImGuiWindowFlags.AlwaysAutoResize) + { + this.ShowCloseButton = false; + this.RespectCloseHotkey = false; + } + + /// + public override void OnOpen() + { + Task.Run(async () => + { + using var client = new HttpClient(); + this.branches = await client.GetFromJsonAsync>(BranchInfoUrl); + Debug.Assert(this.branches != null, "this.branches != null"); + + var config = Service.Get(); + this.selectedBranchIndex = this.branches!.Any(x => x.Key == config.DalamudBetaKind) ? + this.branches.TakeWhile(x => x.Key != config.DalamudBetaKind).Count() + : 0; + + if (this.branches.ElementAt(this.selectedBranchIndex).Value.Key != config.DalamudBetaKey) + this.selectedBranchIndex = 0; + }); + + base.OnOpen(); + } + + /// + public override void Draw() + { + if (this.branches == null) + { + ImGui.TextColored(ImGuiColors.DalamudGrey, "Loading branches..."); + return; + } + + var si = Service.Get(); + + var itemsArray = this.branches.Select(x => x.Key).ToArray(); + ImGui.ListBox("Branch", ref this.selectedBranchIndex, itemsArray, itemsArray.Length); + + var pickedBranch = this.branches.ElementAt(this.selectedBranchIndex); + + if (pickedBranch.Value.SupportedGameVer != si.GameVersion) + { + ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed); + ImGui.TextWrapped("Can't pick this branch. GameVer != SupportedGameVer."); + } + else + { + ImGui.Text($"Version: {pickedBranch.Value.AssemblyVersion} ({pickedBranch.Value.GitSha ?? "unk"})"); + ImGui.Text($"Runtime: {pickedBranch.Value.RuntimeVersion}"); + + ImGuiHelpers.ScaledDummy(5); + + void Pick() + { + var config = Service.Get(); + config.DalamudBetaKind = pickedBranch.Key; + config.DalamudBetaKey = pickedBranch.Value.Key; + config.Save(); + } + + if (ImGui.Button("Pick")) + { + Pick(); + } + + ImGui.SameLine(); + + if (ImGui.Button("Pick & Restart")) + { + Pick(); + + var appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); + var xlPath = Path.Combine(appData, "XIVLauncher", "XIVLauncher.exe"); + + if (File.Exists(xlPath)) + { + Process.Start(xlPath); + Environment.Exit(0); + } + } + } + } + + private class VersionEntry + { + [JsonProperty("key")] + public string? Key { get; set; } + + [JsonProperty("track")] + public string? Track { get; set; } + + [JsonProperty("assemblyVersion")] + public string? AssemblyVersion { get; set; } + + [JsonProperty("runtimeVersion")] + public string? RuntimeVersion { get; set; } + + [JsonProperty("runtimeRequired")] + public bool RuntimeRequired { get; set; } + + [JsonProperty("supportedGameVer")] + public string? SupportedGameVer { get; set; } + + [JsonProperty("downloadUrl")] + public string? DownloadUrl { get; set; } + + [JsonProperty("gitSha")] + public string? GitSha { get; set; } + } +} From 71560a1a2849745ea64992288a0226e3a84e8ea9 Mon Sep 17 00:00:00 2001 From: goat Date: Sun, 10 Jul 2022 18:02:49 +0200 Subject: [PATCH 21/22] ci: actually add hash to object --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0edf6b413..c0eba166a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,7 +82,7 @@ jobs: } else { Move-Item -Force ".\canary.zip" ".\${branchName}\latest.zip" $versionData.AssemblyVersion = $newVersion - $versionData.GitSha = $newVersion + $versionData | add-member -Force -Name "GitSha" $newVersion -MemberType NoteProperty $versionData | ConvertTo-Json -Compress | Out-File ".\${branchName}\version" } From 414812b52d8025a0e411a0fc5d2a3fa80982a85c Mon Sep 17 00:00:00 2001 From: liam <6005409+lmcintyre@users.noreply.github.com> Date: Mon, 11 Jul 2022 01:47:52 -0400 Subject: [PATCH 22/22] Merge 1.88 fork into net5 (#911) * Update ImGuiScene. * Update ImGuiScene. * Update ImGuiScene. * Update ImGuiScene. * Fix obsolete errors in Dalamud. --- Dalamud/Interface/Internal/UiDebug.cs | 2 +- Dalamud/Interface/Internal/Windows/PluginStatWindow.cs | 4 ++-- Dalamud/Interface/Internal/Windows/SettingsWindow.cs | 4 ++-- lib/ImGuiScene | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dalamud/Interface/Internal/UiDebug.cs b/Dalamud/Interface/Internal/UiDebug.cs index 51e2b6b42..af06da796 100644 --- a/Dalamud/Interface/Internal/UiDebug.cs +++ b/Dalamud/Interface/Internal/UiDebug.cs @@ -95,7 +95,7 @@ namespace Dalamud.Interface.Internal ImGui.Text(isVisible ? "Visible" : "Not Visible"); ImGui.PopStyleColor(); - ImGui.SameLine(ImGui.GetWindowContentRegionWidth() - 25); + ImGui.SameLine(ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X - 25); if (ImGui.SmallButton("V")) { atkUnitBase->Flags ^= 0x20; diff --git a/Dalamud/Interface/Internal/Windows/PluginStatWindow.cs b/Dalamud/Interface/Internal/Windows/PluginStatWindow.cs index 0fcedc48e..68589244a 100644 --- a/Dalamud/Interface/Internal/Windows/PluginStatWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginStatWindow.cs @@ -125,7 +125,7 @@ namespace Dalamud.Interface.Internal.Windows ImGui.Columns(4); - ImGui.SetColumnWidth(0, ImGui.GetWindowContentRegionWidth() - 300); + ImGui.SetColumnWidth(0, ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X - 300); ImGui.SetColumnWidth(1, 100f); ImGui.SetColumnWidth(2, 100f); ImGui.SetColumnWidth(3, 100f); @@ -179,7 +179,7 @@ namespace Dalamud.Interface.Internal.Windows { ImGui.Columns(4); - ImGui.SetColumnWidth(0, ImGui.GetWindowContentRegionWidth() - 330); + ImGui.SetColumnWidth(0, ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X - 330); ImGui.SetColumnWidth(1, 180f); ImGui.SetColumnWidth(2, 100f); ImGui.SetColumnWidth(3, 100f); diff --git a/Dalamud/Interface/Internal/Windows/SettingsWindow.cs b/Dalamud/Interface/Internal/Windows/SettingsWindow.cs index c589a55eb..0f56a79fc 100644 --- a/Dalamud/Interface/Internal/Windows/SettingsWindow.cs +++ b/Dalamud/Interface/Internal/Windows/SettingsWindow.cs @@ -600,7 +600,7 @@ namespace Dalamud.Interface.Internal.Windows ImGui.Columns(4); ImGui.SetColumnWidth(0, 18 + (5 * ImGuiHelpers.GlobalScale)); - ImGui.SetColumnWidth(1, ImGui.GetWindowContentRegionWidth() - (18 + 16 + 14) - ((5 + 45 + 26) * ImGuiHelpers.GlobalScale)); + ImGui.SetColumnWidth(1, ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X - (18 + 16 + 14) - ((5 + 45 + 26) * ImGuiHelpers.GlobalScale)); ImGui.SetColumnWidth(2, 16 + (45 * ImGuiHelpers.GlobalScale)); ImGui.SetColumnWidth(3, 14 + (26 * ImGuiHelpers.GlobalScale)); @@ -739,7 +739,7 @@ namespace Dalamud.Interface.Internal.Windows ImGui.Columns(4); ImGui.SetColumnWidth(0, 18 + (5 * ImGuiHelpers.GlobalScale)); - ImGui.SetColumnWidth(1, ImGui.GetWindowContentRegionWidth() - (18 + 16 + 14) - ((5 + 45 + 26) * ImGuiHelpers.GlobalScale)); + ImGui.SetColumnWidth(1, ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X - (18 + 16 + 14) - ((5 + 45 + 26) * ImGuiHelpers.GlobalScale)); ImGui.SetColumnWidth(2, 16 + (45 * ImGuiHelpers.GlobalScale)); ImGui.SetColumnWidth(3, 14 + (26 * ImGuiHelpers.GlobalScale)); diff --git a/lib/ImGuiScene b/lib/ImGuiScene index d6b66ce78..acc1f9928 160000 --- a/lib/ImGuiScene +++ b/lib/ImGuiScene @@ -1 +1 @@ -Subproject commit d6b66ce78a3d9fe2e39f9023489c836ed2146401 +Subproject commit acc1f99285de7db31055211e4dfcfae648d6c219