Skip to content

Commit

Permalink
fix right click menu for clothingrack with multiple apparel items stored
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorVanGogh committed Oct 25, 2018
1 parent e5b5e43 commit c22a204
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
Binary file modified Assemblies/ExtendedStorage.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,26 @@ private static FloatMenuOption CreateMenuOption(Pawn pawn, Apparel apparel)
{
// original code taken from FloatMenuMakerMap_AddHumanlikeOrders
if (!pawn.CanReach(apparel, PathEndMode.ClosestTouch, Danger.Deadly, false, TraverseMode.ByPawn))
return new FloatMenuOption("CannotWear".Translate(apparel.Label) + " (" + "NoPath".Translate() + ")", null, MenuOptionPriority.Default, null, null, 0f, null, null);
if (!ApparelUtility.HasPartsToWear(pawn, apparel.def))
return new FloatMenuOption("CannotWear".Translate(apparel.Label) + " (" + "CannotWearBecauseOfMissingBodyParts".Translate() + ")", null, MenuOptionPriority.Default, null, null, 0f,
null, null);
return FloatMenuUtility.DecoratePrioritizedTask(
new FloatMenuOption(
"ForceWear".Translate(apparel.LabelShort),
() =>
{
apparel.SetForbidden(false, true);
Job job = new Job(JobDefOf.Wear, apparel);
pawn.jobs.TryTakeOrderedJob(job, JobTag.Misc);
},
MenuOptionPriority.High,
null,
null,
0f,
null,
null),
pawn,
apparel,
"ReservedBy");
{
return new FloatMenuOption("CannotWear".Translate(apparel.Label, apparel) + " (" + "NoPath".Translate() + ")", null, MenuOptionPriority.Default, null, null, 0f, null, null);
}
else if (apparel.IsBurning())
{
return new FloatMenuOption("CannotWear".Translate(apparel.Label, apparel) + " (" + "BurningLower".Translate() + ")", null, MenuOptionPriority.Default, null, null, 0f, null, null);
}
else if (!ApparelUtility.HasPartsToWear(pawn, apparel.def))
{
return new FloatMenuOption("CannotWear".Translate(apparel.Label, apparel) + " (" + "CannotWearBecauseOfMissingBodyParts".Translate() + ")", null, MenuOptionPriority.Default, null, null, 0f, null, null);
}
else
{
return FloatMenuUtility.DecoratePrioritizedTask(new FloatMenuOption("ForceWear".Translate(apparel.LabelShort, apparel), delegate
{
apparel.SetForbidden(false, true);
Job job = new Job(JobDefOf.Wear, apparel);
pawn.jobs.TryTakeOrderedJob(job, JobTag.Misc);
}, MenuOptionPriority.High, null, null, 0f, null, null), pawn, apparel, "ReservedBy");
}
}
}
}
4 changes: 2 additions & 2 deletions Source/ExtendedStorage/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("a8e081b6-8768-4fe9-817f-f0ee42cf13ef")]
[assembly: AssemblyVersion("3.4.0.*")]
[assembly: AssemblyFileVersion("3.4.0.0")]
[assembly: AssemblyVersion("3.4.1.*")]
[assembly: AssemblyFileVersion("3.4.1.0")]

0 comments on commit c22a204

Please sign in to comment.