update UIElements

pull/455/head
何冠峰 2025-01-20 19:12:23 +08:00
parent 9add447566
commit 912e2c28a3
8 changed files with 30 additions and 30 deletions

View File

@ -5,7 +5,7 @@ namespace YooAsset.Editor
{
public class AssetPathCell : StringValueCell
{
public AssetPathCell(string headerTitle, object cellValue) : base(headerTitle, cellValue)
public AssetPathCell(string searchTag, object cellValue) : base(searchTag, cellValue)
{
}

View File

@ -6,7 +6,7 @@ namespace YooAsset.Editor
public class BooleanValueCell : ITableCell, IComparable
{
public object CellValue { set; get; }
public string HeaderTitle { private set; get; }
public string SearchTag { private set; get; }
public bool BooleanValue
{
get
@ -15,9 +15,9 @@ namespace YooAsset.Editor
}
}
public BooleanValueCell(string headerTitle, object cellValue)
public BooleanValueCell(string searchTag, object cellValue)
{
HeaderTitle = headerTitle;
SearchTag = searchTag;
CellValue = cellValue;
}
public object GetDisplayObject()

View File

@ -6,7 +6,7 @@ namespace YooAsset.Editor
public class IntegerValueCell : ITableCell, IComparable
{
public object CellValue { set; get; }
public string HeaderTitle { private set; get; }
public string SearchTag { private set; get; }
public long IntegerValue
{
get
@ -15,9 +15,9 @@ namespace YooAsset.Editor
}
}
public IntegerValueCell(string headerTitle, object cellValue)
public IntegerValueCell(string searchTag, object cellValue)
{
HeaderTitle = headerTitle;
SearchTag = searchTag;
CellValue = cellValue;
}
public object GetDisplayObject()

View File

@ -6,7 +6,7 @@ namespace YooAsset.Editor
public class SingleValueCell : ITableCell, IComparable
{
public object CellValue { set; get; }
public string HeaderTitle { private set; get; }
public string SearchTag { private set; get; }
public double SingleValue
{
get
@ -15,9 +15,9 @@ namespace YooAsset.Editor
}
}
public SingleValueCell(string headerTitle, object cellValue)
public SingleValueCell(string searchTag, object cellValue)
{
HeaderTitle = headerTitle;
SearchTag = searchTag;
CellValue = cellValue;
}
public object GetDisplayObject()

View File

@ -6,7 +6,7 @@ namespace YooAsset.Editor
public class StringValueCell : ITableCell, IComparable
{
public object CellValue { set; get; }
public string HeaderTitle { private set; get; }
public string SearchTag { private set; get; }
public string StringValue
{
get
@ -15,9 +15,9 @@ namespace YooAsset.Editor
}
}
public StringValueCell(string headerTitle, object cellValue)
public StringValueCell(string searchTag, object cellValue)
{
HeaderTitle = headerTitle;
SearchTag = searchTag;
CellValue = cellValue;
}
public object GetDisplayObject()

View File

@ -24,29 +24,29 @@ namespace YooAsset.Editor
var cell = new ButtonCell();
Cells.Add(cell);
}
public void AddAssetPathCell(string headerTitle, string path)
public void AddAssetPathCell(string searchTag, string path)
{
var cell = new AssetPathCell(headerTitle, path);
var cell = new AssetPathCell(searchTag, path);
Cells.Add(cell);
}
public void AddStringValueCell(string headerTitle, string value)
public void AddStringValueCell(string searchTag, string value)
{
var cell = new StringValueCell(headerTitle, value);
var cell = new StringValueCell(searchTag, value);
Cells.Add(cell);
}
public void AddLongValueCell(string headerTitle, long value)
public void AddLongValueCell(string searchTag, long value)
{
var cell = new IntegerValueCell(headerTitle, value);
var cell = new IntegerValueCell(searchTag, value);
Cells.Add(cell);
}
public void AddDoubleValueCell(string headerTitle, double value)
public void AddDoubleValueCell(string searchTag, double value)
{
var cell = new SingleValueCell(headerTitle, value);
var cell = new SingleValueCell(searchTag, value);
Cells.Add(cell);
}
public void AddBoolValueCell(string headerTitle, bool value)
public void AddBoolValueCell(string searchTag, bool value)
{
var cell = new BooleanValueCell(headerTitle, value);
var cell = new BooleanValueCell(searchTag, value);
Cells.Add(cell);
}
#endregion

View File

@ -100,14 +100,14 @@ namespace YooAsset.Editor
continue;
var cmd = new SearchKeyword();
cmd.HeaderTitle = splits[0];
cmd.SearchTag = splits[0];
cmd.Keyword = splits[1];
results.Add(cmd);
}
else
{
var cmd = new SearchKeyword();
cmd.HeaderTitle = string.Empty;
cmd.SearchTag = string.Empty;
cmd.Keyword = command;
results.Add(cmd);
}
@ -171,9 +171,9 @@ namespace YooAsset.Editor
var searchKeywordCmd = cmd as SearchKeyword;
if (tableCell is StringValueCell stringValueCell)
{
if (string.IsNullOrEmpty(searchKeywordCmd.HeaderTitle) == false)
if (string.IsNullOrEmpty(searchKeywordCmd.SearchTag) == false)
{
if (searchKeywordCmd.HeaderTitle == stringValueCell.HeaderTitle)
if (searchKeywordCmd.SearchTag == stringValueCell.SearchTag)
{
if (searchKeywordCmd.CompareTo(stringValueCell.StringValue))
return true;
@ -204,7 +204,7 @@ namespace YooAsset.Editor
var searchCompareCmd = cmd as SearchCompare;
if (tableCell is IntegerValueCell integerValueCell)
{
if (searchCompareCmd.HeaderTitle == integerValueCell.HeaderTitle)
if (searchCompareCmd.HeaderTitle == integerValueCell.SearchTag)
{
if (searchCompareCmd.CompareTo(integerValueCell.IntegerValue))
return true;
@ -212,7 +212,7 @@ namespace YooAsset.Editor
}
else if (tableCell is SingleValueCell singleValueCell)
{
if (searchCompareCmd.HeaderTitle == singleValueCell.HeaderTitle)
if (searchCompareCmd.HeaderTitle == singleValueCell.SearchTag)
{
if (searchCompareCmd.CompareTo(singleValueCell.SingleValue))
return true;

View File

@ -7,7 +7,7 @@ namespace YooAsset.Editor
/// </summary>
public class SearchKeyword : ISearchCommand
{
public string HeaderTitle;
public string SearchTag;
public string Keyword;
public bool CompareTo(string value)