70 lines
1.7 KiB
C#
70 lines
1.7 KiB
C#
using System.Collections.Generic;
|
|
using RimWorld;
|
|
using Verse;
|
|
|
|
namespace ArachnaeSwarm
|
|
{
|
|
public class BeastUnit : Pawn
|
|
{
|
|
public override void DrawExtraSelectionOverlays()
|
|
{
|
|
base.DrawExtraSelectionOverlays();
|
|
pather.curPath?.DrawPath(this);
|
|
jobs.DrawLinesBetweenTargets();
|
|
}
|
|
|
|
public override IEnumerable<Gizmo> GetGizmos()
|
|
{
|
|
foreach (Gizmo gizmo in base.GetGizmos())
|
|
{
|
|
yield return gizmo;
|
|
}
|
|
if (drafter == null)
|
|
{
|
|
yield break;
|
|
}
|
|
foreach (Gizmo draftGizmo in GetDraftGizmos())
|
|
{
|
|
yield return draftGizmo;
|
|
}
|
|
}
|
|
|
|
public IEnumerable<Gizmo> GetDraftGizmos()
|
|
{
|
|
if (!drafter.ShowDraftGizmo)
|
|
{
|
|
yield break;
|
|
}
|
|
Command_Toggle command_Toggle = new Command_Toggle
|
|
{
|
|
hotKey = KeyBindingDefOf.Command_ColonistDraft,
|
|
isActive = () => base.Drafted,
|
|
toggleAction = delegate
|
|
{
|
|
drafter.Drafted = !drafter.Drafted;
|
|
PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.Drafting, KnowledgeAmount.SpecificInteraction);
|
|
if (base.Drafted)
|
|
{
|
|
LessonAutoActivator.TeachOpportunity(ConceptDefOf.QueueOrders, OpportunityType.GoodToKnow);
|
|
}
|
|
},
|
|
defaultDesc = "CommandToggleDraftDesc".Translate(),
|
|
icon = TexCommand.Draft,
|
|
turnOnSound = SoundDefOf.DraftOn,
|
|
turnOffSound = SoundDefOf.DraftOff,
|
|
groupKeyIgnoreContent = 81729172,
|
|
defaultLabel = (base.Drafted ? "CommandUndraftLabel" : "CommandDraftLabel").Translate()
|
|
};
|
|
if (base.Downed)
|
|
{
|
|
command_Toggle.Disable("IsIncapped".Translate(LabelShort, this));
|
|
}
|
|
if (base.Deathresting)
|
|
{
|
|
command_Toggle.Disable("IsDeathresting".Translate(this.Named("PAWN")));
|
|
}
|
|
command_Toggle.tutorTag = ((!base.Drafted) ? "Draft" : "Undraft");
|
|
yield return command_Toggle;
|
|
}
|
|
}
|
|
} |