restructure

This commit is contained in:
Soreepeong 2025-07-26 22:33:38 +09:00
parent 3381ac1c7d
commit b53a97408b
263 changed files with 2221 additions and 1191 deletions

View file

@ -205,8 +205,8 @@ public sealed class SingleFontChooserDialog : IDisposable
/// <summary>Gets or sets a value indicating whether this popup should be modal, blocking everything behind from /// <summary>Gets or sets a value indicating whether this popup should be modal, blocking everything behind from
/// being interacted.</summary> /// being interacted.</summary>
/// <remarks>If <c>true</c>, then <see cref="ImGui.BeginPopupModal(string, ref bool, ImGuiWindowFlags)"/> will be /// <remarks>If <c>true</c>, then <see cref="ImGui.BeginPopupModal(ImU8String, ref bool, ImGuiWindowFlags)"/> will be
/// used. Otherwise, <see cref="ImGui.Begin(string, ref bool, ImGuiWindowFlags)"/> will be used.</remarks> /// used. Otherwise, <see cref="ImGui.Begin(ImU8String, ref bool, ImGuiWindowFlags)"/> will be used.</remarks>
public bool IsModal { get; set; } = true; public bool IsModal { get; set; } = true;
/// <summary>Gets or sets the window flags.</summary> /// <summary>Gets or sets the window flags.</summary>
@ -558,21 +558,10 @@ public sealed class SingleFontChooserDialog : IDisposable
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X); ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X);
using (this.fontHandle?.Push()) using (this.fontHandle?.Push())
{ {
unsafe ImGui.InputTextMultiline(
{ "##fontPreviewText"u8,
fixed (byte* buf = this.fontPreviewText) this.fontPreviewText,
fixed (byte* label = "##fontPreviewText"u8) ImGui.GetContentRegionAvail());
{
ImGui.InputTextMultiline(
label,
buf,
(uint)this.fontPreviewText.Length,
ImGui.GetContentRegionAvail(),
ImGuiInputTextFlags.None,
null,
null);
}
}
} }
} }
} }
@ -608,15 +597,15 @@ public sealed class SingleFontChooserDialog : IDisposable
ref this.familySearch, ref this.familySearch,
255, 255,
ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory, ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory,
data => (ref ImGuiInputTextCallbackData data) =>
{ {
if (families.Count == 0) if (families.Count == 0)
return 0; return 0;
var baseIndex = this.selectedFamilyIndex; var baseIndex = this.selectedFamilyIndex;
if (data->SelectionStart == 0 && data->SelectionEnd == data->BufTextLen) if (data.SelectionStart == 0 && data.SelectionEnd == data.BufTextLen)
{ {
switch (data->EventKey) switch (data.EventKey)
{ {
case ImGuiKey.DownArrow: case ImGuiKey.DownArrow:
this.selectedFamilyIndex = (this.selectedFamilyIndex + 1) % families.Count; this.selectedFamilyIndex = (this.selectedFamilyIndex + 1) % families.Count;
@ -632,13 +621,13 @@ public sealed class SingleFontChooserDialog : IDisposable
if (changed) if (changed)
{ {
ImGuiHelpers.SetTextFromCallback( ImGuiHelpers.SetTextFromCallback(
data, ref data,
this.ExtractName(families[this.selectedFamilyIndex])); this.ExtractName(families[this.selectedFamilyIndex]));
} }
} }
else else
{ {
switch (data->EventKey) switch (data.EventKey)
{ {
case ImGuiKey.DownArrow: case ImGuiKey.DownArrow:
this.selectedFamilyIndex = families.FindIndex( this.selectedFamilyIndex = families.FindIndex(
@ -776,15 +765,15 @@ public sealed class SingleFontChooserDialog : IDisposable
ref this.fontSearch, ref this.fontSearch,
255, 255,
ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory, ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory,
data => (ref ImGuiInputTextCallbackData data) =>
{ {
if (fonts.Count == 0) if (fonts.Count == 0)
return 0; return 0;
var baseIndex = this.selectedFontIndex; var baseIndex = this.selectedFontIndex;
if (data->SelectionStart == 0 && data->SelectionEnd == data->BufTextLen) if (data.SelectionStart == 0 && data.SelectionEnd == data.BufTextLen)
{ {
switch (data->EventKey) switch (data.EventKey)
{ {
case ImGuiKey.DownArrow: case ImGuiKey.DownArrow:
this.selectedFontIndex = (this.selectedFontIndex + 1) % fonts.Count; this.selectedFontIndex = (this.selectedFontIndex + 1) % fonts.Count;
@ -799,13 +788,13 @@ public sealed class SingleFontChooserDialog : IDisposable
if (changed) if (changed)
{ {
ImGuiHelpers.SetTextFromCallback( ImGuiHelpers.SetTextFromCallback(
data, ref data,
this.ExtractName(fonts[this.selectedFontIndex])); this.ExtractName(fonts[this.selectedFontIndex]));
} }
} }
else else
{ {
switch (data->EventKey) switch (data.EventKey)
{ {
case ImGuiKey.DownArrow: case ImGuiKey.DownArrow:
this.selectedFontIndex = fonts.FindIndex( this.selectedFontIndex = fonts.FindIndex(
@ -925,9 +914,9 @@ public sealed class SingleFontChooserDialog : IDisposable
255, 255,
ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory | ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory |
ImGuiInputTextFlags.CharsDecimal, ImGuiInputTextFlags.CharsDecimal,
data => (ref ImGuiInputTextCallbackData data) =>
{ {
switch (data->EventKey) switch (data.EventKey)
{ {
case ImGuiKey.DownArrow: case ImGuiKey.DownArrow:
this.selectedFont = this.selectedFont with this.selectedFont = this.selectedFont with
@ -946,7 +935,7 @@ public sealed class SingleFontChooserDialog : IDisposable
} }
if (changed) if (changed)
ImGuiHelpers.SetTextFromCallback(data, $"{this.selectedFont.SizePt:0.##}"); ImGuiHelpers.SetTextFromCallback(ref data, $"{this.selectedFont.SizePt:0.##}");
return 0; return 0;
})) }))
@ -1129,19 +1118,19 @@ public sealed class SingleFontChooserDialog : IDisposable
255, 255,
ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory | ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory |
ImGuiInputTextFlags.CharsDecimal, ImGuiInputTextFlags.CharsDecimal,
data => (ref ImGuiInputTextCallbackData data) =>
{ {
switch (data->EventKey) switch (data.EventKey)
{ {
case ImGuiKey.DownArrow: case ImGuiKey.DownArrow:
changed2 = true; changed2 = true;
value = Math.Min(max, (MathF.Round(value / step) * step) + step); value = Math.Min(max, (MathF.Round(value / step) * step) + step);
ImGuiHelpers.SetTextFromCallback(data, $"{value:0.##}"); ImGuiHelpers.SetTextFromCallback(ref data, $"{value:0.##}");
break; break;
case ImGuiKey.UpArrow: case ImGuiKey.UpArrow:
changed2 = true; changed2 = true;
value = Math.Max(min, (MathF.Round(value / step) * step) - step); value = Math.Max(min, (MathF.Round(value / step) * step) - step);
ImGuiHelpers.SetTextFromCallback(data, $"{value:0.##}"); ImGuiHelpers.SetTextFromCallback(ref data, $"{value:0.##}");
break; break;
} }

View file

@ -218,7 +218,7 @@ internal sealed partial class ActiveNotification
/// <summary>Calculates the effective expiry, taking ImGui window state into account.</summary> /// <summary>Calculates the effective expiry, taking ImGui window state into account.</summary>
/// <param name="warrantsExtension">Notification will not dismiss while this paramter is <c>true</c>.</param> /// <param name="warrantsExtension">Notification will not dismiss while this paramter is <c>true</c>.</param>
/// <returns>The calculated effective expiry.</returns> /// <returns>The calculated effective expiry.</returns>
/// <remarks>Expected to be called BETWEEN <see cref="ImGui.Begin(string)"/> and <see cref="ImGui.End()"/>.</remarks> /// <remarks>Expected to be called BETWEEN <see cref="ImGui.Begin(ImU8String, ImGuiWindowFlags)"/> and <see cref="ImGui.End()"/>.</remarks>
private DateTime CalculateEffectiveExpiry(ref bool warrantsExtension) private DateTime CalculateEffectiveExpiry(ref bool warrantsExtension)
{ {
DateTime expiry; DateTime expiry;

View file

@ -211,7 +211,7 @@ internal unsafe class UiDebug
ImGui.SameLine(); ImGui.SameLine();
Service<SeStringRenderer>.Get().Draw(textNode->NodeText); Service<SeStringRenderer>.Get().Draw(textNode->NodeText);
ImGui.InputText($"Replace Text##{(ulong)textNode:X}", textNode->NodeText.StringPtr, (uint)textNode->NodeText.BufSize); ImGui.InputText($"Replace Text##{(ulong)textNode:X}", new(textNode->NodeText.StringPtr, (int)textNode->NodeText.BufSize));
ImGui.SameLine(); ImGui.SameLine();
if (ImGui.Button($"Encode##{(ulong)textNode:X}")) if (ImGui.Button($"Encode##{(ulong)textNode:X}"))

View file

@ -321,7 +321,7 @@ internal unsafe partial class TextNodeTree
ImGui.Text("Font:"); ImGui.Text("Font:");
ImGui.TableNextColumn(); ImGui.TableNextColumn();
ImGui.SetNextItemWidth(150); ImGui.SetNextItemWidth(150);
if (ImGui.Combo($"##{(nint)this.Node:X}fontType", ref fontIndex, FontNames, FontList.Count)) if (ImGui.Combo($"##{(nint)this.Node:X}fontType", ref fontIndex, FontNames))
{ {
this.TxtNode->FontType = FontList[fontIndex]; this.TxtNode->FontType = FontList[fontIndex];
} }

View file

@ -68,7 +68,7 @@ public class BranchSwitcherWindow : Window
var si = Service<Dalamud>.Get().StartInfo; var si = Service<Dalamud>.Get().StartInfo;
var itemsArray = this.branches.Select(x => x.Key).ToArray(); var itemsArray = this.branches.Select(x => x.Key).ToArray();
ImGui.ListBox("Branch", ref this.selectedBranchIndex, itemsArray, itemsArray.Length); ImGui.ListBox("Branch", ref this.selectedBranchIndex, itemsArray);
var pickedBranch = this.branches.ElementAt(this.selectedBranchIndex); var pickedBranch = this.branches.ElementAt(this.selectedBranchIndex);

View file

@ -835,11 +835,9 @@ internal class ConsoleWindow : Window, IDisposable
} }
} }
private unsafe int CommandInputCallback(ImGuiInputTextCallbackData* data) private int CommandInputCallback(ref ImGuiInputTextCallbackData data)
{ {
var ptr = new ImGuiInputTextCallbackDataPtr(data); switch (data.EventFlag)
switch (data->EventFlag)
{ {
case ImGuiInputTextFlags.CallbackEdit: case ImGuiInputTextFlags.CallbackEdit:
this.completionZipText = null; this.completionZipText = null;
@ -847,9 +845,7 @@ internal class ConsoleWindow : Window, IDisposable
break; break;
case ImGuiInputTextFlags.CallbackCompletion: case ImGuiInputTextFlags.CallbackCompletion:
var textBytes = new byte[data->BufTextLen]; var text = Encoding.UTF8.GetString(data.BufTextSpan);
Marshal.Copy((IntPtr)data->Buf, textBytes, 0, data->BufTextLen);
var text = Encoding.UTF8.GetString(textBytes);
var words = text.Split(); var words = text.Split();
@ -894,8 +890,8 @@ internal class ConsoleWindow : Window, IDisposable
if (toComplete != null) if (toComplete != null)
{ {
ptr.DeleteChars(0, ptr.BufTextLen); data.DeleteChars(0, data.BufTextLen);
ptr.InsertChars(0, toComplete); data.InsertChars(0, toComplete);
} }
} }
@ -904,14 +900,14 @@ internal class ConsoleWindow : Window, IDisposable
case ImGuiInputTextFlags.CallbackHistory: case ImGuiInputTextFlags.CallbackHistory:
var prevPos = this.historyPos; var prevPos = this.historyPos;
if (ptr.EventKey == ImGuiKey.UpArrow) if (data.EventKey == ImGuiKey.UpArrow)
{ {
if (this.historyPos == -1) if (this.historyPos == -1)
this.historyPos = this.configuration.LogCommandHistory.Count - 1; this.historyPos = this.configuration.LogCommandHistory.Count - 1;
else if (this.historyPos > 0) else if (this.historyPos > 0)
this.historyPos--; this.historyPos--;
} }
else if (data->EventKey == ImGuiKey.DownArrow) else if (data.EventKey == ImGuiKey.DownArrow)
{ {
if (this.historyPos != -1) if (this.historyPos != -1)
{ {
@ -926,8 +922,8 @@ internal class ConsoleWindow : Window, IDisposable
{ {
var historyStr = this.historyPos >= 0 ? this.configuration.LogCommandHistory[this.historyPos] : string.Empty; var historyStr = this.historyPos >= 0 ? this.configuration.LogCommandHistory[this.historyPos] : string.Empty;
ptr.DeleteChars(0, ptr.BufTextLen); data.DeleteChars(0, data.BufTextLen);
ptr.InsertChars(0, historyStr); data.InsertChars(0, historyStr);
} }
break; break;

View file

@ -120,23 +120,13 @@ internal class DataShareWidget : IDataWindowWidget
ImGui.SameLine(); ImGui.SameLine();
if (ImGui.Button("Copy")) if (ImGui.Button("Copy"))
{ ImGui.SetClipboardText(data);
fixed (byte* pData = data)
ImGui.SetClipboardText(pData);
}
fixed (byte* pLabel = "text"u8) ImGui.InputTextMultiline(
fixed (byte* pData = data) "text"u8,
{ data,
ImGui.InputTextMultiline( ImGui.GetContentRegionAvail(),
pLabel, ImGuiInputTextFlags.ReadOnly);
pData,
(uint)data.Length,
ImGui.GetContentRegionAvail(),
ImGuiInputTextFlags.ReadOnly,
null,
null);
}
} }
this.nextTab = -1; this.nextTab = -1;

View file

@ -69,7 +69,7 @@ internal class FontAwesomeTestWidget : IDataWindowWidget
ImGui.SetNextItemWidth(160f); ImGui.SetNextItemWidth(160f);
var categoryIndex = this.selectedIconCategory; var categoryIndex = this.selectedIconCategory;
if (ImGui.Combo("####FontAwesomeCategorySearch", ref categoryIndex, this.iconCategories, this.iconCategories.Length)) if (ImGui.Combo("####FontAwesomeCategorySearch", ref categoryIndex, this.iconCategories))
{ {
this.selectedIconCategory = categoryIndex; this.selectedIconCategory = categoryIndex;
this.iconSearchChanged = true; this.iconSearchChanged = true;

View file

@ -61,7 +61,7 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable
public unsafe void Draw() public unsafe void Draw()
{ {
ImGui.AlignTextToFramePadding(); ImGui.AlignTextToFramePadding();
if (ImGui.Combo("Global Scale per Font"u8, ref this.fontScaleMode, FontScaleModes, FontScaleModes.Length)) if (ImGui.Combo("Global Scale per Font"u8, ref this.fontScaleMode, FontScaleModes))
this.ClearAtlas(); this.ClearAtlas();
if (ImGui.Checkbox("Global Scale for Atlas"u8, ref this.atlasScaleMode)) if (ImGui.Checkbox("Global Scale for Atlas"u8, ref this.atlasScaleMode))
this.ClearAtlas(); this.ClearAtlas();
@ -182,12 +182,8 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable
{ {
if (ImGui.InputTextMultiline( if (ImGui.InputTextMultiline(
labelPtr, labelPtr,
this.testStringBuffer.Data, this.testStringBuffer.StorageSpan,
(uint)this.testStringBuffer.Capacity, new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3)))
new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3),
0,
null,
null))
{ {
var len = this.testStringBuffer.StorageSpan.IndexOf((byte)0); var len = this.testStringBuffer.StorageSpan.IndexOf((byte)0);
if (len + 4 >= this.testStringBuffer.Capacity) if (len + 4 >= this.testStringBuffer.Capacity)

View file

@ -73,17 +73,9 @@ internal class ImGuiWidget : IDataWindowWidget
ImGui.Checkbox("##manualType", ref this.notificationTemplate.ManualType); ImGui.Checkbox("##manualType", ref this.notificationTemplate.ManualType);
ImGui.SameLine(); ImGui.SameLine();
ImGui.Combo( ImGui.Combo("Type##type", ref this.notificationTemplate.TypeInt, NotificationTemplate.TypeTitles);
"Type##type",
ref this.notificationTemplate.TypeInt,
NotificationTemplate.TypeTitles,
NotificationTemplate.TypeTitles.Length);
ImGui.Combo( ImGui.Combo("Icon##iconCombo", ref this.notificationTemplate.IconInt, NotificationTemplate.IconTitles);
"Icon##iconCombo",
ref this.notificationTemplate.IconInt,
NotificationTemplate.IconTitles,
NotificationTemplate.IconTitles.Length);
switch (this.notificationTemplate.IconInt) switch (this.notificationTemplate.IconInt)
{ {
case 1 or 2: case 1 or 2:
@ -96,8 +88,7 @@ internal class ImGuiWidget : IDataWindowWidget
ImGui.Combo( ImGui.Combo(
"Asset##iconAssetCombo", "Asset##iconAssetCombo",
ref this.notificationTemplate.IconAssetInt, ref this.notificationTemplate.IconAssetInt,
NotificationTemplate.AssetSources, NotificationTemplate.AssetSources);
NotificationTemplate.AssetSources.Length);
break; break;
case 3 or 7: case 3 or 7:
ImGui.InputText( ImGui.InputText(
@ -116,20 +107,17 @@ internal class ImGuiWidget : IDataWindowWidget
ImGui.Combo( ImGui.Combo(
"Initial Duration", "Initial Duration",
ref this.notificationTemplate.InitialDurationInt, ref this.notificationTemplate.InitialDurationInt,
NotificationTemplate.InitialDurationTitles, NotificationTemplate.InitialDurationTitles);
NotificationTemplate.InitialDurationTitles.Length);
ImGui.Combo( ImGui.Combo(
"Extension Duration", "Extension Duration",
ref this.notificationTemplate.HoverExtendDurationInt, ref this.notificationTemplate.HoverExtendDurationInt,
NotificationTemplate.HoverExtendDurationTitles, NotificationTemplate.HoverExtendDurationTitles);
NotificationTemplate.HoverExtendDurationTitles.Length);
ImGui.Combo( ImGui.Combo(
"Progress", "Progress",
ref this.notificationTemplate.ProgressMode, ref this.notificationTemplate.ProgressMode,
NotificationTemplate.ProgressModeTitles, NotificationTemplate.ProgressModeTitles);
NotificationTemplate.ProgressModeTitles.Length);
ImGui.Checkbox("Respect UI Hidden", ref this.notificationTemplate.RespectUiHidden); ImGui.Checkbox("Respect UI Hidden", ref this.notificationTemplate.RespectUiHidden);

View file

@ -89,7 +89,7 @@ internal class NounProcessorWidget : IDataWindowWidget
var language = this.languages[this.selectedLanguageIndex]; var language = this.languages[this.selectedLanguageIndex];
ImGui.SetNextItemWidth(300); ImGui.SetNextItemWidth(300);
if (ImGui.Combo("###SelectedSheetName", ref this.selectedSheetNameIndex, NounSheets.Select(t => t.Name).ToArray(), NounSheets.Length)) if (ImGui.Combo("###SelectedSheetName", ref this.selectedSheetNameIndex, NounSheets.Select(t => t.Name).ToArray()))
{ {
this.rowId = 1; this.rowId = 1;
} }
@ -97,7 +97,7 @@ internal class NounProcessorWidget : IDataWindowWidget
ImGui.SameLine(); ImGui.SameLine();
ImGui.SetNextItemWidth(120); ImGui.SetNextItemWidth(120);
if (ImGui.Combo("###SelectedLanguage", ref this.selectedLanguageIndex, this.languageNames, this.languageNames.Length)) if (ImGui.Combo("###SelectedLanguage", ref this.selectedLanguageIndex, this.languageNames))
{ {
language = this.languages[this.selectedLanguageIndex]; language = this.languages[this.selectedLanguageIndex];
this.rowId = 1; this.rowId = 1;

View file

@ -568,7 +568,7 @@ internal class SeStringCreatorWidget : IDataWindowWidget
} }
}).OrderBy(sheetName => sheetName, StringComparer.InvariantCulture).ToArray(); }).OrderBy(sheetName => sheetName, StringComparer.InvariantCulture).ToArray();
var sheetChanged = ImGui.Combo("Sheet Name", ref this.importSelectedSheetName, this.validImportSheetNames, this.validImportSheetNames.Length); var sheetChanged = ImGui.Combo("Sheet Name", ref this.importSelectedSheetName, this.validImportSheetNames);
try try
{ {
@ -683,7 +683,7 @@ internal class SeStringCreatorWidget : IDataWindowWidget
ImGui.TableNextColumn(); // Type ImGui.TableNextColumn(); // Type
var type = (int)entry.Type; var type = (int)entry.Type;
ImGui.SetNextItemWidth(-1); ImGui.SetNextItemWidth(-1);
if (ImGui.Combo($"##Type{i}", ref type, ["String", "Macro", "Fixed"], 3)) if (ImGui.Combo($"##Type{i}", ref type, ["String", "Macro", "Fixed"]))
{ {
entry.Type = (TextEntryType)type; entry.Type = (TextEntryType)type;
updateString |= true; updateString |= true;

View file

@ -115,7 +115,7 @@ internal unsafe class SeStringRendererTestWidget : IDataWindowWidget
ImGui.SameLine(); ImGui.SameLine();
var t4 = this.style.ThemeIndex ?? AtkStage.Instance()->AtkUIColorHolder->ActiveColorThemeType; var t4 = this.style.ThemeIndex ?? AtkStage.Instance()->AtkUIColorHolder->ActiveColorThemeType;
ImGui.PushItemWidth(ImGui.CalcTextSize("WWWWWWWWWWWWWW").X); ImGui.PushItemWidth(ImGui.CalcTextSize("WWWWWWWWWWWWWW").X);
if (ImGui.Combo("##theme", ref t4, ThemeNames, ThemeNames.Length)) if (ImGui.Combo("##theme", ref t4, ThemeNames))
this.style.ThemeIndex = t4; this.style.ThemeIndex = t4;
ImGui.SameLine(); ImGui.SameLine();
@ -265,12 +265,8 @@ internal unsafe class SeStringRendererTestWidget : IDataWindowWidget
{ {
if (ImGui.InputTextMultiline( if (ImGui.InputTextMultiline(
labelPtr, labelPtr,
this.testStringBuffer.Data, this.testStringBuffer.StorageSpan,
(uint)this.testStringBuffer.Capacity, new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3)))
new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3),
0,
null,
null))
{ {
var len = this.testStringBuffer.StorageSpan.IndexOf((byte)0); var len = this.testStringBuffer.StorageSpan.IndexOf((byte)0);
if (len + 4 >= this.testStringBuffer.Capacity) if (len + 4 >= this.testStringBuffer.Capacity)
@ -278,7 +274,7 @@ internal unsafe class SeStringRendererTestWidget : IDataWindowWidget
if (len < this.testStringBuffer.Capacity) if (len < this.testStringBuffer.Capacity)
{ {
this.testStringBuffer.LengthUnsafe = len; this.testStringBuffer.LengthUnsafe = len;
this.testStringBuffer.StorageSpan[len] = default; this.testStringBuffer.StorageSpan[len] = 0;
} }
this.testString = string.Empty; this.testString = string.Empty;

View file

@ -243,8 +243,8 @@ internal class TaskSchedulerWidget : IDataWindowWidget
if (ImGui.CollapsingHeader("Download")) if (ImGui.CollapsingHeader("Download"))
{ {
ImGui.InputText("URL", ref this.url, (uint)this.url.Length); ImGui.InputText("URL", ref this.url);
ImGui.InputText("Local Path", ref this.localPath, (uint)this.localPath.Length); ImGui.InputText("Local Path", ref this.localPath);
ImGui.SameLine(); ImGui.SameLine();
if (ImGuiComponents.IconButton("##localpathpicker", FontAwesomeIcon.File)) if (ImGuiComponents.IconButton("##localpathpicker", FontAwesomeIcon.File))

View file

@ -709,8 +709,7 @@ internal class TexWidget : IDataWindowWidget
if (ImGui.Combo( if (ImGui.Combo(
"Assembly", "Assembly",
ref this.inputManifestResourceAssemblyIndex, ref this.inputManifestResourceAssemblyIndex,
this.inputManifestResourceAssemblyCandidateNames, this.inputManifestResourceAssemblyCandidateNames))
this.inputManifestResourceAssemblyCandidateNames.Length))
{ {
this.inputManifestResourceNameIndex = 0; this.inputManifestResourceNameIndex = 0;
this.inputManifestResourceNameCandidates = null; this.inputManifestResourceNameCandidates = null;
@ -727,8 +726,7 @@ internal class TexWidget : IDataWindowWidget
ImGui.Combo( ImGui.Combo(
"Name", "Name",
ref this.inputManifestResourceNameIndex, ref this.inputManifestResourceNameIndex,
this.inputManifestResourceNameCandidates, this.inputManifestResourceNameCandidates);
this.inputManifestResourceNameCandidates.Length);
var name = var name =
this.inputManifestResourceNameIndex >= 0 this.inputManifestResourceNameIndex >= 0
@ -844,8 +842,7 @@ internal class TexWidget : IDataWindowWidget
ImGui.Combo( ImGui.Combo(
nameof(this.textureModificationArgs.DxgiFormat), nameof(this.textureModificationArgs.DxgiFormat),
ref this.renderTargetChoiceInt, ref this.renderTargetChoiceInt,
this.supportedRenderTargetFormatNames, this.supportedRenderTargetFormatNames);
this.supportedRenderTargetFormatNames.Length);
Span<int> wh = stackalloc int[2]; Span<int> wh = stackalloc int[2];
wh[0] = this.textureModificationArgs.NewWidth; wh[0] = this.textureModificationArgs.NewWidth;

View file

@ -41,9 +41,9 @@ internal class ToastWidget : IDataWindowWidget
ImGui.InputText("Toast text", ref this.inputTextToast, 200); ImGui.InputText("Toast text", ref this.inputTextToast, 200);
ImGui.Combo("Toast Position", ref this.toastPosition, new[] { "Bottom", "Top", }, 2); ImGui.Combo("Toast Position", ref this.toastPosition, ["Bottom", "Top"]);
ImGui.Combo("Toast Speed", ref this.toastSpeed, new[] { "Slow", "Fast", }, 2); ImGui.Combo("Toast Speed", ref this.toastSpeed, ["Slow", "Fast"]);
ImGui.Combo("Quest Toast Position", ref this.questToastPosition, new[] { "Centre", "Right", "Left" }, 3); ImGui.Combo("Quest Toast Position", ref this.questToastPosition, ["Centre", "Right", "Left"]);
ImGui.Checkbox("Quest Checkmark", ref this.questToastCheckmark); ImGui.Checkbox("Quest Checkmark", ref this.questToastCheckmark);
ImGui.Checkbox("Quest Play Sound", ref this.questToastSound); ImGui.Checkbox("Quest Play Sound", ref this.questToastSound);
ImGui.InputInt("Quest Icon ID", ref this.questToastIconId); ImGui.InputInt("Quest Icon ID", ref this.questToastIconId);

View file

@ -101,7 +101,7 @@ internal class UldWidget : IDataWindowWidget
} }
var selectedUldPrev = this.selectedUld; var selectedUldPrev = this.selectedUld;
ImGui.Combo("##selectUld", ref this.selectedUld, uldNames, uldNames.Length); ImGui.Combo("##selectUld", ref this.selectedUld, uldNames);
ImGui.SameLine(); ImGui.SameLine();
if (ImGuiComponents.IconButton("selectUldLeft", FontAwesomeIcon.AngleLeft)) if (ImGuiComponents.IconButton("selectUldLeft", FontAwesomeIcon.AngleLeft))
this.selectedUld = ((this.selectedUld + uldNames.Length) - 1) % uldNames.Length; this.selectedUld = ((this.selectedUld + uldNames.Length) - 1) % uldNames.Length;
@ -117,7 +117,7 @@ internal class UldWidget : IDataWindowWidget
ClearTask(ref this.selectedUldFileTask); ClearTask(ref this.selectedUldFileTask);
} }
ImGui.Combo("##selectTheme", ref this.selectedTheme, ThemeDisplayNames, ThemeDisplayNames.Length); ImGui.Combo("##selectTheme", ref this.selectedTheme, ThemeDisplayNames);
ImGui.SameLine(); ImGui.SameLine();
if (ImGuiComponents.IconButton("selectThemeLeft", FontAwesomeIcon.AngleLeft)) if (ImGuiComponents.IconButton("selectThemeLeft", FontAwesomeIcon.AngleLeft))
this.selectedTheme = ((this.selectedTheme + ThemeDisplayNames.Length) - 1) % ThemeDisplayNames.Length; this.selectedTheme = ((this.selectedTheme + ThemeDisplayNames.Length) - 1) % ThemeDisplayNames.Length;

View file

@ -70,7 +70,7 @@ public sealed class LanguageChooserSettingsEntry : SettingsEntry
public override void Draw() public override void Draw()
{ {
ImGui.Text(this.Name); ImGui.Text(this.Name);
ImGui.Combo("##XlLangCombo", ref this.langIndex, this.locLanguages, this.locLanguages.Length); ImGui.Combo("##XlLangCombo", ref this.langIndex, this.locLanguages);
ImGuiHelpers.SafeTextColoredWrapped(ImGuiColors.DalamudGrey, Loc.Localize("DalamudSettingsLanguageHint", "Select the language Dalamud will be displayed in.")); ImGuiHelpers.SafeTextColoredWrapped(ImGuiColors.DalamudGrey, Loc.Localize("DalamudSettingsLanguageHint", "Select the language Dalamud will be displayed in."));
} }
} }

View file

@ -84,7 +84,7 @@ public class StyleEditorWindow : Window
var styleAry = config.SavedStyles.Select(x => x.Name).ToArray(); var styleAry = config.SavedStyles.Select(x => x.Name).ToArray();
ImGui.Text(Loc.Localize("StyleEditorChooseStyle", "Choose Style:")); ImGui.Text(Loc.Localize("StyleEditorChooseStyle", "Choose Style:"));
if (ImGui.Combo("###styleChooserCombo", ref this.currentSel, styleAry, styleAry.Length)) if (ImGui.Combo("###styleChooserCombo", ref this.currentSel, styleAry))
{ {
var newStyle = config.SavedStyles[this.currentSel]; var newStyle = config.SavedStyles[this.currentSel];
newStyle.Apply(); newStyle.Apply();
@ -245,7 +245,7 @@ public class StyleEditorWindow : Window
ImGui.Text("Alignment"); ImGui.Text("Alignment");
ImGui.SliderFloat2("WindowTitleAlign", ref style.WindowTitleAlign, 0.0f, 1.0f, "%.2f"); ImGui.SliderFloat2("WindowTitleAlign", ref style.WindowTitleAlign, 0.0f, 1.0f, "%.2f");
var windowMenuButtonPosition = (int)style.WindowMenuButtonPosition + 1; var windowMenuButtonPosition = (int)style.WindowMenuButtonPosition + 1;
if (ImGui.Combo("WindowMenuButtonPosition", ref windowMenuButtonPosition, "None\0Left\0Right\0")) if (ImGui.Combo("WindowMenuButtonPosition", ref windowMenuButtonPosition, ["None", "Left", "Right"]))
style.WindowMenuButtonPosition = (ImGuiDir)(windowMenuButtonPosition - 1); style.WindowMenuButtonPosition = (ImGuiDir)(windowMenuButtonPosition - 1);
ImGui.SliderFloat2("ButtonTextAlign", ref style.ButtonTextAlign, 0.0f, 1.0f, "%.2f"); ImGui.SliderFloat2("ButtonTextAlign", ref style.ButtonTextAlign, 0.0f, 1.0f, "%.2f");
ImGui.SameLine(); ImGui.SameLine();

View file

@ -54,7 +54,7 @@ public interface IDrawListTextureWrap : IDalamudTextureWrap
/// <summary>Resizes this texture and draws an ImGui window.</summary> /// <summary>Resizes this texture and draws an ImGui window.</summary>
/// <param name="windowName">Name and ID of the window to draw. Use the value that goes into /// <param name="windowName">Name and ID of the window to draw. Use the value that goes into
/// <see cref="ImGui.Begin(string)"/>.</param> /// <see cref="ImGui.Begin(ImU8String, ImGuiWindowFlags)"/>.</param>
/// <param name="scale">Scale to apply to all draw commands in the draw list.</param> /// <param name="scale">Scale to apply to all draw commands in the draw list.</param>
void ResizeAndDrawWindow(ReadOnlySpan<char> windowName, Vector2 scale); void ResizeAndDrawWindow(ReadOnlySpan<char> windowName, Vector2 scale);
} }

View file

@ -666,16 +666,13 @@ public static partial class ImGuiHelpers
/// </summary> /// </summary>
/// <param name="data">The callback data.</param> /// <param name="data">The callback data.</param>
/// <param name="s">The new text.</param> /// <param name="s">The new text.</param>
internal static unsafe void SetTextFromCallback(ImGuiInputTextCallbackData* data, string s) internal static void SetTextFromCallback(ref ImGuiInputTextCallbackData data, ImU8String s)
{ {
if (data->BufTextLen != 0) if (data.BufTextLen != 0)
data->DeleteChars(0, data->BufTextLen); data.DeleteChars(0, data.BufTextLen);
var len = Encoding.UTF8.GetByteCount(s); data.InsertChars(0, s);
var buf = len < 1024 ? stackalloc byte[len] : new byte[len]; data.SelectAll();
Encoding.UTF8.GetBytes(s, buf);
data->InsertChars(0, buf);
data->SelectAll();
} }
/// <summary> /// <summary>

View file

@ -8953,6 +8953,7 @@ public unsafe partial class ImGui
// DISCARDED: internal static uint GetIDNative(byte* strIdBegin, byte* strIdEnd) // DISCARDED: internal static uint GetIDNative(byte* strIdBegin, byte* strIdEnd)
// DISCARDED: internal static uint GetIDNative(void* ptrId) // DISCARDED: internal static uint GetIDNative(void* ptrId)
// DISCARDED: internal static int* GetIntRefNative(ImGuiStorage* self, uint key, int defaultVal) // DISCARDED: internal static int* GetIntRefNative(ImGuiStorage* self, uint key, int defaultVal)
// DISCARDED: internal static void** GetVoidPtrRefNative(ImGuiStorage* self, uint key, void* defaultVal)
// DISCARDED: internal static ImGuiTextFilter* ImGuiTextFilterNative(byte* defaultFilter) // DISCARDED: internal static ImGuiTextFilter* ImGuiTextFilterNative(byte* defaultFilter)
// DISCARDED: internal static ImGuiTextRange* ImGuiTextRangeNative() // DISCARDED: internal static ImGuiTextRange* ImGuiTextRangeNative()
// DISCARDED: internal static ImGuiTextRange* ImGuiTextRangeNative(byte* b, byte* e) // DISCARDED: internal static ImGuiTextRange* ImGuiTextRangeNative(byte* b, byte* e)

View file

@ -3735,52 +3735,6 @@ public unsafe partial class ImGuiNative
return ((delegate* unmanaged[Cdecl]<ImGuiStorage*, uint, void*, void**>)ImGui.funcTable[473])(self, key, defaultVal); return ((delegate* unmanaged[Cdecl]<ImGuiStorage*, uint, void*, void**>)ImGui.funcTable[473])(self, key, defaultVal);
} }
/// <summary>
/// To be documented.
/// </summary>
public static void** GetVoidPtrRef(ImGuiStoragePtr self, uint key, void* defaultVal)
{
void** ret = GetVoidPtrRef(self, key, defaultVal);
return ret;
}
/// <summary>
/// To be documented.
/// </summary>
public static void** GetVoidPtrRef(ImGuiStoragePtr self, uint key)
{
void** ret = GetVoidPtrRef(self, key, (void*)(default));
return ret;
}
/// <summary>
/// To be documented.
/// </summary>
public static void** GetVoidPtrRef(ref ImGuiStorage self, uint key, void* defaultVal)
{
fixed (ImGuiStorage* pself = &self)
{
void** ret = GetVoidPtrRef((ImGuiStorage*)pself, key, defaultVal);
return ret;
}
}
/// <summary>
/// To be documented.
/// </summary>
public static void** GetVoidPtrRef(ref ImGuiStorage self, uint key)
{
fixed (ImGuiStorage* pself = &self)
{
void** ret = GetVoidPtrRef((ImGuiStorage*)pself, key, (void*)(default));
return ret;
}
}
/// <summary>
/// To be documented.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void SetAllInt(ImGuiStorage* self, int val) public static void SetAllInt(ImGuiStorage* self, int val)
{ {

Some files were not shown because too many files have changed in this diff Show more