Add configurable target cursors to various traits

This commit is contained in:
Ivaylo Draganov
2020-05-15 01:16:29 +03:00
committed by abcdefg30
parent d193ef856e
commit 393f6eca3a
4 changed files with 22 additions and 10 deletions

View File

@@ -26,6 +26,9 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Identifier checked against AcceptsDeliveredExperience.ValidTypes. Only needed if the latter is not empty.")]
public readonly string Type = null;
[Desc("Cursor to show when hovering over a valid actor to deliver experience to.")]
public readonly string Cursor = "enter";
[VoiceReference]
public readonly string Voice = "Action";
@@ -50,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits
get
{
if (gainsExperience.Level != 0)
yield return new DeliversExperienceOrderTargeter();
yield return new DeliversExperienceOrderTargeter(info);
}
}
@@ -90,8 +93,8 @@ namespace OpenRA.Mods.Common.Traits
public class DeliversExperienceOrderTargeter : UnitOrderTargeter
{
public DeliversExperienceOrderTargeter()
: base("DeliverExperience", 5, "enter", true, true) { }
public DeliversExperienceOrderTargeter(DeliversExperienceInfo info)
: base("DeliverExperience", 5, info.Cursor, true, true) { }
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
{