Some general cleanup and store quickbar / drive existence on setup instead of checking per draw. (#887)

This commit is contained in:
Ottermandias 2022-06-19 10:53:51 +02:00 committed by GitHub
parent c0df0f2dee
commit cd41fda202
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 95 additions and 128 deletions

View file

@ -1,5 +1,7 @@
using System.Collections.Generic;
using System.IO;
using System.Numerics;
using Dalamud.Utility;
namespace Dalamud.Interface.ImGuiFileDialog
{
@ -19,7 +21,27 @@ namespace Dalamud.Interface.ImGuiFileDialog
public string FileModifiedDate;
}
private record struct SideBarItem(string Text, string Location, FontAwesomeIcon Icon);
private readonly struct SideBarItem
{
public SideBarItem(string text, string location, FontAwesomeIcon icon)
{
this.Text = text;
this.Location = location;
this.Icon = icon;
this.Exists = !this.Location.IsNullOrEmpty() && Directory.Exists(this.Location);
}
public string Text { get; init; }
public string Location { get; init; }
public FontAwesomeIcon Icon { get; init; }
public bool Exists { get; init; }
public bool CheckExistence()
=> !this.Location.IsNullOrEmpty() && Directory.Exists(this.Location);
}
private struct FilterStruct
{