コード例 #1
0
 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;
 }
コード例 #2
0
        protected virtual void OnSort(SortableWorkshopAssetField sortField)
        {
            var handler = Sort;

            if (handler != null)
            {
                handler.Invoke(this, new SortEventArgs(sortField));
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 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;
     }
 }
コード例 #5
0
 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;
     }
 }
コード例 #6
0
 public SortEventArgs(SortableWorkshopAssetField sortField)
 {
     SortField = sortField;
 }
コード例 #7
0
 public WorkshopAssetComparer(SortableWorkshopAssetField sortField, bool descending) : base()
 {
     _sortField  = sortField;
     _descending = descending;
 }
コード例 #8
0
 protected virtual void OnSort(SortableWorkshopAssetField sortField)
 {
     var handler = Sort;
     if (handler != null)
         handler.Invoke(this, new SortEventArgs(sortField));
 }
コード例 #9
0
 public WorkshopAssetListState(AssetType initialFilter)
 {
     _currentFilter    = initialFilter;
     _currentSortField = SortableWorkshopAssetField.Name;
 }
コード例 #10
0
 public SortEventArgs(SortableWorkshopAssetField sortField)
 {
     SortField = sortField;
 }
コード例 #11
0
 public WorkshopAssetListState(AssetType initialFilter)
 {
     _currentFilter = initialFilter;
     _currentSortField = SortableWorkshopAssetField.Name;
 }