mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-27 10:59:18 +01:00
restructure
This commit is contained in:
parent
3381ac1c7d
commit
b53a97408b
263 changed files with 2221 additions and 1191 deletions
|
|
@ -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
|
||||
/// being interacted.</summary>
|
||||
/// <remarks>If <c>true</c>, then <see cref="ImGui.BeginPopupModal(string, ref bool, ImGuiWindowFlags)"/> will be
|
||||
/// used. Otherwise, <see cref="ImGui.Begin(string, ref bool, ImGuiWindowFlags)"/> will be used.</remarks>
|
||||
/// <remarks>If <c>true</c>, then <see cref="ImGui.BeginPopupModal(ImU8String, ref bool, ImGuiWindowFlags)"/> will be
|
||||
/// used. Otherwise, <see cref="ImGui.Begin(ImU8String, ref bool, ImGuiWindowFlags)"/> will be used.</remarks>
|
||||
public bool IsModal { get; set; } = true;
|
||||
|
||||
/// <summary>Gets or sets the window flags.</summary>
|
||||
|
|
@ -558,21 +558,10 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X);
|
||||
using (this.fontHandle?.Push())
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
fixed (byte* buf = this.fontPreviewText)
|
||||
fixed (byte* label = "##fontPreviewText"u8)
|
||||
{
|
||||
ImGui.InputTextMultiline(
|
||||
label,
|
||||
buf,
|
||||
(uint)this.fontPreviewText.Length,
|
||||
ImGui.GetContentRegionAvail(),
|
||||
ImGuiInputTextFlags.None,
|
||||
null,
|
||||
null);
|
||||
}
|
||||
}
|
||||
ImGui.InputTextMultiline(
|
||||
"##fontPreviewText"u8,
|
||||
this.fontPreviewText,
|
||||
ImGui.GetContentRegionAvail());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -608,15 +597,15 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
ref this.familySearch,
|
||||
255,
|
||||
ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory,
|
||||
data =>
|
||||
(ref ImGuiInputTextCallbackData data) =>
|
||||
{
|
||||
if (families.Count == 0)
|
||||
return 0;
|
||||
|
||||
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:
|
||||
this.selectedFamilyIndex = (this.selectedFamilyIndex + 1) % families.Count;
|
||||
|
|
@ -632,13 +621,13 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
if (changed)
|
||||
{
|
||||
ImGuiHelpers.SetTextFromCallback(
|
||||
data,
|
||||
ref data,
|
||||
this.ExtractName(families[this.selectedFamilyIndex]));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (data->EventKey)
|
||||
switch (data.EventKey)
|
||||
{
|
||||
case ImGuiKey.DownArrow:
|
||||
this.selectedFamilyIndex = families.FindIndex(
|
||||
|
|
@ -776,15 +765,15 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
ref this.fontSearch,
|
||||
255,
|
||||
ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory,
|
||||
data =>
|
||||
(ref ImGuiInputTextCallbackData data) =>
|
||||
{
|
||||
if (fonts.Count == 0)
|
||||
return 0;
|
||||
|
||||
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:
|
||||
this.selectedFontIndex = (this.selectedFontIndex + 1) % fonts.Count;
|
||||
|
|
@ -799,13 +788,13 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
if (changed)
|
||||
{
|
||||
ImGuiHelpers.SetTextFromCallback(
|
||||
data,
|
||||
ref data,
|
||||
this.ExtractName(fonts[this.selectedFontIndex]));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (data->EventKey)
|
||||
switch (data.EventKey)
|
||||
{
|
||||
case ImGuiKey.DownArrow:
|
||||
this.selectedFontIndex = fonts.FindIndex(
|
||||
|
|
@ -925,9 +914,9 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
255,
|
||||
ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory |
|
||||
ImGuiInputTextFlags.CharsDecimal,
|
||||
data =>
|
||||
(ref ImGuiInputTextCallbackData data) =>
|
||||
{
|
||||
switch (data->EventKey)
|
||||
switch (data.EventKey)
|
||||
{
|
||||
case ImGuiKey.DownArrow:
|
||||
this.selectedFont = this.selectedFont with
|
||||
|
|
@ -946,7 +935,7 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
}
|
||||
|
||||
if (changed)
|
||||
ImGuiHelpers.SetTextFromCallback(data, $"{this.selectedFont.SizePt:0.##}");
|
||||
ImGuiHelpers.SetTextFromCallback(ref data, $"{this.selectedFont.SizePt:0.##}");
|
||||
|
||||
return 0;
|
||||
}))
|
||||
|
|
@ -1129,19 +1118,19 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
255,
|
||||
ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CallbackHistory |
|
||||
ImGuiInputTextFlags.CharsDecimal,
|
||||
data =>
|
||||
(ref ImGuiInputTextCallbackData data) =>
|
||||
{
|
||||
switch (data->EventKey)
|
||||
switch (data.EventKey)
|
||||
{
|
||||
case ImGuiKey.DownArrow:
|
||||
changed2 = true;
|
||||
value = Math.Min(max, (MathF.Round(value / step) * step) + step);
|
||||
ImGuiHelpers.SetTextFromCallback(data, $"{value:0.##}");
|
||||
ImGuiHelpers.SetTextFromCallback(ref data, $"{value:0.##}");
|
||||
break;
|
||||
case ImGuiKey.UpArrow:
|
||||
changed2 = true;
|
||||
value = Math.Max(min, (MathF.Round(value / step) * step) - step);
|
||||
ImGuiHelpers.SetTextFromCallback(data, $"{value:0.##}");
|
||||
ImGuiHelpers.SetTextFromCallback(ref data, $"{value:0.##}");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ internal sealed partial class ActiveNotification
|
|||
/// <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>
|
||||
/// <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)
|
||||
{
|
||||
DateTime expiry;
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ internal unsafe class UiDebug
|
|||
ImGui.SameLine();
|
||||
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();
|
||||
if (ImGui.Button($"Encode##{(ulong)textNode:X}"))
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ internal unsafe partial class TextNodeTree
|
|||
ImGui.Text("Font:");
|
||||
ImGui.TableNextColumn();
|
||||
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];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class BranchSwitcherWindow : Window
|
|||
var si = Service<Dalamud>.Get().StartInfo;
|
||||
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
this.completionZipText = null;
|
||||
|
|
@ -847,9 +845,7 @@ internal class ConsoleWindow : Window, IDisposable
|
|||
break;
|
||||
|
||||
case ImGuiInputTextFlags.CallbackCompletion:
|
||||
var textBytes = new byte[data->BufTextLen];
|
||||
Marshal.Copy((IntPtr)data->Buf, textBytes, 0, data->BufTextLen);
|
||||
var text = Encoding.UTF8.GetString(textBytes);
|
||||
var text = Encoding.UTF8.GetString(data.BufTextSpan);
|
||||
|
||||
var words = text.Split();
|
||||
|
||||
|
|
@ -894,8 +890,8 @@ internal class ConsoleWindow : Window, IDisposable
|
|||
|
||||
if (toComplete != null)
|
||||
{
|
||||
ptr.DeleteChars(0, ptr.BufTextLen);
|
||||
ptr.InsertChars(0, toComplete);
|
||||
data.DeleteChars(0, data.BufTextLen);
|
||||
data.InsertChars(0, toComplete);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -904,14 +900,14 @@ internal class ConsoleWindow : Window, IDisposable
|
|||
case ImGuiInputTextFlags.CallbackHistory:
|
||||
var prevPos = this.historyPos;
|
||||
|
||||
if (ptr.EventKey == ImGuiKey.UpArrow)
|
||||
if (data.EventKey == ImGuiKey.UpArrow)
|
||||
{
|
||||
if (this.historyPos == -1)
|
||||
this.historyPos = this.configuration.LogCommandHistory.Count - 1;
|
||||
else if (this.historyPos > 0)
|
||||
this.historyPos--;
|
||||
}
|
||||
else if (data->EventKey == ImGuiKey.DownArrow)
|
||||
else if (data.EventKey == ImGuiKey.DownArrow)
|
||||
{
|
||||
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;
|
||||
|
||||
ptr.DeleteChars(0, ptr.BufTextLen);
|
||||
ptr.InsertChars(0, historyStr);
|
||||
data.DeleteChars(0, data.BufTextLen);
|
||||
data.InsertChars(0, historyStr);
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -120,23 +120,13 @@ internal class DataShareWidget : IDataWindowWidget
|
|||
|
||||
ImGui.SameLine();
|
||||
if (ImGui.Button("Copy"))
|
||||
{
|
||||
fixed (byte* pData = data)
|
||||
ImGui.SetClipboardText(pData);
|
||||
}
|
||||
ImGui.SetClipboardText(data);
|
||||
|
||||
fixed (byte* pLabel = "text"u8)
|
||||
fixed (byte* pData = data)
|
||||
{
|
||||
ImGui.InputTextMultiline(
|
||||
pLabel,
|
||||
pData,
|
||||
(uint)data.Length,
|
||||
ImGui.GetContentRegionAvail(),
|
||||
ImGuiInputTextFlags.ReadOnly,
|
||||
null,
|
||||
null);
|
||||
}
|
||||
ImGui.InputTextMultiline(
|
||||
"text"u8,
|
||||
data,
|
||||
ImGui.GetContentRegionAvail(),
|
||||
ImGuiInputTextFlags.ReadOnly);
|
||||
}
|
||||
|
||||
this.nextTab = -1;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ internal class FontAwesomeTestWidget : IDataWindowWidget
|
|||
|
||||
ImGui.SetNextItemWidth(160f);
|
||||
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.iconSearchChanged = true;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable
|
|||
public unsafe void Draw()
|
||||
{
|
||||
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();
|
||||
if (ImGui.Checkbox("Global Scale for Atlas"u8, ref this.atlasScaleMode))
|
||||
this.ClearAtlas();
|
||||
|
|
@ -182,12 +182,8 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable
|
|||
{
|
||||
if (ImGui.InputTextMultiline(
|
||||
labelPtr,
|
||||
this.testStringBuffer.Data,
|
||||
(uint)this.testStringBuffer.Capacity,
|
||||
new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3),
|
||||
0,
|
||||
null,
|
||||
null))
|
||||
this.testStringBuffer.StorageSpan,
|
||||
new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3)))
|
||||
{
|
||||
var len = this.testStringBuffer.StorageSpan.IndexOf((byte)0);
|
||||
if (len + 4 >= this.testStringBuffer.Capacity)
|
||||
|
|
|
|||
|
|
@ -73,17 +73,9 @@ internal class ImGuiWidget : IDataWindowWidget
|
|||
|
||||
ImGui.Checkbox("##manualType", ref this.notificationTemplate.ManualType);
|
||||
ImGui.SameLine();
|
||||
ImGui.Combo(
|
||||
"Type##type",
|
||||
ref this.notificationTemplate.TypeInt,
|
||||
NotificationTemplate.TypeTitles,
|
||||
NotificationTemplate.TypeTitles.Length);
|
||||
ImGui.Combo("Type##type", ref this.notificationTemplate.TypeInt, NotificationTemplate.TypeTitles);
|
||||
|
||||
ImGui.Combo(
|
||||
"Icon##iconCombo",
|
||||
ref this.notificationTemplate.IconInt,
|
||||
NotificationTemplate.IconTitles,
|
||||
NotificationTemplate.IconTitles.Length);
|
||||
ImGui.Combo("Icon##iconCombo", ref this.notificationTemplate.IconInt, NotificationTemplate.IconTitles);
|
||||
switch (this.notificationTemplate.IconInt)
|
||||
{
|
||||
case 1 or 2:
|
||||
|
|
@ -96,8 +88,7 @@ internal class ImGuiWidget : IDataWindowWidget
|
|||
ImGui.Combo(
|
||||
"Asset##iconAssetCombo",
|
||||
ref this.notificationTemplate.IconAssetInt,
|
||||
NotificationTemplate.AssetSources,
|
||||
NotificationTemplate.AssetSources.Length);
|
||||
NotificationTemplate.AssetSources);
|
||||
break;
|
||||
case 3 or 7:
|
||||
ImGui.InputText(
|
||||
|
|
@ -116,20 +107,17 @@ internal class ImGuiWidget : IDataWindowWidget
|
|||
ImGui.Combo(
|
||||
"Initial Duration",
|
||||
ref this.notificationTemplate.InitialDurationInt,
|
||||
NotificationTemplate.InitialDurationTitles,
|
||||
NotificationTemplate.InitialDurationTitles.Length);
|
||||
NotificationTemplate.InitialDurationTitles);
|
||||
|
||||
ImGui.Combo(
|
||||
"Extension Duration",
|
||||
ref this.notificationTemplate.HoverExtendDurationInt,
|
||||
NotificationTemplate.HoverExtendDurationTitles,
|
||||
NotificationTemplate.HoverExtendDurationTitles.Length);
|
||||
NotificationTemplate.HoverExtendDurationTitles);
|
||||
|
||||
ImGui.Combo(
|
||||
"Progress",
|
||||
ref this.notificationTemplate.ProgressMode,
|
||||
NotificationTemplate.ProgressModeTitles,
|
||||
NotificationTemplate.ProgressModeTitles.Length);
|
||||
NotificationTemplate.ProgressModeTitles);
|
||||
|
||||
ImGui.Checkbox("Respect UI Hidden", ref this.notificationTemplate.RespectUiHidden);
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ internal class NounProcessorWidget : IDataWindowWidget
|
|||
var language = this.languages[this.selectedLanguageIndex];
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ internal class NounProcessorWidget : IDataWindowWidget
|
|||
ImGui.SameLine();
|
||||
|
||||
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];
|
||||
this.rowId = 1;
|
||||
|
|
|
|||
|
|
@ -568,7 +568,7 @@ internal class SeStringCreatorWidget : IDataWindowWidget
|
|||
}
|
||||
}).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
|
||||
{
|
||||
|
|
@ -683,7 +683,7 @@ internal class SeStringCreatorWidget : IDataWindowWidget
|
|||
ImGui.TableNextColumn(); // Type
|
||||
var type = (int)entry.Type;
|
||||
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;
|
||||
updateString |= true;
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ internal unsafe class SeStringRendererTestWidget : IDataWindowWidget
|
|||
ImGui.SameLine();
|
||||
var t4 = this.style.ThemeIndex ?? AtkStage.Instance()->AtkUIColorHolder->ActiveColorThemeType;
|
||||
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;
|
||||
|
||||
ImGui.SameLine();
|
||||
|
|
@ -265,12 +265,8 @@ internal unsafe class SeStringRendererTestWidget : IDataWindowWidget
|
|||
{
|
||||
if (ImGui.InputTextMultiline(
|
||||
labelPtr,
|
||||
this.testStringBuffer.Data,
|
||||
(uint)this.testStringBuffer.Capacity,
|
||||
new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3),
|
||||
0,
|
||||
null,
|
||||
null))
|
||||
this.testStringBuffer.StorageSpan,
|
||||
new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3)))
|
||||
{
|
||||
var len = this.testStringBuffer.StorageSpan.IndexOf((byte)0);
|
||||
if (len + 4 >= this.testStringBuffer.Capacity)
|
||||
|
|
@ -278,7 +274,7 @@ internal unsafe class SeStringRendererTestWidget : IDataWindowWidget
|
|||
if (len < this.testStringBuffer.Capacity)
|
||||
{
|
||||
this.testStringBuffer.LengthUnsafe = len;
|
||||
this.testStringBuffer.StorageSpan[len] = default;
|
||||
this.testStringBuffer.StorageSpan[len] = 0;
|
||||
}
|
||||
|
||||
this.testString = string.Empty;
|
||||
|
|
|
|||
|
|
@ -243,8 +243,8 @@ internal class TaskSchedulerWidget : IDataWindowWidget
|
|||
|
||||
if (ImGui.CollapsingHeader("Download"))
|
||||
{
|
||||
ImGui.InputText("URL", ref this.url, (uint)this.url.Length);
|
||||
ImGui.InputText("Local Path", ref this.localPath, (uint)this.localPath.Length);
|
||||
ImGui.InputText("URL", ref this.url);
|
||||
ImGui.InputText("Local Path", ref this.localPath);
|
||||
ImGui.SameLine();
|
||||
|
||||
if (ImGuiComponents.IconButton("##localpathpicker", FontAwesomeIcon.File))
|
||||
|
|
|
|||
|
|
@ -709,8 +709,7 @@ internal class TexWidget : IDataWindowWidget
|
|||
if (ImGui.Combo(
|
||||
"Assembly",
|
||||
ref this.inputManifestResourceAssemblyIndex,
|
||||
this.inputManifestResourceAssemblyCandidateNames,
|
||||
this.inputManifestResourceAssemblyCandidateNames.Length))
|
||||
this.inputManifestResourceAssemblyCandidateNames))
|
||||
{
|
||||
this.inputManifestResourceNameIndex = 0;
|
||||
this.inputManifestResourceNameCandidates = null;
|
||||
|
|
@ -727,8 +726,7 @@ internal class TexWidget : IDataWindowWidget
|
|||
ImGui.Combo(
|
||||
"Name",
|
||||
ref this.inputManifestResourceNameIndex,
|
||||
this.inputManifestResourceNameCandidates,
|
||||
this.inputManifestResourceNameCandidates.Length);
|
||||
this.inputManifestResourceNameCandidates);
|
||||
|
||||
var name =
|
||||
this.inputManifestResourceNameIndex >= 0
|
||||
|
|
@ -844,8 +842,7 @@ internal class TexWidget : IDataWindowWidget
|
|||
ImGui.Combo(
|
||||
nameof(this.textureModificationArgs.DxgiFormat),
|
||||
ref this.renderTargetChoiceInt,
|
||||
this.supportedRenderTargetFormatNames,
|
||||
this.supportedRenderTargetFormatNames.Length);
|
||||
this.supportedRenderTargetFormatNames);
|
||||
|
||||
Span<int> wh = stackalloc int[2];
|
||||
wh[0] = this.textureModificationArgs.NewWidth;
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ internal class ToastWidget : IDataWindowWidget
|
|||
|
||||
ImGui.InputText("Toast text", ref this.inputTextToast, 200);
|
||||
|
||||
ImGui.Combo("Toast Position", ref this.toastPosition, new[] { "Bottom", "Top", }, 2);
|
||||
ImGui.Combo("Toast Speed", ref this.toastSpeed, new[] { "Slow", "Fast", }, 2);
|
||||
ImGui.Combo("Quest Toast Position", ref this.questToastPosition, new[] { "Centre", "Right", "Left" }, 3);
|
||||
ImGui.Combo("Toast Position", ref this.toastPosition, ["Bottom", "Top"]);
|
||||
ImGui.Combo("Toast Speed", ref this.toastSpeed, ["Slow", "Fast"]);
|
||||
ImGui.Combo("Quest Toast Position", ref this.questToastPosition, ["Centre", "Right", "Left"]);
|
||||
ImGui.Checkbox("Quest Checkmark", ref this.questToastCheckmark);
|
||||
ImGui.Checkbox("Quest Play Sound", ref this.questToastSound);
|
||||
ImGui.InputInt("Quest Icon ID", ref this.questToastIconId);
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ internal class UldWidget : IDataWindowWidget
|
|||
}
|
||||
|
||||
var selectedUldPrev = this.selectedUld;
|
||||
ImGui.Combo("##selectUld", ref this.selectedUld, uldNames, uldNames.Length);
|
||||
ImGui.Combo("##selectUld", ref this.selectedUld, uldNames);
|
||||
ImGui.SameLine();
|
||||
if (ImGuiComponents.IconButton("selectUldLeft", FontAwesomeIcon.AngleLeft))
|
||||
this.selectedUld = ((this.selectedUld + uldNames.Length) - 1) % uldNames.Length;
|
||||
|
|
@ -117,7 +117,7 @@ internal class UldWidget : IDataWindowWidget
|
|||
ClearTask(ref this.selectedUldFileTask);
|
||||
}
|
||||
|
||||
ImGui.Combo("##selectTheme", ref this.selectedTheme, ThemeDisplayNames, ThemeDisplayNames.Length);
|
||||
ImGui.Combo("##selectTheme", ref this.selectedTheme, ThemeDisplayNames);
|
||||
ImGui.SameLine();
|
||||
if (ImGuiComponents.IconButton("selectThemeLeft", FontAwesomeIcon.AngleLeft))
|
||||
this.selectedTheme = ((this.selectedTheme + ThemeDisplayNames.Length) - 1) % ThemeDisplayNames.Length;
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public sealed class LanguageChooserSettingsEntry : SettingsEntry
|
|||
public override void Draw()
|
||||
{
|
||||
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."));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ public class StyleEditorWindow : Window
|
|||
|
||||
var styleAry = config.SavedStyles.Select(x => x.Name).ToArray();
|
||||
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];
|
||||
newStyle.Apply();
|
||||
|
|
@ -245,7 +245,7 @@ public class StyleEditorWindow : Window
|
|||
ImGui.Text("Alignment");
|
||||
ImGui.SliderFloat2("WindowTitleAlign", ref style.WindowTitleAlign, 0.0f, 1.0f, "%.2f");
|
||||
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);
|
||||
ImGui.SliderFloat2("ButtonTextAlign", ref style.ButtonTextAlign, 0.0f, 1.0f, "%.2f");
|
||||
ImGui.SameLine();
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public interface IDrawListTextureWrap : IDalamudTextureWrap
|
|||
|
||||
/// <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
|
||||
/// <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>
|
||||
void ResizeAndDrawWindow(ReadOnlySpan<char> windowName, Vector2 scale);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -666,16 +666,13 @@ public static partial class ImGuiHelpers
|
|||
/// </summary>
|
||||
/// <param name="data">The callback data.</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)
|
||||
data->DeleteChars(0, data->BufTextLen);
|
||||
if (data.BufTextLen != 0)
|
||||
data.DeleteChars(0, data.BufTextLen);
|
||||
|
||||
var len = Encoding.UTF8.GetByteCount(s);
|
||||
var buf = len < 1024 ? stackalloc byte[len] : new byte[len];
|
||||
Encoding.UTF8.GetBytes(s, buf);
|
||||
data->InsertChars(0, buf);
|
||||
data->SelectAll();
|
||||
data.InsertChars(0, s);
|
||||
data.SelectAll();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -8953,6 +8953,7 @@ public unsafe partial class ImGui
|
|||
// DISCARDED: internal static uint GetIDNative(byte* strIdBegin, byte* strIdEnd)
|
||||
// DISCARDED: internal static uint GetIDNative(void* ptrId)
|
||||
// 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 ImGuiTextRange* ImGuiTextRangeNative()
|
||||
// DISCARDED: internal static ImGuiTextRange* ImGuiTextRangeNative(byte* b, byte* e)
|
||||
|
|
@ -3735,52 +3735,6 @@ public unsafe partial class ImGuiNative
|
|||
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)]
|
||||
public static void SetAllInt(ImGuiStorage* self, int val)
|
||||
{
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue