mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-19 06:17:43 +01:00
Miscellaneous improvements (#1537)
This commit is contained in:
parent
a6ea4aa56a
commit
7a0de45f87
15 changed files with 1136 additions and 279 deletions
|
|
@ -28,8 +28,14 @@ public class AddonLifecycleWidget : IDataWindowWidget
|
|||
/// <inheritdoc/>
|
||||
public void Load()
|
||||
{
|
||||
this.AddonLifecycle = Service<AddonLifecycle>.GetNullable();
|
||||
if (this.AddonLifecycle is not null) this.Ready = true;
|
||||
Service<AddonLifecycle>
|
||||
.GetAsync()
|
||||
.ContinueWith(
|
||||
r =>
|
||||
{
|
||||
this.AddonLifecycle = r.Result;
|
||||
this.Ready = true;
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
|
|||
|
|
@ -38,12 +38,30 @@ internal class FontAwesomeTestWidget : IDataWindowWidget
|
|||
public void Draw()
|
||||
{
|
||||
ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, Vector2.Zero);
|
||||
|
||||
this.iconCategories ??= FontAwesomeHelpers.GetCategories();
|
||||
|
||||
this.iconCategories ??= new[] { "(Show All)", "(Undefined)" }
|
||||
.Concat(FontAwesomeHelpers.GetCategories().Skip(1))
|
||||
.ToArray();
|
||||
|
||||
if (this.iconSearchChanged)
|
||||
{
|
||||
this.icons = FontAwesomeHelpers.SearchIcons(this.iconSearchInput, this.iconCategories[this.selectedIconCategory]);
|
||||
if (this.iconSearchInput == string.Empty && this.selectedIconCategory <= 1)
|
||||
{
|
||||
var en = InterfaceManager.IconFont.GlyphsWrapped()
|
||||
.Select(x => (FontAwesomeIcon)x.Codepoint)
|
||||
.Where(x => (ushort)x is >= 0xE000 and < 0xF000);
|
||||
en = this.selectedIconCategory == 0
|
||||
? en.Concat(FontAwesomeHelpers.SearchIcons(string.Empty, string.Empty))
|
||||
: en.Except(FontAwesomeHelpers.SearchIcons(string.Empty, string.Empty));
|
||||
this.icons = en.Distinct().Order().ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.icons = FontAwesomeHelpers.SearchIcons(
|
||||
this.iconSearchInput,
|
||||
this.selectedIconCategory <= 1 ? string.Empty : this.iconCategories[this.selectedIconCategory]);
|
||||
}
|
||||
|
||||
this.iconNames = this.icons.Select(icon => Enum.GetName(icon)!).ToList();
|
||||
this.iconSearchChanged = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue