scionaltera / agony-engine

A modern, web based, procedurally generated MUD.
https://agonyengine.com
MIT License
17 stars 5 forks source link

Tab completion for Actor targets #163

Open scionaltera opened 6 years ago

scionaltera commented 6 years ago

It would be really convenient if, when you type a command into the input bar like "GET " and hit TAB you'd get some auto-completion based on the items that are on the floor in the room you're in. "DROP " would complete based on items in your inventory, etc.

There are a few tricks to this one:

  1. Tab completion happens on the client. It's going to need to make requests for information to the server but the bulk of this task is a simple, performant UI element that offers completion choices. I'm not sure what the right one is, but my go-to idea would be something like what bash does.
  2. Tab completion needs to be context aware. You already know which command has been typed, so you can find out what the arguments are for that command via a REST call or STOMP message to the server and request the appropriate list of objects for the completion.
  3. Completion for commands and other parts of the syntax will be covered in other tickets, but this should provide a framework for adding those later.