private UILabel createLabel(int columnPosition, string text, SortableWorkshopAssetField sortField) { var result = AddUIComponent<UILabel>(); result.relativePosition = new Vector3(columnPosition, UIConstants.CaptionPanelLabelOffset); result.textScale = UIConstants.CaptionPanelTextScale; result.text = text; result.eventClick += (component, param) => OnSort(sortField); return result; }
protected virtual void OnSort(SortableWorkshopAssetField sortField) { var handler = Sort; if (handler != null) { handler.Invoke(this, new SortEventArgs(sortField)); } }
private UILabel createLabel(int columnPosition, string text, SortableWorkshopAssetField sortField) { var result = AddUIComponent <UILabel>(); result.relativePosition = new Vector3(columnPosition, UIConstants.CaptionPanelLabelOffset); result.textScale = UIConstants.CaptionPanelTextScale; result.text = text; result.eventClick += (component, param) => OnSort(sortField); return(result); }
public void SetSortField(SortableWorkshopAssetField sortField) { if (_currentSortField == sortField) // switch the sorting order when the new sort field is the same as the current one _descending = !_descending; else { // Reset the sorting order to ascending when the new sort field is different from the current one _descending = false; _currentSortField = sortField; } }
public void SetSortField(SortableWorkshopAssetField sortField) { if (_currentSortField == sortField) { // switch the sorting order when the new sort field is the same as the current one _descending = !_descending; } else { // Reset the sorting order to ascending when the new sort field is different from the current one _descending = false; _currentSortField = sortField; } }
public SortEventArgs(SortableWorkshopAssetField sortField) { SortField = sortField; }
public WorkshopAssetComparer(SortableWorkshopAssetField sortField, bool descending) : base() { _sortField = sortField; _descending = descending; }
protected virtual void OnSort(SortableWorkshopAssetField sortField) { var handler = Sort; if (handler != null) handler.Invoke(this, new SortEventArgs(sortField)); }
public WorkshopAssetListState(AssetType initialFilter) { _currentFilter = initialFilter; _currentSortField = SortableWorkshopAssetField.Name; }
public SortEventArgs(SortableWorkshopAssetField sortField) { SortField = sortField; }
public WorkshopAssetListState(AssetType initialFilter) { _currentFilter = initialFilter; _currentSortField = SortableWorkshopAssetField.Name; }