public static IEnumerable <PawnColumnDef> ImpliedPawnColumnDefs() { PawnTableDef animalsTable = PawnTableDefOf.Animals; foreach (TrainableDef item in DefDatabase <TrainableDef> .AllDefsListForReading.OrderByDescending((TrainableDef td) => td.listPriority)) { PawnColumnDef pawnColumnDef = new PawnColumnDef(); pawnColumnDef.defName = "Trainable_" + item.defName; pawnColumnDef.trainable = item; pawnColumnDef.headerIcon = item.icon; pawnColumnDef.workerClass = typeof(PawnColumnWorker_Trainable); pawnColumnDef.sortable = true; pawnColumnDef.headerTip = item.LabelCap; pawnColumnDef.paintable = true; pawnColumnDef.modContentPack = item.modContentPack; animalsTable.columns.Insert(animalsTable.columns.FindIndex((PawnColumnDef x) => x.Worker is PawnColumnWorker_Checkbox) - 1, pawnColumnDef); yield return(pawnColumnDef); } PawnTableDef workTable = PawnTableDefOf.Work; bool moveWorkTypeLabelDown = false; foreach (WorkTypeDef item2 in WorkTypeDefsUtility.WorkTypeDefsInPriorityOrder.Where((WorkTypeDef d) => d.visible).Reverse()) { moveWorkTypeLabelDown = !moveWorkTypeLabelDown; PawnColumnDef pawnColumnDef2 = new PawnColumnDef(); pawnColumnDef2.defName = "WorkPriority_" + item2.defName; pawnColumnDef2.workType = item2; pawnColumnDef2.moveWorkTypeLabelDown = moveWorkTypeLabelDown; pawnColumnDef2.workerClass = typeof(PawnColumnWorker_WorkPriority); pawnColumnDef2.sortable = true; pawnColumnDef2.modContentPack = item2.modContentPack; workTable.columns.Insert(workTable.columns.FindIndex((PawnColumnDef x) => x.Worker is PawnColumnWorker_CopyPasteWorkPriorities) + 1, pawnColumnDef2); yield return(pawnColumnDef2); } }
public PawnTable(PawnTableDef def, Func <IEnumerable <Pawn> > pawnsGetter, int uiWidth, int uiHeight) { this.def = def; this.pawnsGetter = pawnsGetter; SetMinMaxSize(def.minWidth, uiWidth, 0, uiHeight); SetDirty(); }
public static IEnumerable <PawnColumnDef> ImpliedPawnColumnDefs() { PawnTableDef animalsTable = PawnTableDefOf.Animals; using (IEnumerator <TrainableDef> enumerator = (from td in DefDatabase <TrainableDef> .AllDefsListForReading orderby td.listPriority descending select td).GetEnumerator()) { if (enumerator.MoveNext()) { TrainableDef sourceDef = enumerator.Current; PawnColumnDef d3 = new PawnColumnDef { defName = "Trainable_" + sourceDef.defName, trainable = sourceDef, headerIcon = sourceDef.icon, workerClass = typeof(PawnColumnWorker_Trainable), sortable = true, headerTip = sourceDef.LabelCap, paintable = true, modContentPack = sourceDef.modContentPack }; animalsTable.columns.Insert(animalsTable.columns.FindIndex((PawnColumnDef x) => x.Worker is PawnColumnWorker_Checkbox) - 1, d3); yield return(d3); /*Error: Unable to find new state assignment for yield return*/; } } PawnTableDef workTable = PawnTableDefOf.Work; bool moveWorkTypeLabelDown2 = false; using (IEnumerator <WorkTypeDef> enumerator2 = (from d in WorkTypeDefsUtility.WorkTypeDefsInPriorityOrder where d.visible select d).Reverse().GetEnumerator()) { if (enumerator2.MoveNext()) { WorkTypeDef def = enumerator2.Current; moveWorkTypeLabelDown2 = !moveWorkTypeLabelDown2; PawnColumnDef d2 = new PawnColumnDef { defName = "WorkPriority_" + def.defName, workType = def, moveWorkTypeLabelDown = moveWorkTypeLabelDown2, workerClass = typeof(PawnColumnWorker_WorkPriority), sortable = true, modContentPack = def.modContentPack }; workTable.columns.Insert(workTable.columns.FindIndex((PawnColumnDef x) => x.Worker is PawnColumnWorker_CopyPasteWorkPriorities) + 1, d2); yield return(d2); /*Error: Unable to find new state assignment for yield return*/; } } yield break; IL_036c: /*Error near IL_036d: Unexpected return in MoveNext()*/; }
public static IEnumerable <PawnColumnDef> ImpliedPawnColumnDefs() { PawnTableDef animalsTable = PawnTableDefOf.Animals; foreach (TrainableDef sourceDef in from td in DefDatabase <TrainableDef> .AllDefsListForReading orderby td.listPriority descending select td) { PawnColumnDef d3 = new PawnColumnDef(); d3.defName = "Trainable_" + sourceDef.defName; d3.trainable = sourceDef; d3.headerIcon = sourceDef.icon; d3.workerClass = typeof(PawnColumnWorker_Trainable); d3.sortable = true; d3.headerTip = sourceDef.LabelCap; d3.paintable = true; d3.modContentPack = sourceDef.modContentPack; animalsTable.columns.Insert(animalsTable.columns.FindIndex((PawnColumnDef x) => x.Worker is PawnColumnWorker_Checkbox) - 1, d3); yield return(d3); } PawnTableDef workTable = PawnTableDefOf.Work; bool moveWorkTypeLabelDown = false; foreach (WorkTypeDef def in (from d in WorkTypeDefsUtility.WorkTypeDefsInPriorityOrder where d.visible select d).Reverse <WorkTypeDef>()) { moveWorkTypeLabelDown = !moveWorkTypeLabelDown; PawnColumnDef d2 = new PawnColumnDef(); d2.defName = "WorkPriority_" + def.defName; d2.workType = def; d2.moveWorkTypeLabelDown = moveWorkTypeLabelDown; d2.workerClass = typeof(PawnColumnWorker_WorkPriority); d2.sortable = true; d2.modContentPack = def.modContentPack; workTable.columns.Insert(workTable.columns.FindIndex((PawnColumnDef x) => x.Worker is PawnColumnWorker_CopyPasteWorkPriorities) + 1, d2); yield return(d2); } yield break; }
public PawnTable_Animals(PawnTableDef def, Func <IEnumerable <Pawn> > pawnsGetter, int uiWidth, int uiHeight) : base(def, pawnsGetter, uiWidth, uiHeight) { }
public PawnTable(PawnTableDef table, Func <IEnumerable <Pawn> > pawnsGetter, Vector2 size) : this(table.columns, pawnsGetter, size) { }
public PawnTable(PawnTableDef table, Func <IEnumerable <Pawn> > pawnsGetter, int minTableWidth, int maxTableWidth, int minTableHeight, int maxTableHeight) : this(table.columns, pawnsGetter, minTableWidth, maxTableWidth, minTableHeight, maxTableHeight) { }
public PawnTable_PlayerPawnsTimetable(PawnTableDef def, Func <IEnumerable <Pawn> > pawnsGetter, int uiWidth, int uiHeight) : base(def, pawnsGetter, uiWidth, uiHeight) { }