noodlebox / KawaiiDiscord

Add huge sets of external emotes to Discord
MIT License
6 stars 2 forks source link

Add rolled emotes to completion menu #13

Closed noodlebox closed 7 years ago

noodlebox commented 8 years ago

Completion menu should show possible rolls (emotes ending with #) among completion options. There are a few things to decide or figure out first:

Ordering

Potential rolls should appear either before or after all other numeric matches. Normally, name# would appear between name and name2. As a parameter for the collator, ignore­Punctua­tion causes name# and name to be treated as equal, though this may not be foolproof as sort is not be guaranteed to be stable. A custom comparator could resolve all possible ordering issues.

Useful results

Only show non-trivial rolls, as any valid emote followed by # is a technically valid roll (first emote in any set does not have a 1 suffix). Only show rolls when:

If the current query contains a roll which would which would be valid (even if not otherwise shown, based on the previous rules) or a wildcard match as described in #12, show it as the only match.

Rendering

Rolls could either be rendered as the fallback emote (rollDefault), or could be animated by quickly cycling through potential matches.

noodlebox commented 7 years ago

Decided not to over-complicate things (for now), and just allowed rolls to generate completion lists.