Add dummy sort function
This commit is contained in:
parent
e76bc13ef5
commit
66a57d415a
|
@ -1,3 +1,4 @@
|
|||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using Godot;
|
||||
|
||||
|
@ -5,6 +6,14 @@ namespace KeepersCompound.TMV.UI;
|
|||
|
||||
public partial class TextureBrowser : Node
|
||||
{
|
||||
enum SortMode
|
||||
{
|
||||
Name,
|
||||
Family,
|
||||
Index,
|
||||
Count,
|
||||
}
|
||||
|
||||
private Tree _folderTree;
|
||||
private LineEdit _searchBar;
|
||||
private MenuButton _sortMenu;
|
||||
|
@ -30,6 +39,7 @@ public partial class TextureBrowser : Node
|
|||
_texturePath = GetNode<LineEdit>("%PathBox");
|
||||
|
||||
_searchBar.TextChanged += ApplySearchFilter;
|
||||
_sortMenu.GetPopup().IdPressed += ApplySortMode;
|
||||
|
||||
BuildFolderTree();
|
||||
BuildTextureList(); // TODO: This should be triggered on folder change
|
||||
|
@ -102,4 +112,15 @@ public partial class TextureBrowser : Node
|
|||
panel.Visible = Regex.IsMatch(panel.Name.ToString(), regexString);
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplySortMode(long id)
|
||||
{
|
||||
var popup = _sortMenu.GetPopup();
|
||||
for (var i = 0; i < popup.ItemCount; i++)
|
||||
{
|
||||
popup.SetItemChecked(i, popup.GetItemId(i) == id);
|
||||
}
|
||||
|
||||
// TODO: Actualy sort
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue