Compare commits

..

13 commits

Author SHA1 Message Date
goat
5e4ad4a694
Merge pull request #2533 from wolfcomp/patch-7
Some checks are pending
Build Dalamud / Build on Windows (push) Waiting to run
Build Dalamud / Check API Compatibility (push) Blocked by required conditions
Build Dalamud / Deploy dalamud-distrib staging (push) Blocked by required conditions
Tag Build / Tag Build (push) Successful in 5s
Add new themes and update themed path logic
2025-12-19 12:09:41 +01:00
wolfcomp
c71d8889d7
Access const as non instance 2025-12-19 11:51:09 +01:00
wolfcomp
4ddaaf3809
Add new themes and update themed path logic 2025-12-19 11:41:33 +01:00
goat
3b8917bcc8
Merge pull request #2528 from CMDRNuffin/imgui-textboxes-fix-unnecessary-cloning-on-unchanged-text
Prevent ImGui text box methods from cloning unchanged input every frame
2025-12-19 11:36:19 +01:00
goat
517d5d017b
Merge pull request #2529 from Haselnussbomber/update-uicolorwidget
Update UIColor widget
2025-12-19 11:35:56 +01:00
goat
8fb2c39d80
Merge pull request #2532 from goatcorp/csupdate-master
[master] Update ClientStructs
2025-12-19 11:35:34 +01:00
github-actions[bot]
89c46944b6 Update ClientStructs 2025-12-19 10:20:39 +00:00
goat
cb3881f07d
Merge pull request #2531 from goatcorp/schemaupdate-master
[master] Update Excel Schema
2025-12-19 08:44:59 +01:00
goat
6ead1c8895
Merge pull request #2530 from goatcorp/csupdate-master
[master] Update ClientStructs
2025-12-19 08:44:10 +01:00
github-actions[bot]
f3f4ced049 Update Excel Schema
Some checks are pending
Build Dalamud / Build on Windows (push) Waiting to run
Build Dalamud / Check API Compatibility (push) Blocked by required conditions
Build Dalamud / Deploy dalamud-distrib staging (push) Blocked by required conditions
2025-12-19 06:39:07 +00:00
github-actions[bot]
7af0523e88 Update ClientStructs 2025-12-19 06:38:57 +00:00
Haselnussbomber
86e12f411d
Update UIColor widget 2025-12-19 03:26:53 +01:00
CMDRNuffin
db5f27518f Prevent ImGui text box methods from cloning unchanged input every frame
The overloads taking a string by ref for the input text of the various
ways to display a text box would all take the input string, copy it into
a buffer for imgui and then unconditionally produce a new string once
the imgui call returned. Now we only create a new string when the return
value of the native function actually indicates that the text changed.

This makes the GC happy, and also users like me who like to make the GC
happy.

Other side effects: The assumption that the reference doesn't change if
the method returns false, which is very reasonable IMO, is now correct.
2025-12-19 01:24:43 +01:00
5 changed files with 143 additions and 40 deletions

View file

@ -44,7 +44,7 @@ internal class UiColorWidget : IDataWindowWidget
"<edgecolor(0xEEEEFF)><color(0x0000FF)>BB<color(stackcolor)><edgecolor(stackcolor)>.<br>" +
"· Click on a color to copy the color code.<br>" +
"· Hover on a color to preview the text with edge, when the next color has been used together.");
if (!ImGui.BeginTable("UIColor"u8, 5))
if (!ImGui.BeginTable("UIColor"u8, 7))
return;
ImGui.TableSetupScrollFreeze(0, 1);
@ -62,6 +62,8 @@ internal class UiColorWidget : IDataWindowWidget
ImGui.TableSetupColumn("Light"u8, ImGuiTableColumnFlags.WidthFixed, colorw);
ImGui.TableSetupColumn("Classic FF"u8, ImGuiTableColumnFlags.WidthFixed, colorw);
ImGui.TableSetupColumn("Clear Blue"u8, ImGuiTableColumnFlags.WidthFixed, colorw);
ImGui.TableSetupColumn("Clear White"u8, ImGuiTableColumnFlags.WidthFixed, colorw);
ImGui.TableSetupColumn("Clear Green"u8, ImGuiTableColumnFlags.WidthFixed, colorw);
ImGui.TableHeadersRow();
var clipper = ImGui.ImGuiListClipper();
@ -120,6 +122,22 @@ internal class UiColorWidget : IDataWindowWidget
adjacentRow.HasValue)
DrawEdgePreview(id, row.ClearBlue, adjacentRow.Value.ClearBlue);
ImGui.PopID();
ImGui.TableNextColumn();
ImGui.AlignTextToFramePadding();
ImGui.PushID($"row{id}_white");
if (this.DrawColorColumn(row.Unknown0) &&
adjacentRow.HasValue)
DrawEdgePreview(id, row.Unknown0, adjacentRow.Value.Unknown0);
ImGui.PopID();
ImGui.TableNextColumn();
ImGui.AlignTextToFramePadding();
ImGui.PushID($"row{id}_green");
if (this.DrawColorColumn(row.Unknown1) &&
adjacentRow.HasValue)
DrawEdgePreview(id, row.Unknown1, adjacentRow.Value.Unknown1);
ImGui.PopID();
}
}

View file

@ -26,8 +26,8 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
internal class UldWidget : IDataWindowWidget
{
// ULD styles can be hardcoded for now as they don't add new ones regularly. Can later try and find where to load these from in the game EXE.
private static readonly string[] ThemeDisplayNames = ["Dark", "Light", "Classic FF", "Clear Blue"];
private static readonly string[] ThemeBasePaths = ["ui/uld/", "ui/uld/img01/", "ui/uld/img02/", "ui/uld/img03/"];
private static readonly string[] ThemeDisplayNames = ["Dark", "Light", "Classic FF", "Clear Blue", "Clear White", "Clear Green"];
private const string UldBaseBath = "ui/uld/";
// 48 8D 15 ?? ?? ?? ?? is the part of the signatures that contain the string location offset
// 48 = 64 bit register prefix
@ -263,7 +263,7 @@ internal class UldWidget : IDataWindowWidget
}
private string ToThemedPath(string path) =>
ThemeBasePaths[this.selectedTheme] + path[ThemeBasePaths[0].Length..];
UldBaseBath + (this.selectedTheme > 0 ? $"img{this.selectedTheme:D2}" : "") + path[UldBaseBath.Length..];
private void DrawTextureEntry(UldRoot.TextureEntry textureEntry, TextureManager textureManager)
{

View file

@ -127,8 +127,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputText(label, t.Buffer[..(maxLength + 1)], flags, callback);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -140,8 +145,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputText(label, t.Buffer[..(maxLength + 1)], flags, callback);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -153,8 +163,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputText(label, t.Buffer[..(maxLength + 1)], flags, callback, ref context);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -166,8 +181,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputText(label, t.Buffer[..(maxLength + 1)], flags, callback, in context);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -287,8 +307,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputTextEx(label, hint, t.Buffer[..(maxLength + 1)], sizeArg, flags, callback);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -300,8 +325,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputTextEx(label, hint, t.Buffer[..(maxLength + 1)], sizeArg, flags, callback);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -314,8 +344,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputTextEx(label, hint, t.Buffer[..(maxLength + 1)], sizeArg, flags, callback, ref context);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -328,8 +363,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputTextEx(label, hint, t.Buffer[..(maxLength + 1)], sizeArg, flags, callback, in context);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -388,8 +428,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputTextMultiline(label, t.Buffer[..(maxLength + 1)], size, flags, callback);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -401,8 +446,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputTextMultiline(label, t.Buffer[..(maxLength + 1)], size, flags, callback);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -414,8 +464,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputTextMultiline(label, t.Buffer[..(maxLength + 1)], size, flags, callback, ref context);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -427,8 +482,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputTextMultiline(label, t.Buffer[..(maxLength + 1)], size, flags, callback, in context);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -477,8 +537,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputTextWithHint(label, hint, t.Buffer[..(maxLength + 1)], flags, callback);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -490,8 +555,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputTextWithHint(label, hint, t.Buffer[..(maxLength + 1)], flags, callback);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -503,8 +573,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputTextWithHint(label, hint, t.Buffer[..(maxLength + 1)], flags, callback, ref context);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -516,8 +591,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = InputTextWithHint(label, hint, t.Buffer[..(maxLength + 1)], flags, callback, in context);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}
@ -541,8 +621,13 @@ public unsafe partial class ImGui
var t = new ImU8String(buf);
t.Reserve(maxLength + 1);
var r = TempInputText(bb, id, label, t.Buffer[..(maxLength + 1)], flags);
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
if (r)
{
var i = t.Buffer.IndexOf((byte)0);
buf = Encoding.UTF8.GetString(i == -1 ? t.Buffer : t.Buffer[..i]);
}
t.Recycle();
return r;
}

@ -1 +1 @@
Subproject commit f60c282d63b4157a8f8fb7cbb7e0b35361cdaa12
Subproject commit faf803a76813511768d45c137a543aaacf5420b8

@ -1 +1 @@
Subproject commit d8d0b53e27393f509ac5397511cb8d251d562277
Subproject commit 7d3f90e61732df6aef63196d1abaab1074f6f3c9