Skip to content

v0.8.2

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 27 Jul 22:25
· 16 commits to main since this release
ecad29a

Enhanced .help with IConverterUsage

Now custom converters can implement IConverterUsage like:

// Example of matching horses in LeadAHorseToWater

public record Horse(Entity Entity);

public class NamedHorseConverter : CommandArgumentConverter<Horse, ChatCommandContext>, IConverterUsage
{

// New:
     public string Usage => $"Closest horse in {RADIUS} unit radius, first matching name if provided."
     const int RADIUS  =25;
...
}

public Enum HorseType {Special, Regular}

Enums and Usage in .help

Now for commands that have a Horse argument, invoking their individual help will list the possible values of Enum i.e.

[Command("example")]
void UpdateType(ChatCommandContext ctx, Horse closest=null, HorseType type = HorseType.Regular) => ...

When running .help example included in the response will be

Horse: Closest horse in 25 unit radius, first matching name if provided.
HorseType: Special, Regular

Enums should parse strictly

Fixed decaprime/CommunityCommands/issues/12 via framework change. This is a great bug to be reported, thank you @robotomist . The expectation is that VampireCommandFramework should handle argument matching and parsing, in this case the built in converter for Enums was letting in values that weren't valid as expected in the commands and so was fixed by #17.

What's Changed

Full Changelog: v0.8.0...v0.8.2