Skip to content

Support conditional statements in alias command sequences #3

@devoreofox

Description

@devoreofox

Problem/Opportunity Space

Currently all commands in an alias sequence execute unconditionally in order. There is no way to execute a command only under certain conditions, such as only if the player is in a specific zone, job, or party state. This limits the expressiveness of aliases for users who want context-aware behaviour.

Acceptance Criteria

  • Users can attach a condition to any command entry in a sequence
  • If the condition is not met, that command is skipped and execution continues with the next
  • Conditions are evaluated at execution time, not at definition time
  • The UI clearly communicates when a condition is attached to a command

Suggested solution

Extend CommandEntry with an optional condition field. Define an initial set of supported condition types such as job check, zone check, and party state. Evaluate conditions inside CommandHandler.ExecuteAsync before firing each command.

Suggested design

  • Add an optional Condition property to CommandEntry
  • Define a ICondition interface with an Evaluate() method
  • Implement initial condition types: CurrentJob, CurrentZone, InParty
  • Add condition configuration UI in EditWindow per command entry
  • CommandHandler.ExecuteAsync checks condition before executing each command

Testing Considerations

Happy path

  • Command with a passing condition executes normally
  • Command with a failing condition is skipped without aborting the sequence
  • Commands without conditions are unaffected
  • Condition evaluates correctly at execution time not definition time

Sad path

  • Condition evaluation failure does not crash the sequence
  • Invalid condition configuration is caught at save time
  • Sequence with all conditions failing completes without executing any commands
  • Condition referencing unavailable game state fails gracefully

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions