ShoyuVanilla / FoundryVTT-CGMP

4 stars 10 forks source link

Smart chat recall #9

Open ShoyuVanilla opened 4 years ago

ShoyuVanilla commented 4 years ago

Add an option for enable chat recalls if and only if current chat-box is empty or equals to a previous message.

Noggin01 commented 3 years ago

I'd modify the original request to allow chat recalls if the chat-box is empty OR if the cursor is at the beginning of the chat-box. Perhaps the following:

If the user presses "up" and the cursor is at the beginning of the chat box
    if the current data in the chat-box is a new message, store it in memory
    restore a previous message that begins with the message stored in memory
        for example, if the user types "/roll" then only messages starting with "/roll" will be restored
    move the cursor to the start of the chat box
    auto-select all text in the chat box
If the user presses "up" and all text is the box is selected
    restore a previous message
If the user presses "up" and the cursor is not at the beginning of the chat box but is on the top line
    move the cursor to the start of the line
If the user presses "up" and the cursor is not at the top of the chat box
    move the cursor up a line
If the user presses "down" and the cursor is at the end of the chat box
    restore the next message, or restore the stored message if we're on the final message already
    move the cursor to the end of the chat box
    auto-select all text in the chat box    
If the user presses "down" and all text is selected
    restore the next message
If the user presses "down" and the cursor is not at the end of the chat box but is on the bottom line
    move the cursor to the end of the line
If the user presses "down" and the cursor is not at the bottom of the chat box
    move the cursor down a line
If the user presses "left" and text is selected
    move the cursor to the beginning of the selected text
    deselect text
If the user presses "right" and text is selected
    move the cursor to the end of the selected text
    deselect text

I hope that's every possibility. It is sometimes amazing to see how difficult a "simple" thing can be!