Skip to content

Commit

Permalink
Removed linq
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxDorob committed Dec 3, 2024
1 parent c617309 commit 9cc2ed9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Source/CombatExtended/CombatExtended/Comps/CompVerbDisabler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@ public override IEnumerable<Gizmo> CompGetGizmosExtra()
{
yield return gizmo;
}
var verbs = parent.GetComp<CompEquippable>()?.AllVerbs.OfType<IVerbDisableable>();
var verbs = parent.GetComp<CompEquippable>()?.AllVerbs;
if (verbs != null)
{
foreach (var verb in verbs)
{
if (!(verb is IVerbDisableable disableableVerb))
{
continue;
}
var command = new Command_Toggle()
{
defaultDesc = verb.HoldFireDesc.Translate(),
defaultLabel = verb.HoldFireLabel.Translate(),
icon = verb.HoldFireIcon,
isActive = () => verb.HoldFire,
toggleAction = () => verb.HoldFire = !verb.HoldFire,
defaultDesc = disableableVerb.HoldFireDesc.Translate(),
defaultLabel = disableableVerb.HoldFireLabel.Translate(),
icon = disableableVerb.HoldFireIcon,
isActive = () => disableableVerb.HoldFire,
toggleAction = () => disableableVerb.HoldFire = !disableableVerb.HoldFire,

};
yield return command;
Expand Down

0 comments on commit 9cc2ed9

Please sign in to comment.