diff --git a/src/Dialogs/DialogHandler.cs b/src/Dialogs/DialogHandler.cs
index 99a78e7..4d939a0 100644
--- a/src/Dialogs/DialogHandler.cs
+++ b/src/Dialogs/DialogHandler.cs
@@ -50,7 +50,8 @@ public static void RenderActiveWindows()
public static void ShowException(Exception ex)
{
- string message = ex.Message.Replace("'", "");
+ // Replace both ' and " with nothing. Messages with these values cause INVALID MESSAGE WITH QUOTES
+ string message = ex.Message.Replace("'", "").Replace("\"", "");
Clipboard.SetText($"{ex.Message} \n{ex.StackTrace}");
TinyFileDialog.MessageBoxErrorOk($"{message} Details copied to clipboard!");
diff --git a/src/DockedWindows/AssetWindow/AssetViewWindow.cs b/src/DockedWindows/AssetWindow/AssetViewWindow.cs
index c4daed7..d8a589f 100644
--- a/src/DockedWindows/AssetWindow/AssetViewWindow.cs
+++ b/src/DockedWindows/AssetWindow/AssetViewWindow.cs
@@ -515,19 +515,32 @@ private string TextEplislon(string text, float textWidth, float itemWidth)
#region Asset Loading
+ ///
+ /// Filters assets based on its visibility and some search term.
+ ///
+ /// Full list of assets
+ /// Filtered list of assets
private List UpdateSearch(List assets)
{
List filtered = new List();
for (int i = 0; i < assets.Count; i++)
{
- bool HasText = assets[i].Name != null &&
- assets[i].Name.IndexOf(_searchText, StringComparison.OrdinalIgnoreCase) >= 0;
-
if (!assets[i].Visible)
+ // Not visible
continue;
- if (isSearch && HasText || !isSearch)
- filtered.Add(assets[i]);
+ if (isSearch)
+ {
+ // Search for matches if filtering is applied
+ bool hasText = assets[i].Name != null &&
+ assets[i].Name.IndexOf(_searchText, StringComparison.OrdinalIgnoreCase) >= 0;
+
+ hasText |= assets[i].Aliases.Any(s => s.IndexOf(_searchText, StringComparison.OrdinalIgnoreCase) >= 0);
+
+ if (!hasText)
+ continue;
+ }
+ filtered.Add(assets[i]);
}
return filtered;
}
@@ -667,6 +680,11 @@ public class AssetItem
public string DisplayName { get; internal set; }
+ ///
+ /// Aliases of the asset, which are also valid search terms
+ ///
+ public string[] Aliases { get; set; } = Array.Empty();
+
///
/// The image ID of the icon.
///
diff --git a/src/DockedWindows/Outliner/Outliner.cs b/src/DockedWindows/Outliner/Outliner.cs
index a6f7d6e..9122753 100644
--- a/src/DockedWindows/Outliner/Outliner.cs
+++ b/src/DockedWindows/Outliner/Outliner.cs
@@ -144,8 +144,7 @@ public void ScrollToSelected(NodeBase target)
private bool GetNodePosition(NodeBase target, NodeBase parent, ref float pos, float itemHeight)
{
- bool HasText = parent.Header != null &&
- parent.Header.IndexOf(_searchText, StringComparison.OrdinalIgnoreCase) >= 0;
+ bool HasText = parent.IsNameMatch(_searchText);
//Search is active and node is found but is not in results so skip scrolling
if (isSearch && parent == target && !HasText)
@@ -303,8 +302,7 @@ private void SetupNodes(NodeBase node)
private void CalculateCount(NodeBase node, ref int counter)
{
- bool HasText = node.Header != null &&
- node.Header.IndexOf(_searchText, StringComparison.OrdinalIgnoreCase) >= 0;
+ bool HasText = node.IsNameMatch(_searchText);
if (isSearch && HasText || !isSearch)
{
@@ -328,8 +326,7 @@ public void DeselectAll()
public void DrawNode(NodeBase node, float itemHeight, int level = 0)
{
- bool HasText = node.Header != null &&
- node.Header.IndexOf(_searchText, StringComparison.OrdinalIgnoreCase) >= 0;
+ bool HasText = node.IsNameMatch(_searchText);
char icon = IconManager.FOLDER_ICON;
if (node.Tag is STGenericMesh)
@@ -818,14 +815,7 @@ private bool SelectNodeRange(NodeBase node, NodeBase selectedNode1, NodeBase sel
private List GetSearchableNodes(List nodes)
{
- List nodeList = new List();
- foreach (var node in nodes)
- {
- bool hasText = node.Header != null && node.Header.IndexOf(_searchText, StringComparison.OrdinalIgnoreCase) >= 0;
- if (hasText)
- nodeList.Add(node);
- }
- return nodeList;
+ return nodes.Where(n => n.IsNameMatch(_searchText)).ToList();
}
private void LoadTextureIcon(NodeBase node)
diff --git a/src/Icons/IconManager.cs b/src/Icons/IconManager.cs
index bb45660..72722d4 100644
--- a/src/Icons/IconManager.cs
+++ b/src/Icons/IconManager.cs
@@ -88,6 +88,7 @@ public class IconManager
public const char DESELECT_ICON = '\uf850';
public const char SELECT_ICON = '\uf84c';
+ public const char INFO_ICON = '\uf05a';
public const char WARNING_ICON = '\uf071';
public const char VIDEO_ICON = '\uf03d';
@@ -103,6 +104,11 @@ public class IconManager
public const char PATH_CONNECT = '\uf337';
public const char PATH_CONNECT_AUTO = '\uf126';
+ public const char ICON_WII_U = '\uf0a0'; // HDD
+ public const char ICON_SWITCH = '\uf11b'; // gamepad
+ public const char ICON_MOD = '\uf0ad'; // wrench
+ public const char ICON_DOWNLOAD = '\uf019';
+
public const int ICON_SIZE = 18;
static bool init = false;