本文整理汇总了C#中Pawn.FollowsDrafted方法的典型用法代码示例。如果您正苦于以下问题:C# Pawn.FollowsDrafted方法的具体用法?C# Pawn.FollowsDrafted怎么用?C# Pawn.FollowsDrafted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pawn
的用法示例。
在下文中一共展示了Pawn.FollowsDrafted方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawPawnRow
protected override void DrawPawnRow( Rect rect, Pawn p )
{
// sizes for stuff
float heightOffset = ( rect.height - iconSize ) / 2;
float widthOffset = ( 50 - iconSize ) / 2;
GUI.BeginGroup( rect );
var curX = 175f;
if ( p.training.IsCompleted( TrainableDefOf.Obedience ) )
{
var rect2 = new Rect( curX, 0f, 90f, rect.height );
Rect rect3 = rect2.ContractedBy( 2f );
string label = p.playerSettings.master == null
? "NoneLower".Translate()
: p.playerSettings.master.LabelShort;
Text.Font = GameFont.Small;
if ( Widgets.ButtonText( rect3, label ) )
{
TrainableUtility.OpenMasterSelectMenu( p );
}
}
curX += 90f;
if ( Widgets_PetFollow.PetFollowAvailable )
{
Rect draftedRect = new Rect( curX, 0f, 25f, 30f );
Rect hunterRect = new Rect( curX + 25f, 0f, 25f, 30f );
curX += 50f;
if ( p.CanFollow() )
{
Rect draftedIconRect =
new Rect( 0f, 0f, iconSize, iconSize ).CenteredOnYIn( draftedRect ).CenteredOnXIn( draftedRect );
Rect hunterIconRect =
new Rect( 0f, 0f, iconSize, iconSize ).CenteredOnYIn( hunterRect ).CenteredOnXIn( hunterRect );
// handle drafted follow
bool followDrafted = p.FollowsDrafted();
string draftedTip = followDrafted
? "Fluffy.PetFollow.FollowingDrafted".Translate()
: "Fluffy.PetFollow.NotFollowingDrafted".Translate();
TooltipHandler.TipRegion( draftedRect, draftedTip );
if ( followDrafted )
GUI.DrawTexture( draftedIconRect, WorkBoxCheckTex );
if ( Mouse.IsOver( draftedRect ) )
Widgets.DrawHighlight( draftedIconRect );
if ( Widgets.ButtonInvisible( draftedRect ) )
{
p.FollowsDrafted( !followDrafted );
if ( followDrafted )
SoundDefOf.CheckboxTurnedOff.PlayOneShotOnCamera();
else
SoundDefOf.CheckboxTurnedOn.PlayOneShotOnCamera();
}
// handle hunter follow
bool followHunter = p.FollowsHunter();
string hunterTip = followHunter
? "Fluffy.PetFollow.FollowingHunter".Translate()
: "Fluffy.PetFollow.NotFollowingHunter".Translate();
TooltipHandler.TipRegion( hunterRect, hunterTip );
if ( followHunter )
GUI.DrawTexture( hunterIconRect, WorkBoxCheckTex );
if ( Mouse.IsOver( hunterRect ) )
Widgets.DrawHighlight( hunterIconRect );
if ( Widgets.ButtonInvisible( hunterRect ) )
{
p.FollowsHunter( !followHunter );
if ( followHunter )
SoundDefOf.CheckboxTurnedOff.PlayOneShotOnCamera();
else
SoundDefOf.CheckboxTurnedOn.PlayOneShotOnCamera();
}
}
}
var recta = new Rect( curX + widthOffset, heightOffset, iconSize, iconSize );
Texture2D labelSex = GenderTextures[(int) p.gender];
TipSignal tipSex = p.gender.ToString();
GUI.DrawTexture( recta, labelSex );
TooltipHandler.TipRegion( recta, tipSex );
curX += 50f;
var rectb = new Rect( curX + widthOffset, heightOffset, iconSize, iconSize );
Texture2D labelAge = p.RaceProps.lifeStageAges.Count > 3
? LifeStageTextures[3]
: LifeStageTextures[p.ageTracker.CurLifeStageIndex];
TipSignal tipAge = p.ageTracker.CurLifeStage.LabelCap + ", " + p.ageTracker.AgeBiologicalYears;
GUI.DrawTexture( rectb, labelAge );
TooltipHandler.TipRegion( rectb, tipAge );
curX += 50f;
//.........这里部分代码省略.........