antirez/protoview

Ability to create a field with an array of strings

MacieGx opened this issue · 1 comments

We currently have the ability to add a str field and we have a nice keyboard where we can edit it.
However, sometimes the number of possibilities may be limited and it would be nice to be able to choose one from a pre-prepared list.
This can also be useful for describing other types (e.g. button lock/unlock) instead of using byte or int.

Pseudocode for better visualization:

fieldset_add_str_arr(info->fieldset,"Button",{"Lock", "Unlock"},2,0);

It would work so that instead of editing on the keyboard, we would switch between strings from the list using the arrows.

I am convinced that you know what I mean.
Let me know what do you think about it 😉

Hey! That makes sense indeed. Kinda of an ENUM. And the ENUM should be able to map to different things, in theory. Numbers, strings, ... so maybe it should be a super-field which fields are normal fields. Or a Enum could be just a FiledSet :D As we already have. I'll keep this posted to implement it the first time it is required in an actual protocol. Thank you.