This commit is contained in:
Ed86 2022-07-26 11:09:23 +03:00
parent 305c62a991
commit d56c5016f8
7 changed files with 38 additions and 18 deletions

View file

@ -3,7 +3,6 @@
<PawnColumnDef> <PawnColumnDef>
<defName>RJW_IsWhore</defName> <defName>RJW_IsWhore</defName>
<headerTip>Whores</headerTip> <headerTip>Whores</headerTip>
<headerIcon>UI/Tab/Service_off</headerIcon>
<workerClass>rjwwhoring.MainTab.PawnColumnWorker_IsWhore</workerClass> <workerClass>rjwwhoring.MainTab.PawnColumnWorker_IsWhore</workerClass>
<sortable>true</sortable> <sortable>true</sortable>
<width>80</width> <width>80</width>
@ -11,7 +10,6 @@
<PawnColumnDef> <PawnColumnDef>
<defName>RJW_IsPrisoner</defName> <defName>RJW_IsPrisoner</defName>
<headerTip>Prisoners</headerTip> <headerTip>Prisoners</headerTip>
<headerIcon>UI/Tab/ComfortPrisoner_off</headerIcon>
<workerClass>rjwwhoring.MainTab.PawnColumnWorker_IsPrisoner</workerClass> <workerClass>rjwwhoring.MainTab.PawnColumnWorker_IsPrisoner</workerClass>
<sortable>true</sortable> <sortable>true</sortable>
<width>80</width> <width>80</width>
@ -19,7 +17,6 @@
<PawnColumnDef> <PawnColumnDef>
<defName>RJW_IsSlave</defName> <defName>RJW_IsSlave</defName>
<headerTip>Slaves</headerTip> <headerTip>Slaves</headerTip>
<headerIcon>UI/Tab/ComfortPrisoner_off</headerIcon>
<workerClass>rjwwhoring.MainTab.PawnColumnWorker_IsSlave</workerClass> <workerClass>rjwwhoring.MainTab.PawnColumnWorker_IsSlave</workerClass>
<sortable>true</sortable> <sortable>true</sortable>
<width>80</width> <width>80</width>
@ -29,7 +26,6 @@
<headerTip>Whoring experience</headerTip> <headerTip>Whoring experience</headerTip>
<label>Experience</label> <label>Experience</label>
<workerClass>rjwwhoring.MainTab.PawnColumnWorker_WhoreExperience</workerClass> <workerClass>rjwwhoring.MainTab.PawnColumnWorker_WhoreExperience</workerClass>
<sortable>true</sortable>
<width>100</width> <width>100</width>
</PawnColumnDef> </PawnColumnDef>
<PawnColumnDef> <PawnColumnDef>
@ -37,7 +33,6 @@
<headerTip>Price range for whore</headerTip> <headerTip>Price range for whore</headerTip>
<label>Price</label> <label>Price</label>
<workerClass>rjwwhoring.MainTab.PawnColumnWorker_PriceRangeOfWhore</workerClass> <workerClass>rjwwhoring.MainTab.PawnColumnWorker_PriceRangeOfWhore</workerClass>
<sortable>true</sortable>
<width>100</width> <width>100</width>
</PawnColumnDef> </PawnColumnDef>
<PawnColumnDef> <PawnColumnDef>
@ -45,7 +40,6 @@
<headerTip>Money earned(total)</headerTip> <headerTip>Money earned(total)</headerTip>
<label>Earned</label> <label>Earned</label>
<workerClass>rjwwhoring.MainTab.PawnColumnWorker_EarnedMoneyByWhore</workerClass> <workerClass>rjwwhoring.MainTab.PawnColumnWorker_EarnedMoneyByWhore</workerClass>
<sortable>true</sortable>
<width>100</width> <width>100</width>
</PawnColumnDef> </PawnColumnDef>
<PawnColumnDef> <PawnColumnDef>
@ -53,7 +47,6 @@
<headerTip>Clients served</headerTip> <headerTip>Clients served</headerTip>
<label>Clients</label> <label>Clients</label>
<workerClass>rjwwhoring.MainTab.PawnColumnWorker_CountOfWhore</workerClass> <workerClass>rjwwhoring.MainTab.PawnColumnWorker_CountOfWhore</workerClass>
<sortable>true</sortable>
<width>100</width> <width>100</width>
</PawnColumnDef> </PawnColumnDef>
<PawnColumnDef> <PawnColumnDef>
@ -61,7 +54,6 @@
<headerTip>Money earned(average)</headerTip> <headerTip>Money earned(average)</headerTip>
<label>Average</label> <label>Average</label>
<workerClass>rjwwhoring.MainTab.PawnColumnWorker_AverageMoneyByWhore</workerClass> <workerClass>rjwwhoring.MainTab.PawnColumnWorker_AverageMoneyByWhore</workerClass>
<sortable>true</sortable>
<width>100</width> <width>100</width>
</PawnColumnDef> </PawnColumnDef>
<PawnColumnDef> <PawnColumnDef>
@ -69,7 +61,6 @@
<headerTip>Mood of pawn</headerTip> <headerTip>Mood of pawn</headerTip>
<label>Mood</label> <label>Mood</label>
<workerClass>rjwwhoring.MainTab.PawnColumnWorker_Mood</workerClass> <workerClass>rjwwhoring.MainTab.PawnColumnWorker_Mood</workerClass>
<sortable>true</sortable>
<width>100</width> <width>100</width>
</PawnColumnDef> </PawnColumnDef>
</Defs> </Defs>

View file

@ -36,4 +36,6 @@
<WhorePriceCalcDesc>Whoring price factor (based on comfort, room impressiveness and number of beds in room: {0}</WhorePriceCalcDesc> <WhorePriceCalcDesc>Whoring price factor (based on comfort, room impressiveness and number of beds in room: {0}</WhorePriceCalcDesc>
<WhorePrice>Whoring price range: </WhorePrice> <WhorePrice>Whoring price range: </WhorePrice>
<BrothelTabIsPrisoner>Prisoner</BrothelTabIsPrisoner>
<BrothelTabIsSlave>Slave</BrothelTabIsSlave>
</LanguageData> </LanguageData>

View file

@ -14,10 +14,21 @@ namespace rjwwhoring.MainTab
{ {
private static readonly Texture2D comfortOn = ContentFinder<Texture2D>.Get("UI/Tab/ComfortPrisoner_on"); private static readonly Texture2D comfortOn = ContentFinder<Texture2D>.Get("UI/Tab/ComfortPrisoner_on");
private readonly Texture2D comfortOff = ContentFinder<Texture2D>.Get("UI/Tab/ComfortPrisoner_off"); private readonly Texture2D comfortOff = ContentFinder<Texture2D>.Get("UI/Tab/ComfortPrisoner_off");
private readonly Texture2D comfortOff_nobg = ContentFinder<Texture2D>.Get("UI/Tab/ComfortPrisoner_off_nobg");
protected override Texture2D GetIconFor(Pawn pawn) protected override Texture2D GetIconFor(Pawn pawn)
{ {
return pawn.IsPrisonerOfColony ? comfortOn : null; return pawn.IsPrisonerOfColony ? comfortOff_nobg : null;
}
protected override string GetIconTip(Pawn pawn)
{
//string str = (pawn != null) ? pawn.guest.GetLabel() : null;
//if (!str.NullOrEmpty())
//{
// return str.CapitalizeFirst();
//}
//return null;
return "BrothelTabIsPrisoner".Translate();
} }
} }
} }

View file

@ -14,10 +14,22 @@ namespace rjwwhoring.MainTab
{ {
private static readonly Texture2D comfortOn = ContentFinder<Texture2D>.Get("UI/Tab/ComfortPrisoner_on"); private static readonly Texture2D comfortOn = ContentFinder<Texture2D>.Get("UI/Tab/ComfortPrisoner_on");
private readonly Texture2D comfortOff = ContentFinder<Texture2D>.Get("UI/Tab/ComfortPrisoner_off"); private readonly Texture2D comfortOff = ContentFinder<Texture2D>.Get("UI/Tab/ComfortPrisoner_off");
private readonly Texture2D comfortOff_nobg = ContentFinder<Texture2D>.Get("UI/Tab/ComfortPrisoner_off_nobg");
protected override Texture2D GetIconFor(Pawn pawn) protected override Texture2D GetIconFor(Pawn pawn)
{ {
return xxx.is_slave(pawn) ? comfortOn : null; return xxx.is_slave(pawn) ? ModsConfig.IdeologyActive ? GuestUtility.SlaveIcon : comfortOff_nobg : null;
//return xxx.is_slave(pawn) ? comfortOff : null;
}
protected override string GetIconTip(Pawn pawn)
{
//string str = (pawn != null) ? pawn.guest.GetLabel() : null;
//if (!str.NullOrEmpty())
//{
// return str.CapitalizeFirst();
//}
//return null;
return "BrothelTabIsSlave".Translate();
;
} }
} }
} }

View file

@ -7,23 +7,27 @@ using Verse;
namespace rjwwhoring.MainTab namespace rjwwhoring.MainTab
{ {
public class PawnTable_Whores : PawnTable public class PawnTable_Whores : PawnTable_PlayerPawns
{ {
public PawnTable_Whores(PawnTableDef def, Func<IEnumerable<Pawn>> pawnsGetter, int uiWidth, int uiHeight) : base(def, pawnsGetter, uiWidth, uiHeight) { } public PawnTable_Whores(PawnTableDef def, Func<IEnumerable<Pawn>> pawnsGetter, int uiWidth, int uiHeight) : base(def, pawnsGetter, uiWidth, uiHeight) { }
//default sorting
protected override IEnumerable<Pawn> LabelSortFunction(IEnumerable<Pawn> input) protected override IEnumerable<Pawn> LabelSortFunction(IEnumerable<Pawn> input)
{ {
//return input.OrderBy(p => p.Name?.Numerical != false).ThenBy(p => (p.Name as NameSingle)?.Number ?? 0).ThenBy(p => p.def.label); //return input.OrderBy(p => p.Name);
return input.OrderBy(p => xxx.get_pawnname(p)); 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));
} }
protected override IEnumerable<Pawn> PrimarySortFunction(IEnumerable<Pawn> input) protected override IEnumerable<Pawn> PrimarySortFunction(IEnumerable<Pawn> input)
{ {
///return input.OrderByDescending(p => p.Faction?.Name);
//return input.OrderBy(p => xxx.get_pawnname(p));
foreach (Pawn p in input) foreach (Pawn p in input)
p.UpdatePermissions(); p.UpdatePermissions();
return input.OrderByDescending(p => p.IsColonist); return input;
//return base.PrimarySortFunction(input);
} }
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB