rjw-whoring/1.3/Source/Mod/WhoringTab/PawnTable_Whores.cs

33 lines
1.1 KiB
C#
Raw Normal View History

2022-07-16 19:50:21 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using RimWorld;
using rjw;
using Verse;
namespace rjwwhoring.MainTab
{
2022-07-26 08:09:23 +00:00
public class PawnTable_Whores : PawnTable_PlayerPawns
2022-07-16 19:50:21 +00:00
{
public PawnTable_Whores(PawnTableDef def, Func<IEnumerable<Pawn>> pawnsGetter, int uiWidth, int uiHeight) : base(def, pawnsGetter, uiWidth, uiHeight) { }
2022-07-26 08:09:23 +00:00
//default sorting
2022-07-16 19:50:21 +00:00
protected override IEnumerable<Pawn> LabelSortFunction(IEnumerable<Pawn> input)
{
2022-07-26 08:09:23 +00:00
//return input.OrderBy(p => p.Name);
foreach (Pawn p in input)
p.UpdatePermissions();
return input.OrderByDescending(p => (p.IsPrisonerOfColony || p.IsSlaveOfColony) != false).ThenBy(p => xxx.get_pawnname(p));
//return input.OrderByDescending(p => (p.IsPrisonerOfColony || p.IsSlaveOfColony) != false).ThenBy(p => (p.Name.ToStringShort.Colorize(Color.yellow)));
//return input.OrderBy(p => xxx.get_pawnname(p));
2022-07-16 19:50:21 +00:00
}
protected override IEnumerable<Pawn> PrimarySortFunction(IEnumerable<Pawn> input)
{
foreach (Pawn p in input)
p.UpdatePermissions();
2022-07-26 08:09:23 +00:00
return input;
//return base.PrimarySortFunction(input);
2022-07-16 19:50:21 +00:00
}
}
}