DiceParser icon indicating copy to clipboard operation
DiceParser copied to clipboard

New feature: documented macros

Open jonpoveda opened this issue 4 years ago • 3 comments

Adding a new parameter to the macro recording command to add some text could help to ease macro readability.

Idea 1: adding just a comment

!macro F [-1-1]s 0 # Fudge

!macro list id: 0 Pattern: F Command: [-1-1]s Regexp: False Comment: Fudge

Idea 2: adding specific keys and values

!macro F [-1-1]s 0 Name=Fudge

!macro list id: 0 Pattern: F Command: [-1-1]s Regexp: False Name: Fudge

jonpoveda avatar Feb 13 '20 15:02 jonpoveda

It's a good idea.

obiwankennedy avatar Feb 13 '20 16:02 obiwankennedy

Right now, macro and aliases are stored inside json files. I worked to port data storage to database, I never put this work in production. it needs more tests. I may use the comment as a datatable key. So It may be mandatory to set a name.

obiwankennedy avatar Feb 17 '20 16:02 obiwankennedy

@obiwankennedy it makes sense to have unique names, so it seems a good idea to use them as a key (or a hash of the name, but then it'll need an extra field for the actual name to display). Moreover, that will allow to delete (or even update) macros by name instead of by number. So, two features in one. :ok_hand:

jonpoveda avatar Feb 17 '20 16:02 jonpoveda