public static TableDef <LogisticProviderPassive> CreatePassiveProviderTableDef() { ColumnDef <LogisticProviderPassive> filterLabel = new ColumnDef <LogisticProviderPassive>(); filterLabel.label = "Provider filter"; filterLabel.workerClass = typeof(PassiveProviderColumnWorker_ThingLabel); ColumnDef <LogisticProviderPassive> edit = new ColumnDef <LogisticProviderPassive>(); edit.headerIcon = "UI/Buttons/Rename"; edit.workerClass = typeof(ProviderPassiveColumnWorker_Edit); ColumnDef <LogisticProviderPassive> remove = new ColumnDef <LogisticProviderPassive>(); remove.workerClass = typeof(ProviderPassiveColumnWorker_Remove); TableDef <LogisticProviderPassive> tableDef = new TableDef <LogisticProviderPassive>(); tableDef.columns = new List <ColumnDef <LogisticProviderPassive> >() { filterLabel, edit, remove, }; return(tableDef); }
public static TableDef <LogisticRequester> CreateRequesterTableDef() { ColumnDef <LogisticRequester> reqThing = new ColumnDef <LogisticRequester>(); reqThing.label = "Requested thing"; reqThing.workerClass = typeof(RequesterColumnWorker_ThingLabel); ColumnDef <LogisticRequester> reqAmnt = new ColumnDef <LogisticRequester>(); reqAmnt.label = "Amount"; reqAmnt.workerClass = typeof(RequesterColumnWorker_ReqestAmount); reqAmnt.sortable = true; ColumnDef <LogisticRequester> activeReq = new ColumnDef <LogisticRequester>(); activeReq.label = "Active"; activeReq.workerClass = typeof(RequesterColumnWorker_ActiveRequests); activeReq.headerTip = "The amount that has been actually requested"; activeReq.sortable = true; ColumnDef <LogisticRequester> edit = new ColumnDef <LogisticRequester>(); edit.headerIcon = "UI/Buttons/Rename"; edit.workerClass = typeof(RequesterColumnWorker_Edit); ColumnDef <LogisticRequester> remove = new ColumnDef <LogisticRequester>(); remove.workerClass = typeof(RequesterColumnWorker_Remove); TableDef <LogisticRequester> tableDef = new TableDef <LogisticRequester>(); tableDef.columns = new List <ColumnDef <LogisticRequester> >() { reqThing, reqAmnt, activeReq, edit, remove, }; return(tableDef); }
private float GetMaxWidth(ColumnDef <T> column) { return(Mathf.Max((float)column.Worker.GetMaxWidth(this), 0f)); }
public void SortBy(ColumnDef <T> column, bool descending) { this.sortByColumn = column; this.sortDescending = descending; this.SetDirty(); }