As the title says. Aside from a floatmenu approach, I'd like to know if there was a way in RimWorld c# to specify only the pawn actively selected by the game's player.
I looked at the selector class but didn't have any luck implementing it.
Basically in my lovemaking mod it's working great, the only caveat is without player direction everyone does there own thing, with idlers tending to go on fapping binges.
Jokes aside, this method instead of floatmenus wil allow me to have a lot more easier flexibility in updating the code down the road
In the workgiver you could put a line at the top to test if the potential pawn is selected. If it is, carry on. If it isn't, return null.
The function you want is in Find.Selector, either SingleSelectedThing or SelectedObjects. Just check if the pawn is in one of those and you should be good :)
Quote from: mipen on January 25, 2015, 06:26:38 AM
In the workgiver you could put a line at the top to test if the potential pawn is selected. If it is, carry on. If it isn't, return null.
The function you want is in Find.Selector, either SingleSelectedThing or SelectedObjects. Just check if the pawn is in one of those and you should be good :)
Thanks for the advice mate, I'll give that a go today and let us know how it turns out.
Would it be something like:
If (mypawn = find.selector.selectedobjects)
//Or
If (mypawn = find.selector.selectedobjects(obj))
Maybe you could do this:
if (!Find.Selector.IsSelected(myPawn))
return null;
Quote from: Haplo on January 25, 2015, 12:24:46 PM
Maybe you could do this:
if (!Find.Selector.IsSelected(myPawn))
return null;
That worked like a charm!
Thank you both Mipen & Haplo :)